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

Playing around with some simple test pages, I’ve observed that in Chrome, Edgeium, and Firefox, duplicate `@imports` do not seem to cause duplicate fetches in practice.  This is regardless of whether the `@imports` come from the same stylesheet import tree or from trees originating from separate `<link>` or `<style>` elements.  So I’m not sure that overhead from extra Fetches is much of a concern in practice.  The performance difference would seem to be limited to the creation of the duplicate `CSSStyleSheet` objects. 

I mainly used [this page](https://dandclark.github.io/snippets/duplicateCSSImports/test.html) to make these observations, in case anyone else wants to try it out.  It has imports leading to “2a.css” from a few different paths, but Fiddler only observes one fetch of the file per page load.

On the other hand the Polymer customer use case is interesting.  This may end up being something that we have to get into the hands of customers via a prototype to get some early feedback.  I’m still concerned that the introduction of one-way links in the CSSOM tree structure could lead to awkwardness but at this point I can’t back that up with anything concrete.

-- 
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-492317101

Received on Tuesday, 14 May 2019 16:46:11 UTC