This repository was archived by the owner on Jul 9, 2018. It is now read-only.
is-shallow-equal: Use implicit index.js for main entry#124
Merged
Conversation
|
Tried manually patching the package locally to match this diff and works fine in the react-native app. 👍 from my side. |
ntwb
approved these changes
May 7, 2018
3 tasks
4 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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-equalmodule where thepackage.jsonpoints to non-existent files for itsmainandmoduleentries.is-shallow-equalis unique from other packages in that it is not transpiled; its main source lives atpackages/is-shallow-equal/index.jsand 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
mainfield is being ignored or at least falling back toindex.jswhere 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 linkthe 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-equalan external module. At which point,npm run devand loading the editor in the browser should produce no errors.