Re: [css-houdini-drafts] [worklets] (bikeshedding time!) import() name is potentially confusing...

(Before I start: I could settle for `spawn()`, but I don’t think `import()` is confusing – on the contrary, it’s functionality is pretty similar, warranting a similar name.)

Okay, here goes: This has been buggy me for a while but I never said anything because I thought this was a done deal, but I guess now is my chance 😅 

I always found it weird that theres some sort of magic global for each worklet that loads code. That code than proceeds to create an instance of something that – from there on in – would usually be referred to as “my XYZ Worklet”.

Taking some inspiration from workers, I’d find something like `new CSS.PaintWorklet('myfile.js')` much more intuitive. You‘d have a proper reference to hold on to for message passing and deregistering etc. Wondering what others think, if that’s semantically coherent and whether I just lost all credibility.



-- 
GitHub Notification of comment by surma
Please view or discuss this issue at https://github.com/w3c/css-houdini-drafts/issues/374#issuecomment-294146624 using your GitHub account

Received on Friday, 14 April 2017 12:36:46 UTC