Re: [w3c/webcomponents] HTML, CSS, and JSON modules shouldn't solely rely on MIME type to change parsing behavior (#839)

I think @justinfagnani's point here is interesting and I want to second it.  Even aside from security concerns, JSON imports seem like the wrong tool for consuming non-first-party JSON/CSS.  If the request 404's or if, say, the JSON has a parse error, the entire module graph will fail to instantiate/execute.  `fetch()` is the right tool in this scenario, with `import` being reserved for content that is directly controlled by the importer.  Otherwise all your module scripts could fail to run because of a missing `{` in third-party JSON...

-- 
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/839#issuecomment-532927677

Received on Thursday, 19 September 2019 01:32:12 UTC