Skip to content
This repository has been archived by the owner on Nov 26, 2018. It is now read-only.

Export symbols (for hoist blacklisting) #95

Closed

Conversation

helixbass
Copy link
Contributor

Background:

I was running into buggy behavior when trying to compose() two react-apollo graphql() HOCs, each with a following withProps() ie

compose(
  graphql(...),
  withProps(...),
  graphql(...),
  withProps(...)
)

Turned out that graphql() copies all static properties using hoist-non-react-statics, including the symbols that recompact uses ("internally") to keep track of its state eg compactability, so withProps() was treating graphql() as though it were another recompact HOC and bugginess ensued

In this PR:

  • Export the MAPPERS_INFO and compactable symbols so that they can be passed to eg hoist-non-react-statics blacklist

From my understanding of symbols, exporting the actual symbols used is necessary because there's no way to "recreate" them separately for use in a blacklist

@codecov
Copy link

codecov bot commented Feb 11, 2018

Codecov Report

Merging #95 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #95   +/-   ##
=======================================
  Coverage   96.57%   96.57%           
=======================================
  Files          63       63           
  Lines         467      467           
=======================================
  Hits          451      451           
  Misses         16       16
Impacted Files Coverage Δ
src/utils/createHOCFromMapper.js 100% <ø> (ø) ⬆️
src/utils/createCompactableHOC.js 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4de94af...c13568f. Read the comment docs.

@matthieuprat
Copy link
Collaborator

matthieuprat commented Feb 18, 2018

Waiting to settle on #97 before moving forward with this PR.

@helixbass
Copy link
Contributor Author

Replaced by #100

@helixbass helixbass closed this Mar 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants