-
Notifications
You must be signed in to change notification settings - Fork 362
Migrate analytics code to dart:js_interop
#7718
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
|
Looks like this migration is not so simple: |
|
Pushed up some new changes, but the build still fails. Maybe this is closer though? |
|
The error is basically indicating that you can't use classes (unless you're using In most of these cases, it's as simple as refactoring the declaration and the rest should work e.g. @JS()
@anonymous
class GtagExceptionDevTools extends GtagException {to extension type GtagExceptionDevTools._(JSObject _) implements GtagException, JSObject {Since you mostly use primitive types e.g. dynamic custom_map, Object? custom_map,and its associated getters: external Object get custom_map;external Object? get custom_map;You can't use As an aside, note that some of these factories have default args that are ignored (and you should see a warning). They're just silently ignored. Lastly, these APIs are now sound with the new interop. If they weren't typed correctly before (which I doubt, considering these are mostly all primitives), you may see errors now. |
Fixes #6606.
@srujzs are there any differences under the hood or is this migration as simple as switching the imports?