Re: [w3c/webcomponents] CSS Modules (#759)

With my user hat on, I think option 3 is preferable because it maps to the module loader behavior better.

> This has the advantage that if a developer includes a stylesheet multiple times by mistake or because of shared CSS dependencies, there will be performance and memory gains in sharing it. On the other hand, this is a divergence from the existing behavior where multiple @imports of the same .css file each come with their own CSSStyleSheet.

This is analogous to JS Modules as well. `import` has the advantage that when a module is imported multiple times there's only one module instance. JS Modules also have a divergence from scripts, where multiple script tags (which happens easier than one might think with dynamic loaders) load a script multiple times.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/759#issuecomment-490573808

Received on Wednesday, 8 May 2019 17:19:37 UTC