This repository has been archived by the owner on Jul 9, 2018. It is now read-only.
is-shallow-equal: Use implicit index.js for main entry #124
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 pull request seeks to resolve an issue with the
@wordpress/is-shallow-equal
module where thepackage.json
points to non-existent files for itsmain
andmodule
entries.is-shallow-equal
is unique from other packages in that it is not transpiled; its main source lives atpackages/is-shallow-equal/index.js
and can be required directly.It's not entirely clear to me how this works at all in Gutenberg. I believe it may be that in the entry point configuration, the
main
field is being ignored or at least falling back toindex.js
where the files do not exist.In fact, this seems to work fine for Node use as well. It's been reported that the only problematic case with the published version is with React Native. (cc @hypest)
Testing instructions:
I found this difficult to test, as via
npm link
the package was being treated as an ES6 module and reporting an error on assigning tomodule.exports
. I was able to have it test correctly by manually updating Webpack to the latest version in Gutenberg, then commenting the line which considersis-shallow-equal
an external module. At which point,npm run dev
and loading the editor in the browser should produce no errors.