Closed snuggs closed 4 years ago
@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? Β―_(γ)_/Β―
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 withapplication/octetstream
for.mjs
and.es
. This is problematic and causes aContent-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 :shit: For example >>> http://unpkg.com/snuggsi/dist/snuggsi.min.es vs http://unpkg.com/snuggsi/dist/snuggsi.min.es.jsSame 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.goRelated
.mjs
to IETFtext/javascript
Media typeapplication/ecmascript
to respect.mjs
extensionapplication/ecmascript
.mjs
to mime types database for defaulttext/javascript
.mjs
,.es
.mjs
,.es
.mjs
to mime types database with rest of the following WHATWG approved Media Typesmime-types
https://github.com/jshttp/mime-types/blob/master/package.json#L17node-mime
https://github.com/broofa/node-mime/pull/193/commits/f60fbe2515084350058922d23b3d75db1b488111type-is
https://github.com/jshttp/type-is/blob/master/package.json#L13accepts
https://github.com/jshttp/accepts/blob/master/package.json#L12compressible
https://github.com/jshttp/compressible/blob/master/package.json#L19koa
https://github.com/koajs/koa/blob/master/package.json#L42express
(viatype-is
library) https://github.com/expressjs/express/blob/master/package.json#L57