Skip to content

Commit 505f353

Browse files
committed
[dart:js/js_util] Deprecate dart:js and dart:js_util
#59716 Deprecate these in favor of dart:js_interop. Modifies code samples to account for the deprecated imports. CoreLibraryReviewExempt: JS-specific library, deprecation only. Change-Id: I9f01cd203212aaeca08aa1c5a4000b67f54756b9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401046 Reviewed-by: Sigmund Cherem <[email protected]> Reviewed-by: Kevin Moore <[email protected]>
1 parent f3b6370 commit 505f353

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,16 @@ AOT snapshot can be used as follows to run DDC <dart-sdk>/bin/dartaotruntime
241241
Users should migrate to using `dart:js_interop` and `package:web`. See
242242
[#59716][].
243243

244+
#### `dart:js`
245+
246+
- `dart:js` is marked deprecated and will be removed in an upcoming release.
247+
Users should migrate to using `dart:js_interop`. See [#59716][].
248+
249+
#### `dart:js_util`
250+
251+
- `dart:js_util` is marked deprecated and will be removed in an upcoming
252+
release. Users should migrate to using `dart:js_interop`. See [#59716][].
253+
244254
[#59716]: https://github.com/dart-lang/sdk/issues/59716
245255

246256
## 3.6.0

sdk/lib/js/js.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
/// var jsArray = JsObject.jsify([1, 2, 3]);
8585
///
8686
/// {@category Web (Legacy)}
87+
@Deprecated('Use dart:js_interop instead.')
8788
library dart.js;
8889

8990
import 'dart:collection' show ListMixin;

sdk/lib/js_util/js_util.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
/// with `@JS()` annotations.
1515
///
1616
/// {@category Web (Legacy)}
17+
@Deprecated('Use dart:js_interop instead.')
1718
library dart.js_util;
1819

1920
// Examples can assume:
@@ -148,7 +149,16 @@ class NullRejectionException implements Exception {
148149

149150
/// Converts a JavaScript Promise to a Dart [Future].
150151
///
151-
/// ```dart template:top
152+
/// ```dart
153+
/// // ignore: deprecated_member_use_from_same_package
154+
/// import 'dart:js_util';
155+
///
156+
/// // ignore: deprecated_member_use_from_same_package
157+
/// import 'package:js/js.dart';
158+
///
159+
/// @JS()
160+
/// class Promise<T> {}
161+
///
152162
/// @JS()
153163
/// external Promise<num> get threePromise; // Resolves to 3
154164
///

0 commit comments

Comments
 (0)