Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

feat(vite): replace global with globalThis - #4958

Merged
pi0 merged 1 commit into
mainfrom
fix/replace-global
May 13, 2022
Merged

feat(vite): replace global with globalThis#4958
pi0 merged 1 commit into
mainfrom
fix/replace-global

Conversation

@danielroe

@danielroedanielroe commented May 12, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

nuxt/nuxt#12830, closesnuxt/nuxt#13941

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This PR replaces references to global with globalThis for ESM compatibility, following the implementation in Nitro (e.g. nitrojs/nitro#155 - which makes it safer to do this).

This is currently a draft pending more testing (e.g. for AWS Amplify).

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroedanielroe added enhancement New feature or request vite labels May 12, 2022
@danielroe
danielroe requested a review from pi0May 12, 2022 15:44
@danielroedanielroe self-assigned this May 12, 2022
@netlify

netlifyBot commented May 12, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commitf817a4c
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/627d2b4bbf41f300080d8aff

@danielroedanielroe changed the title feat(vite): replace globalfeat(vite): replace global with globalThisMay 12, 2022
@pi0

pi0 commented May 13, 2022

Copy link
Copy Markdown
Member

pending more testing (e.g. for AWS Amplify).

Is it relevant to app build?

pi0
pi0 approved these changes May 13, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me we can try on edge :)

@danielroe
danielroe marked this pull request as ready for review May 13, 2022 10:40
@pi0
pi0 merged commit 17f9c54 into mainMay 13, 2022
@pi0
pi0 deleted the fix/replace-global branch May 13, 2022 10:49
danielroe added a commit that referenced this pull request May 13, 2022
@tobiasdieztobiasdiez mentioned this pull request May 13, 2022
18 tasks
@pi0pi0 mentioned this pull request Jun 10, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xenhancementNew feature or requestvite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setting global in vite.define breaks build

2 participants

@danielroe@pi0