mime-types icon indicating copy to clipboard operation
mime-types copied to clipboard

application/javascript should be replaced with text/javascript

Open robdunbar opened this issue 2 years ago • 5 comments

I note that the application/javascript was deprecated two years ago now, and should be replaced by text/javascript.

For more info, see,

  • https://datatracker.ietf.org/doc/rfc9239/
  • https://stackoverflow.com/questions/21098865/text-javascript-vs-application-javascript
  • https://stackoverflow.com/questions/876561/when-serving-javascript-files-is-it-better-to-use-the-application-javascript-or

Happy to create a PR if this change would be accepted.

robdunbar avatar Jul 04 '23 00:07 robdunbar

Oops, looks like this belongs in the mime-db repo first and then update this repo to pull the mime-db with fix. Please close/delete this.

Apologies

robdunbar avatar Jul 04 '23 00:07 robdunbar

Remember to release the dependency update here as semver-major as this will break compatibility unless consumers carefully update their code. For example, when Node.js is used as a web server using this package, the mime type is exposed to middleware and outside clients and may be relied upon in all sorts security-sensitive ways.

Example: https://github.com/bitovi/testee/blob/v0.10.2/lib/host/coverage.js#L20-L32

Krinkle avatar Jul 12 '23 17:07 Krinkle

Remember to release the dependency update here as semver-major as this will break compatibility unless consumers carefully update their code

@Krinkle mime-db content updates go out as minor-version releases. CleanShot 2023-12-09 at 07 09 54@2x

(source)

broofa avatar Dec 09 '23 15:12 broofa

@broofa Exactly. That's why this higher level package pins the version of that lower level library, to ensure it won't accidentally update, as that constitutes a breaking and semver-major at this level.

Krinkle avatar Dec 09 '23 16:12 Krinkle

Yes, this pins so there are two decision points. The semver is tricky bc typically in both packages, the data is has not been considered in the semver, as the way in which data changes in fluid with standards and browsers and there can be a lot of changes. Usually only the javascript api of the module has been considered in whay type of semver bump it would be.

dougwilson avatar Dec 09 '23 16:12 dougwilson

https://github.com/jshttp/mime-types/pull/126

wesleytodd avatar Jul 12 '24 22:07 wesleytodd