Skip to content

Conversation

@patak-dev
Copy link
Member

Fixes #12340

Description

This PR reverts #5312. As it was discussed in #12340, Vite shouldn't be replacing this in an ESM context.

@ArnaudBarre, #5312 was intended to avoid THIS_IS_UNDEFINED warnings in React apps, but we're already ignoring this warning here:

const warningIgnoreList = [`CIRCULAR_DEPENDENCY`, `THIS_IS_UNDEFINED`]

If there is a warning or error in source maps to be avoided though, we should fix it without the need for this rewrite.

As proposed by @bluwy, we can merge this in Vite 5 as it is a breaking change.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@bolt-new-by-stackblitz
Copy link

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

@patak-dev patak-dev added this to the 5.0 milestone Aug 14, 2023
@patak-dev patak-dev added the p3-significant High priority enhancement (priority) label Aug 14, 2023
@patak-dev
Copy link
Member Author

/ecosystem-ci run

@vite-ecosystem-ci
Copy link

vite-ecosystem-ci bot commented Aug 16, 2023

📝 Ran ecosystem CI: Open

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

@patak-dev
Copy link
Member Author

Same failures as in main, it will take some time to get everyone green again. We can merge this one

@patak-dev patak-dev merged commit 9b7b4ed into main Aug 16, 2023
@patak-dev patak-dev deleted the fix/avoid-rewriting-this branch August 16, 2023 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change p3-significant High priority enhancement (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Vite rewrites this to globalThis in library ESM context

4 participants