From 0512babe766d2ddc55eb2188d89f18af348bb8a7 Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Mon, 16 Dec 2024 16:58:37 -0800 Subject: [PATCH] pkg/js: mark discontinued/deprecated Towards https://github.com/dart-lang/sdk/issues/59716 Change-Id: Iaea45a8fccf5c3e2fb52ef34420ddbcd5b92a13f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/401201 Reviewed-by: Srujan Gaddam Auto-Submit: Kevin Moore Reviewed-by: Kevin Moore Commit-Queue: Srujan Gaddam --- pkg/dev_compiler/web/stack_trace_mapper.dart | 1 + pkg/js/CHANGELOG.md | 4 ++++ pkg/js/README.md | 6 ++++-- pkg/js/lib/js.dart | 3 +++ pkg/js/lib/js_util.dart | 1 + pkg/js/pubspec.yaml | 7 +------ 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pkg/dev_compiler/web/stack_trace_mapper.dart b/pkg/dev_compiler/web/stack_trace_mapper.dart index ab3048b78d3..5c7f0e50dc2 100644 --- a/pkg/dev_compiler/web/stack_trace_mapper.dart +++ b/pkg/dev_compiler/web/stack_trace_mapper.dart @@ -21,6 +21,7 @@ @JS() library; +// ignore: deprecated_member_use import 'package:js/js.dart'; import 'package:path/path.dart' as p; import 'package:source_maps/source_maps.dart'; diff --git a/pkg/js/CHANGELOG.md b/pkg/js/CHANGELOG.md index 7dcfbe15cc9..384d9dadb5a 100644 --- a/pkg/js/CHANGELOG.md +++ b/pkg/js/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.7.2 + +- Mark libraries as `@Deprecated`. + ## 0.7.1 - README update to indicate that `dart:js_interop` should be preferred. diff --git a/pkg/js/README.md b/pkg/js/README.md index 7810585241b..d645444d07e 100644 --- a/pkg/js/README.md +++ b/pkg/js/README.md @@ -1,8 +1,10 @@ [![pub package](https://img.shields.io/pub/v/js.svg)](https://pub.dev/packages/js) [![package publisher](https://img.shields.io/pub/publisher/js.svg)](https://pub.dev/packages/js/publisher) -**Important:** Prefer using `dart:js_interop` instead of this package for JS -interop. See the [JS interop documentation] for more details. +> [!CAUTION] +> This package is discontinued. +> Prefer using `dart:js_interop` instead of this package for JS +> interop. See the [JS interop documentation] for more details. Use this package when you want to call JavaScript APIs from Dart code, or vice versa. diff --git a/pkg/js/lib/js.dart b/pkg/js/lib/js.dart index e25ce144632..268fcf3f340 100644 --- a/pkg/js/lib/js.dart +++ b/pkg/js/lib/js.dart @@ -2,6 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +@Deprecated('Use dart:js_interop instead') +library; + // ignore: EXPORT_INTERNAL_LIBRARY export 'dart:_js_annotations' show JS, anonymous, staticInterop, trustTypes, JSExport; diff --git a/pkg/js/lib/js_util.dart b/pkg/js/lib/js_util.dart index 3d18fa04cc6..32ea5c11ae9 100644 --- a/pkg/js/lib/js_util.dart +++ b/pkg/js/lib/js_util.dart @@ -3,6 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// Utilities for interoperating with JavaScript. +@Deprecated('Use dart:js_interop instead') library; export 'dart:js_util'; diff --git a/pkg/js/pubspec.yaml b/pkg/js/pubspec.yaml index dbdc600805f..aea29ffb49c 100644 --- a/pkg/js/pubspec.yaml +++ b/pkg/js/pubspec.yaml @@ -1,13 +1,8 @@ name: js -version: 0.7.1 +version: 0.7.2 description: Annotations to create static Dart interfaces for JavaScript APIs. repository: https://github.com/dart-lang/sdk/tree/main/pkg/js -# We export `dart:_js_annotations` in this library. -analyzer: - errors: - export_internal_library: ignore - topics: - interop