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

fix: update javascript mime type to text/javascript #15427

Merged
merged 3 commits into from
Jan 8, 2024

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Dec 26, 2023

Description

This PR updates sirv and mrmime, which updates the javascript mime type to text/javascript (from application/javascript). I figured to update it everywhere in our codebase too for consistency.

Note that the HTML spec recommends using text/javascript instead. application/javascript is deprecated.

Additionally mrmime v2: https://github.com/lukeed/mrmime/releases/tag/v2.0.0

Additional context

Needs to run ecosystem in case there's significant breakage to the changed mime type for js and mjs files.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Dec 26, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Comment on lines +122 to +125
"peerDependenciesMeta": {
"acorn": {
"optional": true
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this since Vitest v1 relies on acorn-walk and has this peer dep warning. The acorn dep in acorn-walk is only used for types.

Comment on lines -60 to -63
// mrmime and mime-db is not released yet: https://github.com/jshttp/mime-db/commit/c9242a9b7d4bb25d7a0c9244adec74aeef08d8a1
mrmime.mimes['aac'] = 'audio/aac'
// https://wiki.xiph.org/MIME_Types_and_File_Extensions#.opus_-_audio/ogg
mrmime.mimes['opus'] = 'audio/ogg'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already included in new mrmime version

Comment on lines 72 to 73
export default function(dir?: string, opts?: Options): RequestHandler; No newline at end of file
export default function(dir?: string, opts?: Options): RequestHandler;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file actually didn't have any change, except this new line, which latest pnpm patch seems to start adding.

@bluwy bluwy added the p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority) label Dec 26, 2023
@bluwy
Copy link
Member Author

bluwy commented Dec 26, 2023

/ecosystem-ci run

@bluwy bluwy added this to the 5.1 milestone Dec 26, 2023
@bluwy bluwy changed the title chore: update sirv and mrmime fix: update javascript mime type to text/javascript Dec 26, 2023
@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 5fce48c: Open

suite result latest scheduled
analogjs success success
astro success success
histoire success success
ladle success success
laravel failure failure
marko success success
nuxt failure success
nx success success
previewjs success success
qwik success success
rakkas success success
sveltekit success success
unocss success success
vike success success
vite-plugin-pwa success success
vite-plugin-react success success
vite-plugin-react-pages success success
vite-plugin-react-swc success success
vite-plugin-svelte failure success
vite-plugin-vue success success
vite-setup-catalogue success success
vitepress success success
vitest success success

Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other parts looks good to me 👍

packages/vite/src/node/plugins/dataUri.ts Outdated Show resolved Hide resolved
Co-authored-by: 翠 / green <green@sapphi.red>
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

@patak-dev patak-dev merged commit a621de8 into main Jan 8, 2024
10 checks passed
@patak-dev patak-dev deleted the update-sirv-and-mrmime branch January 8, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p3-downstream-blocker Blocking the downstream ecosystem to work properly (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sirv needs to be upgraded to 2.0.4 to fix javascript mimetype
3 participants