Repository navigation
Document --[no-]deprecated-js-interop guardrail and legacy web library deprecation for Dart 3.14 - #7586
Conversation
|
Visit the preview URL for this PR (updated for commit 61ab2f3): |
1c04455 to
bfb2f71
Compare
…y deprecation for Dart 3.14
bfb2f71 to
c8caec8
Compare
There was a problem hiding this comment.
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.
|
|
|
Thanks for the review, @kevmoo :) |
conooi
left a comment
There was a problem hiding this comment.
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 ofNullableObjectUtilExtension/isA.html)enable the [invalid_runtime_check_with_js_interop_types][] lint rule.(without the newpackage:lints7.0.0 /package:lints/core.yamlnote)
|
Thanks for the review, @conooi I've applied your comments and updated the |
# Conflicts: # src/content/interop/js-interop/js-types.md

Documents the
--[no-]deprecated-js-interopcompiler and web tooling flag introduced in Dart 3.14 (dart-lang/sdk#63919), the promotion ofinvalid_runtime_check_with_js_interop_typestopackage:lints/core.yamlinpackage:lints7.0.0 (dart-lang/core#1001), and replaces legacypackage:jsexamples in active guides:src/content/interop/js-interop/past-js-interop.md:### Disallow deprecated JS interop librariessection covering--no-deprecated-js-interopacrossdart compile js(dart2js),dart compile js-dev(dartdevc), andwebdev4.1.0+ /build_web_compilers4.9.0+ (global_optionsinbuild.yaml), the disalloweddart:*SDK web libraries and packages that import them (package:js),dart.library.*conditional import evaluation tofalse, the deduplicated shortest-path import tree output, CI pipeline recommendations, andinvalid_runtime_check_with_js_interop_typesinpackage:lints/core.yaml(7.0.0).src/content/interop/js-interop/package-web.md:### Type tests, notesinvalid_runtime_check_with_js_interop_typespromotion topackage:lints/core.yamlinpackage:lints7.0.0, removes the stale(available from Dart 3.4 onward)parenthetical onisA, and fixes the broken[isA]API reference link (NullableObjectUtilExtension/isA.html).### Conditional imports, adds a:::version-noteon passing--no-deprecated-js-interopand links toDisallow deprecated JS interop libraries.src/content/interop/js-interop/js-types.md:## Compatibility, type checks, and casts, notesinvalid_runtime_check_with_js_interop_typespromotion topackage:lints/core.yamlinpackage:lints7.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:--[no-]deprecated-js-interopunder###### Analysis optionsfordart compile jsand adds a:::version-noteabove### webdev serveforwebdev4.1.0+ /build_web_compilers4.9.0+ (includingglobal_optionsconfiguration inbuild.yaml).src/content/libraries/dart-html.md::::warningbanner to note that you can't usedart:htmlindart compile wasmbuilds 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:import 'package:js/js.dart' as js;(andas JS;) in general examples withimport 'package:web/web.dart' as web;(andas Web;).Fixes #7559