Skip to content

Commit

Permalink
[web libraries] Deprecate Dart web libraries
Browse files Browse the repository at this point in the history
#59716

Deprecate dart:html, dart:svg, dart:indexed_db, dart:web_audio,
and dart:web_gl in favor of package:web and dart:js_interop.

dart:web_sql has already been deprecated and unable to be
imported.

CoreLibraryReviewExempt: JS-specific library, deprecation only.
Change-Id: I2799b474be660153318a60d5e801ecd8431b08a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401045
Reviewed-by: Sigmund Cherem <sigmund@google.com>
  • Loading branch information
srujzs committed Dec 20, 2024
1 parent 99f8798 commit f3b6370
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 0 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,40 @@ snapshot of these tools as package build/build_web_compiler depends on it. The
AOT snapshot can be used as follows to run DDC <dart-sdk>/bin/dartaotruntime
<dart-sdk>/bin/snapshots/dartdevc_aot.dart.snapshot <options>

### Libraries

#### `dart:html`

- `dart:html` is marked deprecated and will be removed in an upcoming release.
Users should migrate to using `dart:js_interop` and `package:web`. See
[#59716][].

#### `dart:indexed_db`

- `dart:indexed_db` is marked deprecated and will be removed in an upcoming
release. Users should migrate to using `dart:js_interop` and `package:web`.
See [#59716][].

#### `dart:svg`

- `dart:svg` is marked deprecated and will be removed in an upcoming release.
Users should migrate to using `dart:js_interop` and `package:web`. See
[#59716][].

#### `dart:web_audio`

- `dart:web_audio` is marked deprecated and will be removed in an upcoming
release. Users should migrate to using `dart:js_interop` and `package:web`.
See [#59716][].

#### `dart:web_gl`

- `dart:web_gl` is marked deprecated and will be removed in an upcoming release.
Users should migrate to using `dart:js_interop` and `package:web`. See
[#59716][].

[#59716]: https://github.com/dart-lang/sdk/issues/59716

## 3.6.0

### Language
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/html/dart2js/html_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
///
/// {@category Web (Legacy)}
/// {@canonicalFor dart:_internal.HttpStatus}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.html;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
/// documentation](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.indexed_db;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/svg/dart2js/svg_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/// [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.svg;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/web_audio/dart2js/web_audio_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// > our [migration guide](https://dart.dev/go/package-web).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.web_audio;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions sdk/lib/web_gl/dart2js/web_gl_dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// > our [migration guide](https://dart.dev/go/package-web).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.web_gl;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions tools/dom/templates/html/dart2js/html_dart2js.darttemplate
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
///
/// {@category Web (Legacy)}
/// {@canonicalFor dart:_internal.HttpStatus}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.html;

import 'dart:async';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
/// documentation](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.indexed_db;

import 'dart:async';
Expand Down
1 change: 1 addition & 0 deletions tools/dom/templates/html/dart2js/svg_dart2js.darttemplate
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/// [Scalable Vector Graphics Specification](http://www.w3.org/TR/SVG/).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.svg;

import 'dart:async';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// > our [migration guide](https://dart.dev/go/package-web).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.web_audio;

import 'dart:async';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
/// > our [migration guide](https://dart.dev/go/package-web).
///
/// {@category Web (Legacy)}
@Deprecated('Use package:web and dart:js_interop instead.')
library dart.dom.web_gl;

import 'dart:async';
Expand Down

0 comments on commit f3b6370

Please sign in to comment.