Re: [css-houdini-drafts] import() setup is inefficient

Ah, hmm, I see. And yeah, that's an important intrinsic property, not 
just incidental. OK, so you need a module map per WorkletGlobalScope.

I think hooking the fetch algorithm makes some sense. I guess we'd add
 an additional hook in addition to "set up the request" / "process the
 response" steps, so step 7/8 of "fetch a single module script" 
becomes something like

> If custom fetch steps are provided, run them, given _request_. 
Return from this algorithm and when the custom fetch steps complete 
with response _response_, run the remaining steps. Otherwise, fetch 
_request_, and run the remaining steps as part of the fetch's process 
response for the response _response_.

Then you could maintain a request URL -> response cache on the Worklet
 object.

I'm open to alternatives though. Maybe if you describe your original 
plan involving splitting the algorithm in more detail, it would be 
better?

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

Received on Friday, 24 June 2016 20:07:47 UTC