Skip to content

Migrate flutter test --platform=chrome off require.js AMD modules #187797

Description

@nshahan

I recently discovered that running flutter test --platform=chrome is using DDC for compilation and isn't using the version of the compiler that is now default with flutter run and flutter drive.

The tests are still relying on require.js and use the AMD module format when running DDC. This needs to be migrated to use the library bundle format instead.

The compile step will output the correct format when BuildInfo.webEnableHotReload = true but the bootstrapping logic needs to be updated to use ddc_module_loader.js, load all of the JavaScript files on the page and run the app.

Some issues I've found so far:

  • host.dart.js from package:test is served and loaded on the page first but it has errors because it expects DOM elements to exist from the package:test version of index.html. (This looks like a preexisting issue that isn't related to the module system but leaves errors in the browser console and seems like a bad practice).
  • The existing bootstrap doesn't declare the files that are needed to be loaded as part of the bootstrap process but we need that in the new module system.

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listplatform-webWeb applications specificallyteam-webOwned by Web platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-webTriaged by Web platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions