Re: [whatwg/fetch] What is the right destination type for non-JS modules? (#967)

I suspect the right answer here is not to change destination, precisely because it is developer-facing in `<link rel=modulepreload>` (and also service worker interception).

Part of [the reason](https://github.com/whatwg/fetch/issues/486#issuecomment-282044172) we did `<link rel=modulepreload>` instead of reusing `rel=preload` was so that we wouldn't need to double the number of `as=` values: i.e., the current design allows `rel=modulepreload as=script|worker|sharedworker|serviceworker` instead of `rel=preload as=modulescript|moduleworker|modulesharedworker|moduleserviceworker`. Adding the script's category as a a new combinatorial axis to the destination seems suboptimal, although not _as_ bad since we probably won't have JSON workers/sharedworkers/serviceworkers. (Maybe we would have wasm ones though?)

In other words, we have multiple factors that go into script loading:

* Type: classic vs. module
* Destination: script vs. worker vs. shared worker vs. service worker
* Category (?): JS vs. JSON vs. wasm vs. HTML

We decided not to merge type into destination, and I suggest we do the same for category. Destination is a good independent axis, as-is.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/967#issuecomment-555086643

Received on Monday, 18 November 2019 16:11:58 UTC