-
-
Notifications
You must be signed in to change notification settings - Fork 598
feat: Publish TypeScript definitions #2491
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
Conversation
🚀 Thanks for opening this pull request! |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## alpha #2491 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 64 64
Lines 6244 6244
Branches 1456 1456
=========================================
Hits 6244 6244 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
# [6.1.0-alpha.3](6.1.0-alpha.2...6.1.0-alpha.3) (2025-03-16) ### Features * Publish TypeScript definitions ([#2491](#2491)) ([fc3e573](fc3e573))
🎉 This change has been released in version 6.1.0-alpha.3 |
# [6.1.0](6.0.0...6.1.0) (2025-03-17) ### Features * Add `Parse.Query` option `useMaintenanceKey` ([#2484](#2484)) ([2ead3f3](2ead3f3)) * Allow `Parse.Object` field names to begin with underscore `_` to access internal fields of Parse Server ([#2475](#2475)) ([08e43ba](08e43ba)) * Publish TypeScript definitions ([#2491](#2491)) ([fc3e573](fc3e573))
🎉 This change has been released in version 6.1.0 |
hi @dplewis @mtrezza i think we have an issue here Published types seems to be JS docs but it leads TS expect true types. also i don't know how @types/parse was managed but if generated types here are different than @types/parse, it could be a breaking change for developers using typescript. After an upgrade to parse v6 and removing @types/parse on our monorepo, we have many failures It seems that only documentation types are supported in TS files, not JSDoc types:
https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html |
|
Or i maybe missed something, i checked parse definition in parse-server, it seems that parse.cloud is not extended on parse-server new type defs |
Hm, are these just a few missing types maybe? I couldn't find |
humm there is missing types and also it seems to have conflicts with @types/parse, for TS users the update done here is quite a breaking change, because:
So it will force developpers to downgrade and stay on parse v5 until a fix is done. I'm juste curious why we don't just take types from @types/parse here, then progressively we resolve types conflicts and type coverage from js docs etc.... I'm suggestion to copy/parse types of @types/parse for an easier migration for TS developers from v5 to v6, then we will see how we can "auto generate" types from js doc or other systme @mtrezza |
My understanding was that we already figured that out and start to use our auto-generated types since we gained some coverage. With our codebase as the source of truth, we can gradually improve the types. If types are missing, we can add them over time. But you are saying that there are existing types that are different from @types/parse? Could you give an example? |
I saw some signature issues yes (like on @types/parse, it undefined | string, and on parse it's just string for example. So this kind of conflicts will prevent user upgrading to parse v6 if they use @types/parse extensively (like cloud triggers definitions) May be here we just need to check @types/parse and add all missing triggers (i believe it's mostly types used on Cloud Functions/Cloud hooks/server stuff) |
@Moumouls I’ll do a PR to add the Cloud definitions to the server shortly. Also 95% of all definitions from @types/parse are included in the SDK. I always assumed that @types/parse would take precedence over the SDK if both were installed so there would be no conflicts |
You are right @dplewis on type precedence, but it turns weird when on deeper level than 1 like:
TS will resolve types or "v6" for package A ( TS WILL NOT use the types from @types/parse, if package "parse" with types exist at package A level) so TS try to merge some types but sometimes it could fail This kind of issue can mostly happen in monorepo projects. I recently sent a PR to patch @types/shelljs on DefinitelyTyped for a similar issue Migrating Cloud types to "parse" should allow then users to upgrade to v6 without losing Cloud Types, 🚀 |
Pull Request
Issue
Closes: #2012
Closes: #2044
Closes: #1368
Approach
/types
.