[web] deprecate dart:web_sql

The WebSql was dropped 5+ years ago and this library is unsupported.

This change adds the `@deprecated` annotation on the library and APIs in
dart:html that expose it (`window.openDatabase`). It also indicates to dartdoc
to skip it for the api.dart.dev site.

I run a `pub_crawl` process to verify that this is not in use. I checked 15K
packages, and only found 2 occurrances of an import to this library:
  * One in a package marked as discontinued (used for migrating constants back
  in Dart 2)
  * Another in an example mock test (generated by mockito for mocking dart:html)
Also no library uses `window.openDatabase` either.

We will send a breaking change announcement soon and plan to delete this in a
future Dart release (possibly 2.15).

Fixes https://github.com/dart-lang/sdk/issues/45687
Fixes https://github.com/dart-lang/sdk/issues/45688

Change-Id: I8cd2bfa0ce64892c3f108bd6e24b8a0a3ec7c6ed
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196461
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
This commit is contained in:
Sigmund Cherem 2021-04-23 19:04:42 +00:00 committed by commit-bot@chromium.org
parent a9159afa68
commit d52475c166
5 changed files with 17 additions and 0 deletions

View file

@ -14,6 +14,17 @@
daylight saving changes that are not precisely one hour.
(No change on the Web which uses the JavaScript `Date` object.)
#### `dart:web_sql`
* `dart:web_sql` is marked deprecated and will be removed in an upcoming
release. Also the API `window.openDatabase` in `dart:html` is deprecated as
well.
This API and library was exposing the WebSQL proposed standard. The standard
was abandoned more than 5 years ago and is not supported by most browsers.
The `dart:web_sql` library has been documented as unsupported and deprecated
for many years as well and but wasn't annotated properly until now.
### Dart VM
* **Breaking Change** [#45071][]: `Dart_NewWeakPersistentHandle`'s and

View file

@ -33660,6 +33660,7 @@ class Window extends EventTarget
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Creates('SqlDatabase')
@deprecated
SqlDatabase openDatabase(
String name, String version, String displayName, int estimatedSize,
[DatabaseCallback? creationCallback]) {

View file

@ -9,6 +9,7 @@
* The [dart:indexed_db] APIs is a recommended alternatives.
*
* {@category Web}
* {@nodoc}
*/
library dart.dom.web_sql;
@ -23,6 +24,7 @@ import 'dart:_interceptors' show Interceptor;
// https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation
// Auto-generated dart:audio library.
@deprecated
import 'dart:_js_helper'
show
applyExtension,

View file

@ -13,7 +13,9 @@
* The [dart:indexed_db] APIs is a recommended alternatives.
*
* {@category Web}
* {@nodoc}
*/
@deprecated
library dart.dom.web_sql;
import 'dart:async';

View file

@ -226,6 +226,7 @@ $!MEMBERS
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Creates('SqlDatabase')
@deprecated
SqlDatabase openDatabase(
String name, String version, String displayName, int estimatedSize,
[DatabaseCallback$NULLABLE creationCallback]) {