Skip to content

[webdev] Generate auto-switching combined build for dart2js and dart2wasm output #2296

@parlough

Description

@parlough

I'm not exactly sure at what layer this should be in, but webdev seems like an most appropriate place. Happy to hear what other's think! Perhaps it does make sense directly as a dart subcommand, not sure.

Building on dart-lang/sdk@0df58fc and eventually dart-lang/build#3621:

I think webdev should have a release mode that generates output with both dart2js (dart compile js) and dart2wasm (dart compile wasm). Then it should generate a JS script which chooses between them based on browser capabilities.

Developers can technically do this themselves, but I imagine it will be common enough that it's worth having some built-in functionality to do so.

Perhaps for a while, this can be a separate mode from the existing --release, but eventually I'd expect this to be the default.

\cc @kevmoo @jakemac53 For general thoughts, including about where this functionality could live.

Metadata

Metadata

Assignees

Labels

P2A bug or feature request we're likely to work onpackage:webdevtriagedtype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions