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

Esbuild inject adds all node globals for non-node environment #6380

Closed
1 task done
TrySound opened this issue May 12, 2023 · 3 comments
Closed
1 task done

Esbuild inject adds all node globals for non-node environment #6380

TrySound opened this issue May 12, 2023 · 3 comments
Labels
bug:unverified needs-response We need a response from the original author about this issue/PR package:dev

Comments

@TrySound
Copy link
Contributor

What version of Remix are you using?

1.16

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Install esbuild, add esbuild-plugin-polyfill-node plugin. Import commonjs module from entry point. You'll see all polyfills to be included in resulting bundle.

This might be caused by this behavior. Basically esbuild cannot safely require es module from commonjs. So the entire idea to rely on esbuild to inject globals is not good since all remix code and dependencies is commonjs.

evanw/esbuild#1697 (comment)

Expected Behavior

Unnecessary polyfills should not be included.
Remix should have a way to disable all polyfills (disabling only globals is not supported in plugin).

Actual Behavior

Our worker bundle increased with 45kB of unused code.

@MichaelDeBoey
Copy link
Member

We just published version 1.17.1-pre.0 which includes #6562 (a possible fix). If you'd like to take it for a test run please try it out and let us know what you think!

@TrySound
Copy link
Contributor Author

TrySound commented Jun 8, 2023

Nice! Will try in a few days.

@MichaelDeBoey MichaelDeBoey added the needs-response We need a response from the original author about this issue/PR label Jun 16, 2023
@github-actions
Copy link
Contributor

This issue has been automatically closed because we haven't received a response from the original author 🙈. This automation helps keep the issue tracker clean from issues that are unactionable. Please reach out if you have more information for us! 🙂

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:unverified needs-response We need a response from the original author about this issue/PR package:dev
Projects
None yet
Development

No branches or pull requests

3 participants