Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move types from @types/parse to this repository. #7336

Conversation

sadortun
Copy link
Contributor

New Pull Request Checklist

Issue Description

Related issue: #7334

Approach

This is the step (1) discussed in #7334. Simply move the declarations from @types/parse to here.

WIP If it seems OK, ill split up the types definitions and submit a PR in the js-sdk so each projects have their respective types

I'll also make another PR later with tests from flow-to-typescript in order to generate types definitions directly from the code. ( again discussed previously in #7334 )

TODOs before merging

  • Split definitions in js-sdk and server

  • Add entry to changelog

@sadortun sadortun changed the title WIP: Move types from @types/parse to this repository. Move types from @types/parse to this repository. Apr 11, 2021
@codecov
Copy link

codecov bot commented Apr 11, 2021

Codecov Report

Merging #7336 (93fadca) into master (45d00ce) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 93fadca differs from pull request most recent head 12c38f7. Consider uploading reports for the commit 12c38f7 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7336      +/-   ##
==========================================
- Coverage   93.91%   93.89%   -0.02%     
==========================================
  Files         181      181              
  Lines       13194    13194              
==========================================
- Hits        12391    12389       -2     
- Misses        803      805       +2     
Impacted Files Coverage Δ
src/Adapters/Files/GridFSBucketAdapter.js 79.50% <0.00%> (-0.82%) ⬇️
src/RestWrite.js 93.92% <0.00%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45d00ce...12c38f7. Read the comment docs.

@mtrezza
Copy link
Member

mtrezza commented Apr 11, 2021

Are you sure the effort you put into this PR is worth it?

Whether types are in DefinitelyTyped or in this repo won't make any difference to the developer. This PR will be "reverted" with generated types, for which there is even an already working PR #7335.

Would it make more sense to start a PR with flow-to-ts to compare that approach to #7335 and go from there?

See #7334 (comment)

@sadortun
Copy link
Contributor Author

sadortun commented Apr 11, 2021

@mtrezza

Are you sure the effort you put into this PR is worth it?

It took me less than 10 minutes, and splitting types between repo is maybe another 20-30 minutes :)

Would it make more sense to start a PR with flow-to-ts to compare that approach to #7335 and go from there?

Yep, see #7337, but as i fear, there is > 1000 Typescript errors ;)

@dblythy
Copy link
Member

dblythy commented Apr 11, 2021

As discussed in #7335, I feel like it makes sense for these to be in the JS SDK repo, as the types are mostly related to JS methods such as query, which are predominantly used client side and not ParseServer side (although obviously most Parse Server packages use the Parse JS SDK as a dependency).

I think the types here should be related to ParseServer (such as enforcing databaseURI is a string), which I believe currently happens here.

@sadortun
Copy link
Contributor Author

@dblythy

I feel like it makes sense for these to be in the JS SDK repo

Yes, it will be, i'm just waiting for your OK on this "proof of concept" and ill submit also a PR in js-sdk with appropriate types :)

@mtrezza
Copy link
Member

mtrezza commented Apr 11, 2021

I still don't understand what the purpose of moving the manual types into our repos is, what benefit does that bring? And again, this exercise will be reverted in a few weeks, maybe even before the next release, by auto generated types.

A benefit of keeping manual types in DefinitelyTyped while gradually building our automated types may be that developers can choose either one and switch to auto types onces they are mature enough.

Any effort put into the manual types will be for nothing. @dblythy manually updated the types to do some quick fixes for developers who already use the types, I get that. But now we want to put even more effort into manual types, although they will be gone soon?

@sadortun
Copy link
Contributor Author

And again, this exercise will be reverted in a few weeks

The only point of moving the types over is to make them more maintnable and up to date.

If you think it's a mather of weeks for getting generated types working , I'll just close the issue/PR, and we will go for the generated Avenue for sure!

For what I've seen so far, getting generated types to work was quite.a big undertaking. While just bringing the types back in their appropriate repos is like a 1 hour job ...

@sadortun sadortun closed this Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants