-
Notifications
You must be signed in to change notification settings - Fork 718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
☂️ JS/web static interop overview, docs, and tutorials #5438
Comments
@parlough Maybe another point that could be discussed: What with definitions of Web IDL types that have a specific format in the Dart representation? Context: In dart-lang/web#151 there was a discussion about how end-users should treat |
* reduce the number of DOM APIs we generate code for * regenerate the dom libraries * review comments * update comments
Thanks for the suggestion @navaronbracke. I don't have the full context here, so I'll defer to those working on the documentation for these features :) @srujzs When you get a chance could you comment on if this fits into your current thinking or docs plan? |
Are you referring to In this case, though, I think the definition we get to begin with is already partially conflating the video specific type: https://github.com/w3c/webref/blob/75ad858d0877099792ad531040d3725221fa8d76/tr/idl/mediacapture-streams.idl#L106. For example, |
Exactly that yes |
Also, in the WIP PR docs, we still mention If people want to use the "unsafe" API's, they should use I found the existence of |
The linked PR still has a bunch of stale changes from in-progress work from a year ago, including that index page. It will be updated and cleaned up before landing, but until its out of a draft state, I would be cautious with taking much from the PR 😄
My understanding is yes, but prefer using |
Yup, Parker is right here. |
Fixes #5438 --------- Co-authored-by: Srujan Gaddam <srujzs@google.com> Co-authored-by: Parker Lougheed <parlough@gmail.com> Co-authored-by: sigmundch <sigmund@google.com>
Fixes dart-lang#5438 --------- Co-authored-by: Srujan Gaddam <srujzs@google.com> Co-authored-by: Parker Lougheed <parlough@gmail.com> Co-authored-by: sigmundch <sigmund@google.com>
This issue outlines the doc plan for new Dart web interop features in 3.3. The outline that follows is authored by Marya, not Parker :)
JS interop
Static JS interop is a new design for consuming JavaScript APIs in Dart that uses a combination of extension types,
external
members, annotations (like@JS
), JS types, and conversions.Evaluation
This will be added as a new drop-down "JS interop" category under "Interoperability" in the sidenav, and be found at
/interop/js/...
.Overview
@JS
renamingis
andas
don’t work as expecteddart2wasm
)dart:
andpackage:
librariesSyntax / usage
@JS
annotations OR top-level functions in the global contextexternal
toDart
andtoJS
JS Types page
JSAny
null
vsundefined
, and null-checks on an external memberTutorials
package:web
section belowPast JS Interop page
FAQ/Troubleshooting page
Resources
package:web
package:web
is the web interop replacement fordart:html
built around static JS interop.Evaluation
This will likely be a page under "JS interop" in the side nav, under "Interoperability". Currently unsure whether the title should be "Web interop" , "package:web", a tutorial-like title e.g. "How to interop with the DOM/browser", or something else.
Since it's built with JS interop, much of the details of its use will be covered in JS interop pages like syntax, conversions, types, etc.
Intro
package:web
/ Why you would use itdart:html
(benefits/improvements)dart:html
efficientlydart:html
did not fit the continuously changing reality of the webdart:html
How to use it / Syntax
Migrating from
dart:html
topackage:web
import: dart:html
toimport: package:web
dart:html
api docs to see original declaration's@Native
annotationdart fix
is
, use interop instead likeinstanceOf
dart:html
topackage:web
dart:html
@Native
annotationsUpdate go link to point to
package:web
migration instructions for library docspackage:web
#5460)Resources
package:web
repodart:html
>package:web
renames (and possibledart fix
: investigatedart fix
renames for this package web#139dart:html
treatmentOnce some of the above docs are place, documentation about the old mechanisms, especially
dart:html
need to be directed to new functionality with deprecation notices or be removed entirely.dart:html
library tour content should be deprecated and set for removaldart:html
for non-web goals should move away from itdart:html
.Mentions of
dart:html
on api.dart.dev are also going to be downgraded. The sidenav will be adjusted to include / emphasize package web: dart-lang/dartdoc#3617. ToDo for @MaryaBelanger:dart:html
on api.dart.dev home page: https://api.dart.dev/stable/index.htmlThe text was updated successfully, but these errors were encountered: