Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unexpected behaviour for @wordpress/is-shallow-equal package. #8048

Closed
nerrad opened this issue Jul 19, 2018 · 2 comments · Fixed by #8132
Closed

Fix unexpected behaviour for @wordpress/is-shallow-equal package. #8048

nerrad opened this issue Jul 19, 2018 · 2 comments · Fixed by #8132
Assignees
Labels
[Package] is-shallow-equal /packages/is-shallow-equal [Type] Bug An existing feature does not function as intended

Comments

@nerrad
Copy link
Contributor

nerrad commented Jul 19, 2018

Describe the bug
The docs for this package describe being able to import two specific exports for is-shallow-equal:

You can import a specific implementation if you already know the types of values you are working with:

import isShallowEqualArrays from '@wordpress/is-shallow-equal/arrays';
import isShallowEqualObjects from '@wordpress/is-shallow-equal/objects';

However, with the latest release of the package this no longer works. When building using webpack, the build fails with:

ERROR in ./src/index.js
Module not found: Error: Can't resolve '@wordpress/is-shallow-equal/arrays'

To Reproduce
I've created a repository with some simple code to demonstrate what happens.

@nerrad nerrad added [Type] Bug An existing feature does not function as intended [Package] is-shallow-equal /packages/is-shallow-equal labels Jul 19, 2018
@aduth
Copy link
Member

aduth commented Jul 19, 2018

The root cause of this is that the require semantics were expecting arrays.js and objects.js files in the root module directory. These no longer exist (they live in build), as apparently the package is now subject to the transpile build step (it was not originally).

@aduth
Copy link
Member

aduth commented Jul 19, 2018

See #7556 , cc @gziolo @omarreiss

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] is-shallow-equal /packages/is-shallow-equal [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants