Skip to content

Document --[no-]deprecated-js-interop guardrail and legacy web library deprecation for Dart 3.14 - #7586

Merged
MuthuGCodes merged 5 commits into
dart-lang:mainfrom
MuthuGCodes:ticket-570981112-issue-7559
Nov 5, 2026
Merged

MuthuGCodes merged 5 commits into
dart-lang:mainfrom
MuthuGCodes:ticket-570981112-issue-7559

Conversation

@MuthuGCodes

@MuthuGCodes MuthuGCodes commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Documents the --[no-]deprecated-js-interop compiler and web tooling flag introduced in Dart 3.14 (dart-lang/sdk#63919), the promotion of invalid_runtime_check_with_js_interop_types to package:lints/core.yaml in package:lints 7.0.0 (dart-lang/core#1001), and replaces legacy package:js examples in active guides:

  • src/content/interop/js-interop/past-js-interop.md:
    • Rewrites the legacy library mapping introduction in active voice.
    • Adds a ### Disallow deprecated JS interop libraries section covering --no-deprecated-js-interop across dart compile js (dart2js), dart compile js-dev (dartdevc), and webdev 4.1.0+ / build_web_compilers 4.9.0+ (global_options in build.yaml), the disallowed dart:* SDK web libraries and packages that import them (package:js), dart.library.* conditional import evaluation to false, the deduplicated shortest-path import tree output, CI pipeline recommendations, and invalid_runtime_check_with_js_interop_types in package:lints/core.yaml (7.0.0).
  • src/content/interop/js-interop/package-web.md:
    • Under ### Type tests, notes invalid_runtime_check_with_js_interop_types promotion to package:lints/core.yaml in package:lints 7.0.0, removes the stale (available from Dart 3.4 onward) parenthetical on isA, and fixes the broken [isA] API reference link (NullableObjectUtilExtension/isA.html).
    • Under ### Conditional imports, adds a :::version-note on passing --no-deprecated-js-interop and links to Disallow deprecated JS interop libraries.
  • src/content/interop/js-interop/js-types.md:
    • Under ## Compatibility, type checks, and casts, notes invalid_runtime_check_with_js_interop_types promotion to package:lints/core.yaml in package:lints 7.0.0 and fixes the broken [isA] API reference link (NullableObjectUtilExtension/isA.html).
  • src/_includes/tools/dart-compile-js-options.md & src/content/tools/webdev.md:
    • Documents --[no-]deprecated-js-interop under ###### Analysis options for dart compile js and adds a :::version-note above ### webdev serve for webdev 4.1.0+ / build_web_compilers 4.9.0+ (including global_options configuration in build.yaml).
  • src/content/libraries/dart-html.md:
    • Updates the top :::warning banner to note that you can't use dart:html in dart compile wasm builds or when compiling with --no-deprecated-js-interop, and links to /interop/js-interop/package-web.
  • src/content/effective-dart/style.md & src/content/tools/pub/packages.md:
    • Replaces import 'package:js/js.dart' as js; (and as JS;) in general examples with import 'package:web/web.dart' as web; (and as Web;).

Fixes #7559


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.
  • This PR doesn't contain automatically generated corrections or text (Grammarly, LLMs, and similar).
  • This PR follows the Google Developer Documentation Style Guidelines — for example, it doesn't use i.e. or e.g., and it avoids I and we (first person).
  • This PR uses semantic line breaks of 80 characters or fewer.

@dart-github-bot

dart-github-bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

@MuthuGCodes
MuthuGCodes force-pushed the ticket-570981112-issue-7559 branch 2 times, most recently from 1c04455 to bfb2f71 Compare October 30, 2026 19:09
@MuthuGCodes
MuthuGCodes force-pushed the ticket-570981112-issue-7559 branch from bfb2f71 to c8caec8 Compare November 2, 2026 11:54
@MuthuGCodes
MuthuGCodes marked this pull request as ready for review November 2, 2026 12:15

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Dart documentation to introduce the new --[no-]deprecated-js-interop compiler flag (available in Dart 3.14) and updates various examples to use package:web instead of legacy JS interop libraries. The review feedback recommends correcting the build.yaml configuration option from hyphenated to snake_case (deprecated_js_interop), improving technical accuracy regarding how legacy conditions evaluate to false, and refining the phrasing in dart-html.md for a more objective tone.

Comment thread src/content/tools/webdev.md Resolved
Comment thread src/content/libraries/dart-html.md Resolved

@kevmoo kevmoo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kevmoo

kevmoo commented Nov 2, 2026

Copy link
Copy Markdown
Member

https://pub.dev/packages/webdev/versions/4.1.0/changelog

pkg:webdev now has this flag, too!

Comment thread src/content/tools/webdev.md Resolved
@MuthuGCodes

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @kevmoo :)

@conooi conooi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a few optional style and wording nits inline.

Also, if you'd like to keep the sister page src/content/interop/js-interop/js-types.md in sync with the changes you made in package-web.md (here or in a follow-up PR), lines 224–225 and 287 of js-types.md still have:

  • [isA]: {{site.dart-api}}/dart-js_interop/JSAnyUtilityExtension/isA.html (instead of NullableObjectUtilExtension/isA.html)
  • enable the [invalid_runtime_check_with_js_interop_types][] lint rule. (without the new package:lints 7.0.0 / package:lints/core.yaml note)

Comment thread src/content/libraries/dart-html.md Resolved
Comment thread src/content/tools/webdev.md Resolved
@MuthuGCodes

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @conooi

I've applied your comments and updated the js-types.md file as well.

# Conflicts:
#	src/content/interop/js-interop/js-types.md
@MuthuGCodes
MuthuGCodes merged commit 203d844 into dart-lang:main Nov 5, 2026
17 checks passed
@MuthuGCodes
MuthuGCodes deleted the ticket-570981112-issue-7559 branch November 5, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[js-interop] Document --[no-]deprecated-js-interop guardrail and legacy web library deprecation for Dart 3.14

4 participants