Skip to content

Commit

Permalink
Use React.createContext() by @cellog (reduxjs#1000)
Browse files Browse the repository at this point in the history
* alternate 6.x implementation

* use canary values in store instead of setting a prop on the store

* remove createProvider (missed this one before)

* fix renderCountProp, add a test

also clean up unused canary values

* remove errant console.log

* expose context consumer and provider

This will allow third party apps to use these in their code

* changes requested by @timdorr

* export Context instead of just Consumer/Provider
* fix error messages for removed functionality
* minor displayName change

* keep prop-types in production minified UMD build

when the time is right, one need only
change the BABEL_ENV for build:umd:min back to "rollup-production"

* performance optimizations: HEADS UP API change too

* React.forwardRef is VERY slow, on the order of 2x slower in our benchmark. So we only enable it if withRef="forwardRef" folks using withRef=true will get an error telling them to update and not rely on getWrappedInstance() but just to use the ref directly
* renderCountProp is removed, as this is natively supported in React dev tools now
* all usages of shallowEquals are removed for pure components, it was unnecessary.
* instead of allowing passing in a custom Context consumer in props, it is now required to be passed in via connect options at declaration time.

* small optimizations/refactors

* fix storeKey error, allow unstable_observedBits

* update hoist-non-react-statics

* cosmetics

* Replace `withRef="fowardRef"` option with `forwardRef=true`

* Less package-lock.json noise

* Bump React dep to 16.6, and remove shallow-equals

* Switch context variable and prop naming, and use the whole object

* Update Provider implementation and use storeState field

* Rework Provider tests

* Rework connect tests, combine warnings, and remove observedBits

Ported connect test handling from 995
Deduped the "custom store context" messages
Removed use of observedBits for now
Commented out derivedProps propTypes that caused test failures

* Rework connect component based on review notes

Removed use of PureWrapper
Used React.memo() on the wrapped component
Renamed and extracted makeDerivedPropsSelector
Added makeChildElementSelector
Simplified render props callback
Simplified forwardRef handling

* Fix tests around custom context

* Fix custom context as a prop usage

* Fix lint warnings

* Run through Prettier. Update lockfile.
  • Loading branch information
cellog authored and timdorr committed Nov 6, 2018
1 parent 92a0faa commit 625d026
Show file tree
Hide file tree
Showing 11 changed files with 1,033 additions and 961 deletions.
4 changes: 0 additions & 4 deletions .travis.yml
Expand Up @@ -3,10 +3,6 @@ node_js:
- "10"
env:
matrix:
- REACT=0.14
- REACT=15
- REACT=16.2
- REACT=16.3
- REACT=16.4
- REACT=16.5
- REACT=16.6
Expand Down

0 comments on commit 625d026

Please sign in to comment.