Skip to content

Commit

Permalink
[web_compilers] Add support for js_interop_unsafe (#3613)
Browse files Browse the repository at this point in the history
Also bump min SDK
Also prepare for release
  • Loading branch information
kevmoo committed Nov 17, 2023
1 parent 2550caf commit 7f5b103
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 27 deletions.
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.

0 comments on commit 7f5b103

Please sign in to comment.