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

refactor(esbuild)!: remove esbuild 0.17 -> 0.18 compat #14804

Merged
merged 2 commits into from Oct 30, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Oct 30, 2023

Description

Removed esbuild 0.17 to 0.18 compat code we added in Vite 4. I only saw this comment that we should remove this in Vite 5 just now 😬

  1. experimentalDecorators needs to be enabled if used
  2. Removed special supported handling for useDefineForClassFields. I figured it's better to document what's happening and how they can fix it. I initially thought we could respect esbuild.compilerOptions.target and override esbuild.target if set, but I don't think it's worth breaking that now, nor a good default. This is also esbuild's behaviour.

I added some documentation to explain what's going on.

Additional context


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.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • 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).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bluwy bluwy added this to the 5.0 milestone Oct 30, 2023
@stackblitz
Copy link

stackblitz bot commented Oct 30, 2023

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

@@ -117,6 +117,31 @@ CLI shortcuts, like `r` to restart the dev server, now require an additional `En

This change prevents Vite from swallowing and controlling OS-specific shortcuts, allowing better compatibility when combining the Vite dev server with other processes, and avoids the [previous caveats](https://github.com/vitejs/vite/pull/14342).

### Update `experimentalDecorators` and `useDefineForClassFields` TypeScript behaviour

Vite 5 uses esbuild 0.18, which changes how `experimentalDecorators` and `useDefineForClassFields` are handled.
Copy link
Member

Choose a reason for hiding this comment

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

Vite 5 uses esbuild 0.19 (#14430). So I think we need to say it like "we removed the compat layer".

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yeah we should mention it's 0.19 now. I point out as 0.18 as the main compat layer was for 0.18. 0.19 was not much breaking I believe. I can update it before merging.

sapphi-red
sapphi-red previously approved these changes Oct 30, 2023
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.

The migration guide can be tweaked later so I think it's fine to merge it to test out the changes.

@patak-dev
Copy link
Member

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 5f6b754: Open

suite result latest scheduled
analogjs success success
astro success success
histoire success success
ladle success success
laravel failure failure
marko failure failure
nuxt failure failure
nx failure failure
previewjs failure failure
qwik success success
rakkas success success
sveltekit failure failure
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 failure success
vite-plugin-svelte success success
vite-plugin-vue success success
vite-setup-catalogue success success
vitepress success success
vitest failure failure

@patak-dev patak-dev enabled auto-merge (squash) October 30, 2023 16:55
@patak-dev patak-dev merged commit 7234021 into main Oct 30, 2023
10 checks passed
@patak-dev patak-dev deleted the esbuild-options-default branch October 30, 2023 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants