React-helmet: Replace shallowequal with deep-equal

Created on 23 May 2017  路  9Comments  路  Source: nfl/react-helmet

@dashed just released a v1 of https://github.com/dashed/shallowequal which (among other improvements) removes the dependency on lodash.

Despite being a major version update, it does not have breaking API changes. Therefore, an update simply requires to bump the version in package.json and release a patch.

Most helpful comment

@gajus apparently shallowequal latest release is breaking webpack production builds (uglify does not support let statements yet).

All 9 comments

hmm... it seems deep-equal is being used in favour of shallowequal: https://github.com/nfl/react-helmet/pull/200

v3.2.2 still has it: https://github.com/nfl/react-helmet/blob/3.2.2/package.json

but v3.2.3 does not: https://github.com/nfl/react-helmet/blob/3.2.3/package.json

Oops. Opened an issue with a wrong repository. This was meant to be opened with https://github.com/gaearon/react-side-effect. react-helmet uses react-side-effect, react-side-effect uses shallowequal.

https://github.com/gaearon/react-side-effect/issues/35

That said, react-helmet could replace deep-equal with shallowequal to reduce the dependency tree. (They do the same thing, right?)

@gajus apparently shallowequal latest release is breaking webpack production builds (uglify does not support let statements yet).

Just ran into this as well with shallowequal and Uglify.

@magalhas can you link where you found others having the same issue?

@gajus I believe we used deep-equal because with children the object comparison in shouldComponentUpdate was always false, even if the children were unchanged. We needed a way to truly check equality between children in props.

@cwelch5 Version of shallowequal has been pushed with the Uglify fix.

It's not react-helmet's responsiblity.

When react-side-effect was released from 1.1.0 to 1.1.1, changing shallowequal from 0.2.2 to 1.0.0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bratva picture bratva  路  4Comments

brianespinosa picture brianespinosa  路  3Comments

lyquocnam picture lyquocnam  路  3Comments

michaelBenin picture michaelBenin  路  3Comments

tinynumbers picture tinynumbers  路  5Comments