Skip to content

[worklets] import() method conflicts with new JavaScript feature #373

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

Closed
annevk opened this issue Apr 5, 2017 · 4 comments
Closed

[worklets] import() method conflicts with new JavaScript feature #373

annevk opened this issue Apr 5, 2017 · 4 comments

Comments

@annevk
Copy link
Member

annevk commented Apr 5, 2017

Do we still need https://drafts.css-houdini.org/worklets/#dom-worklet-import with https://github.com/tc39/proposal-dynamic-import?

cc @domenic

@bfgeek
Copy link
Contributor

bfgeek commented Apr 5, 2017

The import on the worklet allows the main thread to import scripts into other threads? So yes? It's analogous to workers.

e.g.

new Worker('foo.js');
CSS.paintWorklet.import('foo.js');

Inside the WorkletGlobalScope you'd use the dynamic import() function or just the regular import statement.

@bfgeek
Copy link
Contributor

bfgeek commented Apr 5, 2017

There was debate a while ago if worklet.import() should be renamed to loadModule instead...

@annevk
Copy link
Member Author

annevk commented Apr 5, 2017

Okay, I got confused about the setup. Having some inline examples would help. And yeah, maybe a more specific term would be good. Something like "distributeScript"? To make it more clear it ends up running multiple times against several globals.

@bfgeek
Copy link
Contributor

bfgeek commented Apr 5, 2017

Filed #374 and added an example section for what import actually does.

@bfgeek bfgeek closed this as completed Apr 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants