deps: replace is-core-module with node builtin#224
Merged
Conversation
65041ce to
e2b4ab8
Compare
|
This is a great change to switch to native code available in the Node. |
wraithgar
reviewed
Jun 25, 2024
Member
Yep, this comes after we've validated that This looks good. If you don't mind can you change your require to use the |
Co-authored-by: Gar <wraithgar@github.com>
wraithgar
approved these changes
Jun 25, 2024
Merged
wraithgar
pushed a commit
that referenced
this pull request
Jun 25, 2024
🤖 I have created a release *beep* *boop* --- ## [6.0.2](v6.0.1...v6.0.2) (2024-06-25) ### Dependencies * [`43bab20`](43bab20) [#224](#224) replace `is-core-module` with node builtin (#224) (@SuperchupuDev, @wraithgar) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.
This PR replaces usage of
is-core-modulewith node's built-inmodule.builtinModules, which was added in node 9.3.0, 8.10.0, and 6.13.0. My plan was to usemodule.isBuiltinbut that would be a breaking change as it got added in node 16.17.0 and 18.6.0. Maybe once older node versions get dropped :P. This makesnormalize-package-datause 3 less dependencies, bringing down the total count to 8. The only difference this could have is thatbuiltinModulesdo not includenode:builtins, but it doesn't affect this library as names prefixed bynode:already throw as they are not valid names.Packages such as
is-core-module's dependencies are only there for support with ancient node versions (>=0.4) and as such have many polyfills, including one that literally emulates hasOwnProperty, and overall end up cluttering the whole javascript ecosystem. Since this package includes an engines field of^16.14.0 || >=18.0.0, there's no real reason in using it over a built-in.is-core-modulein particular does have its own use case (checking the list of built-ins of a certain node version other than the current one), but its use in this library can be replicated bymodule.builtinModulesReferences
https://nodejs.org/api/module.html#modulebuiltinmodules