[go: nahoru, domu]

Skip to content
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

Provide documentation on how to use web workers for Dart 2 #4749

Open
mnordine opened this issue Oct 1, 2018 · 8 comments
Open

Provide documentation on how to use web workers for Dart 2 #4749

mnordine opened this issue Oct 1, 2018 · 8 comments
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged t.cli-tools Relates to the dart command line tools

Comments

@mnordine
Copy link
mnordine commented Oct 1, 2018

Dart SDK Version 2
Windows, MacOS
Chrome

I decided to try out Dart 2, and one of the first things I wanted to look into is how to run workers on the web, since Isolate is no longer available for the web. Here is the documentation: https://api.dartlang.org/stable/2.0.0/dart-html/Worker-class.html

There is no indication whatsoever on how to proceed on such an important web feature, given the ever-increasing importance of concurrent computation on modern systems.

Some questions that immediately spring to mind:

  • JS Worker and Dart Worker take a script url
  • How does that work?
  • Do I pass in a Dart url?
  • If so, what does that Dart file look like?
  • Can I pass in a function instead of a script url?

In a more general sense, Dart documentation for web APIs is not a good experience. Are those docs simply generated from browser IDL? Those docs should contain API overview, working examples for each function where not immediately obvious, links to articles, etc...Almost every page I visit is just method and property names. There's no guidance for the programmer.

@kwalrath
Copy link
Contributor
kwalrath commented Oct 1, 2018

/cc @kevmoo @vsmenon

@rayk
Copy link
rayk commented Jan 19, 2019

Yet certainly needed... Just posted this on slack, have spent too much time on stuff that should be simple.

@rayk
Copy link
rayk commented Jan 24, 2019

A somewhat related issue, dart-lang/sdk#35730 concerning web workers. This area is ripe for some programmer guidance.

@mnordine
Copy link
Author

I see the same thing over and over in the wild, programmers with no guidance on how to use Web Workers (does it even work with Dart 2?) trying to come up with hacks, left to their own devices:
https://medium.com/@yuankuan/web-worker-and-dart-ef76eab562e6
https://medium.com/@yuankuan/web-worker-and-dart-2-5f38ba74575c

@kevmoo
Copy link
Member
kevmoo commented Jan 24, 2019

See dart-lang/sdk#35730 (comment) – @sigmundch is running on this!

@bergwerf
Copy link

Yeah I would also like some documentation/examples on this.

@srawlins
Copy link
Member

Throwing this over to web (@vsmenon ) to see what they think the solution is: better API docs on the Worker class? An article?

@mnordine
Copy link
Author

I think the kicker here is web workers don't work with DDC: dart-lang/sdk#36295

@atsansone atsansone transferred this issue from dart-lang/sdk Apr 11, 2023
@atsansone atsansone added p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. t.cli-tools Relates to the dart command line tools e2-days Can complete in < 5 days of normal, not dedicated, work st.triage.ltw Indicates Lead Tech Writer has triaged labels Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e2-days Can complete in < 5 days of normal, not dedicated, work p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. st.triage.ltw Indicates Lead Tech Writer has triaged t.cli-tools Relates to the dart command line tools
Projects
None yet
Development

No branches or pull requests

7 participants