Re: [w3c/webcomponents] Make JavaScript Files a Valid Entry Point to a Web Page (#807)

@Lonniebiz Just for clarity, browsers are not aware of files or file extensions. It only deals with mime types. The reason why the browser shows the JavaScript source when you navigate to it is because your web server is responding with a `text/javascript` mime type. So what you're really doing is proposing a new mime type that triggers essentially `about:blank` plus executing a script. Many questions on how this would work. 

You could pretty easily configure your web server to respond with `text/html` and wrap your JavaScript in a `<script>`. You'd need no spec changes to do that.

I would advise against doing so, and am against this proposal, because this is not a good way to deliver web content. The browser can render HTML before it has completing downloading, which it cannot do with JavaScript. Adopting this proposal would be validating bad practices.

-- 
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/807#issuecomment-486277188

Received on Wednesday, 24 April 2019 14:56:12 UTC