Remove requirement for bundler custom config#489
Merged
Conversation
mcollina
requested changes
Sep 14, 2022
mcollina
left a comment
Member
There was a problem hiding this comment.
Thanks for this PR! This change would need to be applied to our build/ scripts, not inside lib.
Member
|
@ShogunPanda could you review? |
ShogunPanda
reviewed
Sep 15, 2022
Contributor
|
LGTM, if you could address #489 (comment) it would be great. |
ShogunPanda
approved these changes
Sep 19, 2022
mcollina
approved these changes
Sep 20, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The current code requires adding custom configs for bundlers to import Node.js polyfills. This PR removes that requirement.
Polyfills are required directly in the code. This can be done because the Node.js core modules have the same names (
buffer,events,process), and therefore, the code modules are used under Node.js. The polyfills are only imported for browser builds.This required switching from
buffer-es6tobuffer, andprocess-es6toprocess. Both packages are more up-to-date than the ones that have been replaced.Many lines have been touched, but the
libfolder changes are pretty small. Most changes are related to the test code. The same imports are required, but more files are affected.Besides the globals
bufferandprocess,eventsis added as a dependency. No code changes are required in that regard becauseeventsis not accessible as global, and therefore,requirecalls are already in the current code.