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

Configure ESBuild to rewrite global as globalThis #136

Merged
merged 3 commits into from
Jun 12, 2023
Merged

Conversation

rvanasa
Copy link
Contributor

@rvanasa rvanasa commented Jun 10, 2023

Resolves a potential issue with web workers described in rvanasa/vite-react-motoko#3.

@rvanasa rvanasa requested a review from matthewhammer June 10, 2023 20:29
@rvanasa rvanasa requested a review from a team as a code owner June 10, 2023 20:29
@rvanasa rvanasa enabled auto-merge June 10, 2023 20:29
@atengberg
Copy link

I apologize, I might have spoken too soon. While this did resolve the initial problem of creating web workers in the first place, two other related issues came up--I'll setup a clean project and provide more details (BigInt serialization became an issue, and a lack of process.env specifically in the webworker).

@rvanasa
Copy link
Contributor Author

rvanasa commented Jun 12, 2023

All good! This is still a reasonable improvement by itself. Regarding BigInt serialization, the code snippet in dfinity/agent-js#655 might work as a temporary solution.

Definitely let me know if you make headway with setting up web workers, and we will update the starter projects accordingly.

@rvanasa rvanasa merged commit 5f6c9bc into main Jun 12, 2023
@rvanasa rvanasa deleted the globalthis-esbuild branch June 12, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants