Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

application/javascript is deprecated #8

Closed
JoakimCh opened this issue Sep 7, 2023 · 3 comments
Closed

application/javascript is deprecated #8

JoakimCh opened this issue Sep 7, 2023 · 3 comments

Comments

@JoakimCh
Copy link

JoakimCh commented Sep 7, 2023

Per the IANA Media Types registry, RFC 9239, and the HTML specification, JavaScript content should always be served using the MIME type text/javascript. No other MIME types are considered valid for JavaScript, and using any MIME type other than text/javascript may result in scripts that do not load or run.

Source: MDN

What else does it use that is deprecated? I didn't check.

@broofa
Copy link

broofa commented Dec 9, 2023

Hey @lukeed , 'just stumbled across your project. It's always nice to see other folks working in the MIME space.

I ran into this same issue with mime. The problem is that mime-db doesn't currently include extensions for the text/javascript type. Or, rather, it does but that change hasn't been published yet. (Change was in May 2022, last release of mime-db was Feb 2022).

Maybe file an issue with the mime-db project to see if they'll push a new release for you.

FWIW, this issue prompted me to remove mime-db from mime's package.json#dependencies and, instead, have the build script pull directly from the mime-db source on GH.

On a related note, you may want to take a look at my mime-score module. It contains the logic mime uses to select which mime-type an extension should map to when when there are extension conflicts. I've got a PR to switch mime-types use this logic as well... if/when I find time to work on it.

@benmccann
Copy link

Yeah, mime-db looks correct:

https://github.com/jshttp/mime-db/blob/a76e5a824c228e2e58363c9404e42a54ee1d142f/src/iana-types.json#L9942

I think we probably just need a new release of mrmime?

@benmccann
Copy link

thank you Luke!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants