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

Expand TypeScript support #2012

Open
66 tasks done
mtrezza opened this issue Sep 1, 2023 · 16 comments · May be fixed by #2044
Open
66 tasks done

Expand TypeScript support #2012

mtrezza opened this issue Sep 1, 2023 · 16 comments · May be fixed by #2044
Labels
type:feature New feature or improvement of existing feature

Comments

@mtrezza
Copy link
Member

mtrezza commented Sep 1, 2023

New Feature / Enhancement Checklist

Current Limitation

TypeScript support has been added with #1950. The next step is to expand it to more files.

Feature / Enhancement Description

Contributing

  • Change file extension to .ts
  • Remove @flow from file if it exists
  • Add file to ./tsconfig.json
  • npm run build:types
  • Fix types
  • Add / enable tests in types/test.ts
  • npm run test:types
  • Compare types to @types/parse

Progress (1/62)

  • Analytics.js
  • AnonymousUtils.js
  • Cloud.js
  • CloudCode.js
  • CoreManager.js
  • CryptoController.js
  • EventEmitter.js
  • EventuallyQueue.js
  • FacebookUtils.js
  • IndexedDBStorageController.js
  • InstallationController.js
  • LiveQueryClient.js
  • LiveQuerySubscription.js
  • LocalDatastore.js
  • LocalDatastoreController.js
  • LocalDatastoreController.react-native.js
  • LocalDatastoreUtils.js
  • ObjectStateMutations.js
  • OfflineQuery.js
  • Parse.js
  • ParseACL.js
  • ParseCLP.js
  • ParseConfig.js
  • ParseError.js
  • ParseFile.js
  • ParseGeoPoint.js
  • ParseHooks.js
  • ParseInstallation.js
  • ParseLiveQuery.js
  • ParseObject.js
  • ParseOp.js
  • ParsePolygon.js
  • ParseQuery.js
  • ParseRelation.js
  • ParseRole.js
  • ParseSchema.js
  • ParseSession.ts
  • ParseUser.js
  • Push.js
  • RESTController.js
  • SingleInstanceStateController.js
  • Socket.weapp.js
  • Storage.js
  • StorageController.browser.js
  • StorageController.default.js
  • StorageController.react-native.js
  • StorageController.weapp.js
  • TaskQueue.js
  • UniqueInstanceStateController.js
  • Xhr.weapp.js
  • arrayContainsObject.js
  • canBeSerialized.js
  • decode.js
  • encode.js
  • equals.js
  • escape.js
  • isRevocableSession.js
  • parseDate.js
  • promiseUtils.js
  • unique.js
  • unsavedChildren.js
  • uuid.js
  • WebSocketController
@parse-github-assistant
Copy link

parse-github-assistant bot commented Sep 1, 2023

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Sep 1, 2023
@mtrezza mtrezza pinned this issue Sep 1, 2023
@mtrezza mtrezza mentioned this issue Sep 1, 2023
3 tasks
@dplewis
Copy link
Member

dplewis commented Sep 5, 2023

@mtrezza just realized I can’t edit the OP (original post). I would like to put my name down to claim some files in case @danielbm @sadortun or other developers want to work on them to prevent conflicts

@mtrezza
Copy link
Member Author

mtrezza commented Sep 5, 2023

I'd say just post a comment with the sub-list you're working on and I'll update the main list from time to time.

@mtrezza
Copy link
Member Author

mtrezza commented Sep 5, 2023

Alright, once the PRs are merged, I'll go ahead and cross the items off the list. Other than that, as always, a contributor is encouraged to read the thread to know whether someone is already working an the issue - or parts of it.

I also suggest to open a PR early while work is in progress, which allows others to have insight into the progress. To prevent blocking issues, as long as there is no PR (or the PR is stale) we would always welcome and suggest to others to start working on it if they asked.

@tomwilsond1
Copy link

quick question, is this npm package setup to allow using the typescript definitions defined in the parse.ts file? I'd like to remove @types/parse as it's outdated, but removing it causes typescript compile issues now.

Could not find a declaration file for module 'parse/node'. '.../node_modules/parse/node.js' implicitly has an 'any' type.

Try npm i --save-dev @types/parse if it exists or add a new declaration (.d.ts) file containing declare module 'parse/node';ts(7016)

Thanks for your help.

@theolundqvist

This comment was marked as off-topic.

@mtrezza

This comment was marked as off-topic.

@swittk
Copy link
Contributor

swittk commented Oct 29, 2023

@mtrezza I've been trying to tackle this here https://github.com/swittk/Parse-SDK-JS/tree/typescript
What do you think? If this seems OK I plan to finish more of it soon.

There are a few places where I'm not sure though,

  • ParseGeoPoint static current() is supposed to return current GeoPoint, but it seems like the return result is wrapped in a callback
  • ParseObject has a couple of places where this.constructor is used, and Typescript doesn't really like this pattern, so I had to cast any at those places.
  • CoreManager.ts has a bunch of managers which appear to have either been defined with vague return values or incorrect function names, I've since corrected a few of them, but it's still not finished. Will look at the tests and DefaultManager implementation of each one to implement the correct types.

@mtrezza
Copy link
Member Author

mtrezza commented Oct 29, 2023

@swittk could you please open a PR for review?

@swittk swittk linked a pull request Oct 30, 2023 that will close this issue
4 tasks
@mtrezza
Copy link
Member Author

mtrezza commented May 16, 2024

arrayContainsObject.js
canBeSerialized.js
decode.js
encode.js
equals.js
escape.js
isRevocableSession.js
parseDate.js
promiseUtils.js
unique.js
unsavedChildren.js
uuid

@mtrezza
Copy link
Member Author

mtrezza commented May 16, 2024

CoreManager
InstallationController
Parse.js
ParseGeoPoint
ParseInstallation
ParseObject
ParseSession

@mtrezza
Copy link
Member Author

mtrezza commented May 16, 2024

ObjectStateMutation
ParseFile
ParseHooks
ParseQuery
ParseRole
ParseUser
Push.js
TaskQueue

@mtrezza
Copy link
Member Author

mtrezza commented May 17, 2024

Cloud.js
LiveQueryClient
LocalDatastore
LocalDatastoreController.default
LocalDatastoreController.react-native
LocalDatastoreUtils
ParseCLP

@mtrezza
Copy link
Member Author

mtrezza commented May 18, 2024

FacebookUtils
ParseConfig
ParseOp
ParsePolygon
ParseSchema

@mtrezza
Copy link
Member Author

mtrezza commented May 19, 2024

Analytics
AnonymousUtils
CloudCode
CryptoController
EventEmitter
LocalDatastoreController
OfflineQuery
RESTController
Scoket.weapp.js
Storage
StorageController
StorageController.browser
StorageController.default
StorageController.react-native
StorageController.weapp
WebSocketController
Xhr.weapp

@dplewis
Copy link
Member

dplewis commented May 20, 2024

@danielbm @sadortun @swittk @tomwilsond1 @mtrezza

EventuallyQueue
IndexDBStorageController
LiveQuerySubscription
ParseACL
ParseError
ParseLiveQuery
ParseRelation
SingleInstanceStateController
UniqueInstanceStateController

All files have been converted to TypeScript. I'm not a TS developer and I don't have a TS project to test with. How do we proceed?

  • Publish to @types/parse on DefinitelyTyped
  • Add "types": "./types/index.d.ts" to package.json
  • Add stricter typing (we use any everywhere)
  • Update CONTRIBUTING.md with building types and linting
  • Add ./types to files in package.json?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants