-
Notifications
You must be signed in to change notification settings - Fork 43
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
Added support for WASM compilation #516
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick review, as I have experience with WASM interop from other projects.
(and this might also affect one of my changes to this plugin, hence the added interest)
Hi @navaronbracke Thank you for reviewing the PR .Appreciate you for taking the time to do so |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor follow-up comments, but this is looking good!
external String get name; | ||
extension type Auth0ClientInfo._(JSObject _) implements JSObject { | ||
external JSObject? get env; | ||
external String get name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an extra space here
auth0_flutter/lib/src/web/extensions/web_exception_extensions.dart
Outdated
Show resolved
Hide resolved
Hi @navaronbracke , Would you know what would be the best way to modify the test class
|
Extension type mocking for the new JS types requires some changes. See the docs at https://dart.dev/interop/js-interop/mock mockito 5.4.5 did add support for extension types, though, so you can als look into that. |
Hi @navaronbracke I have updated the PR and fixed the failing UTs
|
Since you updated the minimum Dart & Flutter versions in the pubspec, users that want to compile to JS or WASM, using WASM compatible API's are going to need to migrate to that minimum Flutter version. So I don't see why this would fail if you are running on Flutter 3.24 and trying to compile to JS. Both JS & WASM should work with the new API's. |
sdk: ">=2.17.0 <4.0.0" | ||
flutter: ">=3.0.0" | ||
sdk: ">=3.5.0 <4.0.0" | ||
flutter: ">=3.24.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need to call out this change in the release notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 3.24.0
the minimum Flutter version we can support?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for auth0_flutter/pubspec.yaml
.
|
||
if (additionalProps != null) { | ||
for (final element in additionalProps.entries) { | ||
setProperty(jsObject, element.key, element.value); | ||
jsObject.setProperty(element.key.toJS, element.value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we call element.value.toJS
here, instead of the the call site in the tests?
📋 Changes
This PR adds support for WASM compilation
📎 References
#463
🎯 Testing
This has been tested by running the example app with the following command
flutter run -d chrome --web-port 3000 --wasm