devpunks / snuggsi

snuggsi ツ - Easy Custom Elements in ~1kB

Home Page:https://snuggsi.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GET Accept: text/javascript

snuggs opened this issue Β· comments

PRs & Issues

(New) Specification

In defense of .js

@brandondees we'll need to update Koa, (at minimum), Rails, Sinatra, Express, for the new .mjs and existing .es extensions. Many servers respond with application/octetstream for .mjs and .es. This is problematic and causes a Content-Disposition due to the spec stating to NEVER run that media type (for obvious security reasons). Luckily we can just update the core libs for respective platforms and cure most of the (sane) frameworks in the meantime. Anything that prevents the downloading of these files.

This prevents people from linking to unpkg. As a band aid we create a .es.js file πŸ’©
For example >>> http://unpkg.com/snuggsi/dist/snuggsi.min.es vs http://unpkg.com/snuggsi/dist/snuggsi.min.es.js

Same holds true for .mjs files. Therefore a TON of servers are "broken" with this feature/bug (including ourselves).

I'm on it this weekend. This list and Resource.assets will be just about it for this PR. https://snuggsi.es can be active then and unpkg.com will work properly for people migrating to JS modules which will be very shortly here. Lastly, web/WHATWG/W3C/IETF/HTML/Fetch/DOM specs are fairly in order as media types have been an ancient πŸ’© show for about a decade now.

@tmornini may need your guidance on the protocol to update golang source code. text/x-javascript is on the MUST NOT USE list as far as the platform is concerned. What should we do to notify them? https://golang.org/src/mime/type.go

Related

@brandondees @tmornini @btakita @kurtcagle we have a proposed spec from ietf now and gives the green light to update these packages.

P.S. Breaking changes to servers as 90% of them respond incorrectly with application/javascript....The conclusion was made that there is either text or binary (application) code. Nothing else.

There WILL be blood. Quite possibly a Pyrrhic Victory

But what do you do when the web has been mis-speced forever? Β―_(ツ)_/Β―