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

If this is about validating the input given by import, then could the import be augmented with function?

```javascript
import someJson from "./some.json" with JSON.Parse;
import someCssString from "./some.css" with String;

// Going further, one could define own parser:
function MyParser(str: String) {
  let sheet = new CSSStyleSheet();
  sheet.replaceSync(str);
  return sheet;
}
import someCssStylesheet from "./someother.css" with MyParser;
```

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

Received on Sunday, 14 June 2020 22:35:25 UTC