Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

feat(vite): replace global with globalThis #4958

Merged
merged 1 commit into from
May 13, 2022
Merged

feat(vite): replace global with globalThis #4958

merged 1 commit into from
May 13, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented May 12, 2022

πŸ”— Linked issue

nuxt/nuxt#12830, closes nuxt/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. unjs/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.

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

netlify bot commented May 12, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit f817a4c
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/627d2b4bbf41f300080d8aff

@danielroe danielroe changed the title feat(vite): replace global feat(vite): replace global with globalThis May 12, 2022
@pi0
Copy link
Member

pi0 commented May 13, 2022

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

Is it relevant to app build?

Copy link
Member

@pi0 pi0 left a comment

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 main May 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
@pi0 pi0 mentioned this pull request Jun 10, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x enhancement New feature or request vite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setting global in vite.define breaks build
2 participants