remix icon indicating copy to clipboard operation
remix copied to clipboard

fix(dev): exclude `node:`-prefixed built-ins from the browser build

Open pcattori opened this issue 2 years ago • 4 comments

Closes: #4544

  • [ ] Docs
  • [x] Tests

TODO

  • [ ] can we get rid of the fakeBuiltins check introduced in https://github.com/remix-run/remix/issues/190 ?

pcattori avatar Jan 23 '23 16:01 pcattori

⚠️ No Changeset found

Latest commit: 5b1437e94c8d34c48b82ee65de4a0f3cccc32aff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Jan 23 '23 16:01 changeset-bot[bot]

This is blocked on polyfills not handling for node: prefixes. Currently, without polyfills for node:-prefix the app will have console errors.

https://github.com/remorses/esbuild-plugins/pull/20

pcattori avatar Jan 23 '23 17:01 pcattori

@pcattori #5274 unblocks this PR again 🎉

MichaelDeBoey avatar Jan 26 '23 17:01 MichaelDeBoey

@MichaelDeBoey thanks for looking into it!

I thought about this some more and we shouldn't be using polyfills for Node in the browser in the first place. I have a branch locally that treeshakes out all Node built-ins (but keeps them if they are actually 3rd party libs like buffer that are installed in your project), but haven't had time to put that up yet due to HMR focus recently.

pcattori avatar Jan 26 '23 18:01 pcattori

Superceded by #5773

pcattori avatar Mar 22 '23 14:03 pcattori