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

feat: Lazy load Parse.CoreManager controllers to add support for swappable CryptoController, LocalDatastoreController, StorageController, WebSocketController, ParseLiveQuery #2100

Merged
merged 7 commits into from
Apr 14, 2024

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Apr 12, 2024

Pull Request

Issue

The Parse JS SDK has some of the javascript modules which are not available in all JS runtime (Ex. local storage, crypto,). If a modules doesn't exist in runtime you may run into errors. Allowing developers to further add their own controllers will allow for support for any future JS frameworks.

Closes: #1754
Closes: #1987
Closes: #1258
Closes: #2060
Closes: #1362

Approach

Controllers can now be lazy loaded before the SDK initializes.

  • Add tests against the react-native build. Since react-native modules don't exist in the node testing environment they will have to be replaced / mocked.
  • Support for swappable CryptoController, LocalDatastoreController, StorageController, WebSocketController, ParseLiveQuery
  • Update README.md

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

Thanks for opening this pull request!

@dplewis dplewis requested a review from a team April 12, 2024 23:22
Copy link

codecov bot commented Apr 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (72bc9ac) to head (b14942d).
Report is 6 commits behind head on alpha.

Additional details and impacted files
@@             Coverage Diff             @@
##            alpha     #2100      +/-   ##
===========================================
+ Coverage   99.98%   100.00%   +0.01%     
===========================================
  Files          61        64       +3     
  Lines        6185      6196      +11     
  Branches     1499      1501       +2     
===========================================
+ Hits         6184      6196      +12     
+ Misses          1         0       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dplewis
Copy link
Member Author

dplewis commented Apr 13, 2024

@mtrezza This is ready for review and merge

@mtrezza mtrezza changed the title feat: Lazy load Parse.CoreManager controllers feat: Lazy load Parse.CoreManager controllers to add support for swappable CryptoController, LocalDatastoreController, StorageController, WebSocketController, ParseLiveQuery Apr 14, 2024
@mtrezza mtrezza changed the title feat: Lazy load Parse.CoreManager controllers to add support for swappable CryptoController, LocalDatastoreController, StorageController, WebSocketController, ParseLiveQuery feat: Lazy load Parse.CoreManager controllers to add support for swappable CryptoController, LocalDatastoreController, StorageController, WebSocketController, ParseLiveQuery Apr 14, 2024
@mtrezza
Copy link
Member

mtrezza commented Apr 14, 2024

Does the PR title make sense?

@dplewis
Copy link
Member Author

dplewis commented Apr 14, 2024

@mtrezza Couldn't have written it better myself. Looks good!

@dplewis dplewis requested a review from mtrezza April 14, 2024 19:53
@mtrezza mtrezza merged commit fbd0ab1 into parse-community:alpha Apr 14, 2024
9 checks passed
parseplatformorg pushed a commit that referenced this pull request Apr 14, 2024
# [5.1.0-alpha.3](5.1.0-alpha.2...5.1.0-alpha.3) (2024-04-14)

### Features

* Lazy load `Parse.CoreManager` controllers to add support for swappable `CryptoController`, `LocalDatastoreController`, `StorageController`, `WebSocketController`, `ParseLiveQuery` ([#2100](#2100)) ([fbd0ab1](fbd0ab1))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Apr 14, 2024
@dplewis dplewis deleted the lazy-load-controllers branch April 15, 2024 14:20
parseplatformorg pushed a commit that referenced this pull request May 16, 2024
# [5.1.0-beta.1](5.0.0...5.1.0-beta.1) (2024-05-16)

### Bug Fixes

* `Parse.GeoPoint.current` returns `undefined` ([#2127](#2127)) ([3860535](3860535))
* Chrome browser console warning about unsafe header `access-control-expose-headers` when calling Cloud Function ([#2095](#2095)) ([7b73c03](7b73c03))
* Live Query not working on Expo React Native ([#2109](#2109)) ([7a89665](7a89665))
* Local datastore throws error when `Parse.Query.notEqualTo` is set to `null` ([#2102](#2102)) ([6afd32a](6afd32a))
* Multiple object updates of nested keys overwrite each other ([#1451](#1451)) ([fa4341a](fa4341a))
* Pending updates to nested field causes `ParseObject.toJSON()` to return incorrect object ([#1453](#1453)) ([23cc573](23cc573))
* Remove circular dependencies ([#2125](#2125)) ([b415165](b415165))

### Features

* Add password validation for user with unverified email via `Parse.User.verifyPassword` using master key and option `ignoreEmailVerification: true` ([#2076](#2076)) ([b0adf7e](b0adf7e))
* Add support for setting `Parse.ACL` from json ([#2097](#2097)) ([72bc9ac](72bc9ac))
* Allow setting custom queue for handling offline operations via `Parse.EventuallyQueue` ([#2106](#2106)) ([f92e4d4](f92e4d4))
* Improve installation object `Parse.Installation.currentInstallation` to support web push notifications ([#2119](#2119)) ([4fc62ce](4fc62ce))
* Lazy load `Parse.CoreManager` controllers to add support for swappable `CryptoController`, `LocalDatastoreController`, `StorageController`, `WebSocketController`, `ParseLiveQuery` ([#2100](#2100)) ([fbd0ab1](fbd0ab1))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label May 16, 2024
parseplatformorg pushed a commit that referenced this pull request May 16, 2024
# [5.1.0](5.0.0...5.1.0) (2024-05-16)

### Bug Fixes

* `Parse.GeoPoint.current` returns `undefined` ([#2127](#2127)) ([3860535](3860535))
* Chrome browser console warning about unsafe header `access-control-expose-headers` when calling Cloud Function ([#2095](#2095)) ([7b73c03](7b73c03))
* Live Query not working on Expo React Native ([#2109](#2109)) ([7a89665](7a89665))
* Local datastore throws error when `Parse.Query.notEqualTo` is set to `null` ([#2102](#2102)) ([6afd32a](6afd32a))
* Multiple object updates of nested keys overwrite each other ([#1451](#1451)) ([fa4341a](fa4341a))
* Pending updates to nested field causes `ParseObject.toJSON()` to return incorrect object ([#1453](#1453)) ([23cc573](23cc573))
* Remove circular dependencies ([#2125](#2125)) ([b415165](b415165))

### Features

* Add password validation for user with unverified email via `Parse.User.verifyPassword` using master key and option `ignoreEmailVerification: true` ([#2076](#2076)) ([b0adf7e](b0adf7e))
* Add support for setting `Parse.ACL` from json ([#2097](#2097)) ([72bc9ac](72bc9ac))
* Allow setting custom queue for handling offline operations via `Parse.EventuallyQueue` ([#2106](#2106)) ([f92e4d4](f92e4d4))
* Improve installation object `Parse.Installation.currentInstallation` to support web push notifications ([#2119](#2119)) ([4fc62ce](4fc62ce))
* Lazy load `Parse.CoreManager` controllers to add support for swappable `CryptoController`, `LocalDatastoreController`, `StorageController`, `WebSocketController`, `ParseLiveQuery` ([#2100](#2100)) ([fbd0ab1](fbd0ab1))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
3 participants