Skip to content

migrate to package:web (from dart:html) #981

Description

@mongbean

I suppose a followup question is: does the OverReact team plan to follow this migration guide to move away from dart:html use package:web (and dart:js_interop) instead? https://dart.dev/interop/js-interop/package-web

I'm not sure if there's an advantage to doing this as long as dart:html is supported, but I notice their first justification for migrating is compatibility with WASM, which might mean package:web is more efficient? (or ultimately will be more efficient?)

Originally posted by @dave-doty in #947

On the same project, we are now migrating to package:web. OverReact's functions ask for dart:html types. For example, the function
react_dom.render() in the following code snippet:

      react_dom.render(
        over_react_components.ErrorBoundary()(
          (ReduxProvider()..store = app.store)(
            set_side_menu_props(ConnectedSideMenu(), state)(),
          ),
        ),
        document.querySelector('#$SIDE_VIEW_MENU_ID')!,
      );

throws the following error:

The argument type 'Element (where Element is defined in C:\Users\__\AppData\Local\Pub\Cache\hosted\pub.dev\web-1.1.1\lib\src\dom\dom.dart)' can't be assigned to the parameter type 'Element (where Element is defined in C:\tools\dart-sdk\lib\html\dart2js\html_dart2js.dart)'. dart[argument_type_not_assignable](https://dart.dev/diagnostics/argument_type_not_assignable)
dom.dart(3047, 16): Element is defined in C:\Users\__\AppData\Local\Pub\Cache\hosted\pub.dev\web-1.1.1\lib\src\dom\dom.dart
html_dart2js.dart(13159, 7): Element is defined in C:\tools\dart-sdk\lib\html\dart2js\html_dart2js.dart

This is likely because OverReact has not migrated to package:web. Would love to hear if there are any plans to support package:web interop, or any recommendations for teams navigating this migration.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions