dart-lang / build

A build system for Dart written in Dart
https://pub.dev/packages/build
BSD 3-Clause "New" or "Revised" License
791 stars 211 forks source link

Fix build web compilers wasm issue #3748

Closed simolus3 closed 2 months ago

simolus3 commented 2 months ago

This fixes three issues from the dart2js+dart2wasm PR:

  1. Since YamlMap is not a Map<String, dynamic>, .cast() doesn't work. Tests didn't catch this because we weren't reading from yaml.
  2. The loader script had multiple issues - it referenced an undefined function and assumes that WebAssembly is defined. Tests didn't catch this because this was only exercised in the fallback path, and we were only testing on Chrome. I've fixed the loader script and added a custom browser platform that disables WebAssembly in Chrome to make sure the fallback path is working.
  3. We've stopped emitting dart2js archives because we expected them to look like main.dart.js*. When using a custom build extension for dart2js, they are actually named main.dart2js.js* - I've fixed that, this is tested by the deferred imports hello world test in _test.

Sorry for the mess!

Closes https://github.com/dart-lang/build/issues/3746. Closes https://github.com/dart-lang/build/issues/3747.

github-actions[bot] commented 2 months ago

PR Health

Package publish validation :heavy_check_mark: | Package | Version | Status | | :--- | ---: | :--- | | package:build | 2.4.2-wip | WIP (no publish necessary) | | package:build_config | 1.1.2-wip | WIP (no publish necessary) | | package:build_daemon | 4.0.3-wip | WIP (no publish necessary) | | package:build_modules | 5.0.10-wip | WIP (no publish necessary) | | package:build_resolvers | 2.4.3-wip | WIP (no publish necessary) | | package:build_runner | 2.4.13-wip | WIP (no publish necessary) | | package:build_runner_core | 7.3.3-wip | WIP (no publish necessary) | | package:build_test | 2.2.3-wip | WIP (no publish necessary) | | package:build_web_compilers | 4.1.0-wip | WIP (no publish necessary) | | package:scratch_space | 1.0.3-wip | WIP (no publish necessary) | Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.
kevmoo commented 2 months ago

This seems to work everywhere: https://j832-com--wasm-check-wzo4ep4u.web.app/