Skip to content
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

Merged
merged 1 commit into from
May 8, 2018

Conversation

aduth
Copy link
Member

@aduth aduth commented May 7, 2018

This pull request seeks to resolve an issue with the @wordpress/is-shallow-equal module where the package.json points to non-existent files for its main and module entries. is-shallow-equal is unique from other packages in that it is not transpiled; its main source lives at packages/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 to index.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 to module.exports. I was able to have it test correctly by manually updating Webpack to the latest version in Gutenberg, then commenting the line which considers is-shallow-equal an external module. At which point, npm run dev and loading the editor in the browser should produce no errors.

@hypest
Copy link

hypest commented May 7, 2018

Tried manually patching the package locally to match this diff and works fine in the react-native app. 👍 from my side.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants