Skip to content

Commit 657e55f

Browse files
authored
Add ability to force JS from query param instead of wasm. (#4241)
Add ability to force JS from query param instead of wasm.
1 parent 9f07c7e commit 657e55f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

build_web_compilers/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 4.3.0
2+
3+
- When both wasm and js builds are enabled you can now add force_js=true
4+
to the URL in your browser to load the js build.
5+
16
## 4.2.4
27

38
- Allow Dart SDK 3.10.x and 3.11 prerelease.

build_web_compilers/lib/src/web_entrypoint_builder.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,9 @@ function relativeURL(ref) {
393393
'[0, 97, 115, 109, 1, 0, 0, 0, 1, 5, 1, 95, 1, 120, 0]))';
394394

395395
loaderResult.writeln('''
396-
if ($supportCheck) {
396+
const searchParams = new URLSearchParams(window.location.search);
397+
const forceJS = searchParams.get('force_js');
398+
if (!forceJS && $supportCheck) {
397399
''');
398400
}
399401

build_web_compilers/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_web_compilers
2-
version: 4.2.4
2+
version: 4.3.0
33
description: Builder implementations wrapping the dart2js and DDC compilers.
44
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers
55
resolution: workspace

0 commit comments

Comments
 (0)