parse-community / Parse-SDK-JS

The JavaScript SDK for Parse Platform
https://parseplatform.org
Apache License 2.0
1.32k stars 596 forks source link

refactor: Replace require with import statement #2143

Closed dplewis closed 3 months ago

dplewis commented 3 months ago

Pull Request

Issue

The compilers cannot optimize the imports and remove unused code.

See discussion https://github.com/parse-community/Parse-SDK-JS/issues/1399

Approach

The only files using require are as follows: CryptoController - Babel doesn't strip out unused imports EventEmitter - Babel doesn't strip out unused imports ParseFile - Can't use ES6 modules like https and http RESTController - xmlhttprequest node package can't be imported CoreManager - Can't get package version from package.json using import

Convert the following files to TS

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
parse-github-assistant[bot] commented 3 months ago

Thanks for opening this pull request!

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (b50790a) to head (145153c). Report is 49 commits behind head on alpha.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## alpha #2143 +/- ## ========================================== Coverage 100.00% 100.00% ========================================== Files 61 64 +3 Lines 6186 6360 +174 Branches 1499 1509 +10 ========================================== + Hits 6186 6360 +174 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

parseplatformorg commented 2 months ago

🎉 This change has been released in version 5.2.0-alpha.2

parseplatformorg commented 1 month ago

🎉 This change has been released in version 5.2.0-beta.1

parseplatformorg commented 1 month ago

🎉 This change has been released in version 5.2.0