devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB
https://snuggsi.com
MIT License
395 stars 17 forks source link

Content Negotiation: `Content-Type` is being set incorrectly #142

Closed snuggs closed 6 years ago

snuggs commented 6 years ago

Should be application/ecmascript preferably. application/javascript classically

The site should respond with Content-Type: text/html for browsers navigating to root. And Content-Type: application/javascript for <script src=...> tags which fetch using a Accept: application/javascript rule in the request as speced by the whatwg/dom.

I believe you picked up on this @brandondees

capture d ecran 2017-09-14 a 10 10 56

snuggs commented 6 years ago

capture d ecran 2017-09-14 a 10 10 56

icyc9 commented 6 years ago

Interesting conventions of addressing the type as application/ecmascript. Javascript is an extended implementation of the ECMAScript specification. Is there any reason you have configured the project to this convention? @snuggs

snuggs commented 6 years ago

@RobertChristopher Developer ergonomics. application/ecmascript .es immediately tells me it's precompiled. Javascript .js let's me know i probably didn't write that. It's been such an ease cognitively. Lots less resistance to the idea than I had last year. Many keep denying this but when I tell them to change the existing documentation it rarely gets changed. ;-) I'm just following a convention around the docs/specs. /cc @tmornini @kurtcagle @brandondees

capture d ecran 2017-10-21 a 21 19 32