- From: Dan Clark <notifications@github.com>
- Date: Wed, 04 Dec 2019 14:33:28 -0800
- To: w3ctag/design-reviews <design-reviews@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3ctag/design-reviews/issues/405/561870350@github.com>
Re: @dbaron I agree that 2a is worth considering. I am a little wary of not failing the module graph if any resource is not found, as that somewhat goes against the expectation that if a module graph is executing, all statically imported resources are present. On the other hand the basic principle of option 2 is that we're not really changing the semantics of `@import` so perhaps just benignly dropping the missing `@import` to be consistent with the current CSS behavior makes sense. I'll update the explainer to list this possibility as well. I'm not sure that making the stylesheet OM read-only solves a lot of the issues with option 3; we still have the problem where a stylesheet can have multiple parents if `@import`ed from multiple sheets, and we would still need to decide the right way to reflect that in a read-only OM. Furthermore, the main motivating scenario for option 3 is that dynamic changes to a particular stylesheet can be reflected in multiple importers. If the OM is read-only this capability would be limited. I'll add a comment in the explainer about the behavior when `import` fails (the module graph doesn't execute; same as with the failed `import` of a JavaScript module). Your concerns about relying on file extension or MIME type are widely shared at this point. Issue thread [here](https://github.com/w3c/webcomponents/issues/839). We're proposing @littledan and @xtuc's https://github.com/littledan/proposal-module-attributes/ for State 1 to TC39 this week. The ideal outcome is that this will enable us to use the `import` syntax to specify the module type, e.g. ```JavaScript import styleSheet from "./foo.css" with type: "css"; ``` Re @plinss: > I presume this also works with dynamic imports? In that case is the module returned simply the CSSStyleSheet? Yes, it will work with dynamic imports. The returned Promise resolves with the module namespace object, where the `default` property is the CSSStyleSheet. More discussion on this [here](https://github.com/w3c/webcomponents/issues/835). That thread is about JSON modules but the ideas are the same. Justin's comment [here](https://github.com/w3c/webcomponents/issues/835#issuecomment-529732659) notes that this keeps open the future possibility of things like exporting named CSS selector references. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3ctag/design-reviews/issues/405#issuecomment-561870350
Received on Wednesday, 4 December 2019 22:33:29 UTC