[Draft] Noahdarveau/global polyfill #2707
Draft
+36
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Lately, we have had a number of issues popping up with vite users saying that
global
is undefined. This is due to the fact that vite the vite environment does not define theglobal
object by default. This is a commonly known issue and a common solution is for vite app developers to defineglobal
in their applications or vite configurations. With the string of issues that have been coming in, we've been offering solutions that work for a large majority of people, though we are commonly getting new users chiming in that their slightly unique setups are still having issues. While unncessary on our part, I'm proposing adding aglobal
polyfill to the package as I believe it will be a more robust solution to a wider range of vite users. I can't think of any immediate issues that would come to mind with the inclusion of aglobal
polyfill, though with the messy nature of the javascript ecosystem, it is hard to be 100% certain it will not cause any new issues to arise for other library consumers.