Skip to content

[web_compilers] Add support for js_interop_unsafe #3613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions build_web_compilers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 4.0.7

- Support `dart:js_interop_unsafe`.
- Require Dart 3.1 or greater.

## 4.0.6

- Allow version 3.3.x of the Dart SDK.
Expand Down
1 change: 1 addition & 0 deletions build_web_compilers/lib/src/platforms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const _libraries = [
'indexed_db',
'js',
'js_interop',
'js_interop_unsafe',
'js_util',
'math',
'svg',
Expand Down
18 changes: 6 additions & 12 deletions build_web_compilers/lib/src/web_entrypoint_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,12 @@ class WebEntrypointBuilder implements Builder {
deprecatedOptions: _deprecatedOptions);
var compilerOption =
options.config[_compilerOption] as String? ?? 'dartdevc';
WebCompiler compiler;
switch (compilerOption) {
case 'dartdevc':
compiler = WebCompiler.DartDevc;
break;
case 'dart2js':
compiler = WebCompiler.Dart2Js;
break;
default:
throw ArgumentError.value(compilerOption, _compilerOption,
'Only `dartdevc` and `dart2js` are supported.');
}
var compiler = switch (compilerOption) {
'dartdevc' => WebCompiler.DartDevc,
'dart2js' => WebCompiler.Dart2Js,
_ => throw ArgumentError.value(compilerOption, _compilerOption,
'Only `dartdevc` and `dart2js` are supported.')
};

if (options.config[_dart2jsArgsOption] is! List) {
var message = options.config[_dart2jsArgsOption] is String
Expand Down
4 changes: 2 additions & 2 deletions build_web_compilers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: build_web_compilers
version: 4.0.6
version: 4.0.7
description: Builder implementations wrapping the dart2js and DDC compilers.
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers

environment:
sdk: '>=3.0.0 <3.4.0'
sdk: '>=3.1.0 <3.4.0'

dependencies:
analyzer: '>=5.1.0 <7.0.0'
Expand Down
18 changes: 7 additions & 11 deletions tool/ci.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.