Repository navigation
Improve discoverability of JS object literal constructors in interop docs - #7556
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Dart JS interop documentation by renaming sections for consistency, adding a new guide on creating JavaScript object literals, and restructuring the usage guide with clearer subheadings and updated explanations of the @JS() annotation. The review feedback correctly identifies several Dart code examples where optional parameters are declared as non-nullable, which violates sound null safety. It is recommended to apply the suggested changes to make these parameters nullable (e.g., String?, bool?, int?, and RequestOptions?) to prevent static analysis errors.
Collaborator
|
Visit the preview URL for this PR (updated for commit 7a05f91): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7523.
Summary
start.md):externalconstructor on an extension type and pass it directly to JS APIs (fetch()), with a cross-link to the usage reference.Get started with JavaScript interop) and corresponding links inindex.mdandtutorials.mdto use imperative mood per Google developer documentation style guidelines.usage.md):Constructors,Object literal constructors,Static members,Instance members, andOperators) toh3headings so each appears in the right-hand "On this page" navigation with a direct URL anchor (#object-literal-constructors).factory, and that@anonymous/@JS()annotations aren't required (replacing the obsolete pre-Dart 3.3.1 compiler note).@JS()is required versus optional, followed byRename interop members and typesandNamespace a librarysubheadings.