Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.0.1
Choose a base ref
...
head repository: reduxjs/react-redux
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.0
Choose a head ref
  • 9 commits
  • 54 files changed
  • 7 contributors

Commits on Mar 3, 2019

  1. Add first SSR integration-tests (#1197)

    * Added integration test-folder and first basic server-rendering test
    
    * Added tests for dispatching actions serverside
    Ephem authored and timdorr committed Mar 3, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    5bf647d View commit details

Commits on Mar 4, 2019

  1. Change CommonJS Broken Docs Link (#1198)

    mytuny authored and timdorr committed Mar 4, 2019
    Copy the full SHA
    471cb2c View commit details
  2. Copy the full SHA
    4f3c2e2 View commit details
  3. Copy the full SHA
    72ed6db View commit details

Commits on Apr 4, 2019

  1. Copy the full SHA
    8e20a05 View commit details
  2. Copy the full SHA
    28adb54 View commit details

Commits on Apr 7, 2019

  1. Enable versioned docs (#1106)

    * Enable versioned doc
    
    * Start adding 6.0 docs
    
    * Rename 5.1.1 to 5.x and make it work
    
    * Cast v6.x versioned docs
    
    * Display v7.x as pre-release version
    wgao19 authored and markerikson committed Apr 7, 2019
    Copy the full SHA
    eae14cc View commit details

Commits on Apr 9, 2019

  1. Use Hooks internally (aka 7.0) (#1209)

    * Update React to latest
    
    * Update React peer dependency to 16.8.x
    
    * Initial re-implementation of `connectAdvanced` using hooks
    
    Matches changes from v7.0.0-alpha.1
    
    * Update tests to match v7-alpha.1 behavior
    
    Added rtl.act() calls around dispatches and other component updates
    Added clarification on expected mapState calls in some places
    Disabled some no-longer-relevant tests per implementation
    Made tests run against React 16.8 by default
    
    * adding a react hooks test that fails with v7 alpha
    
    * wrapping store.dispatch with rlt.act, fixes component renders
    
    * reducing hooks test to 2 components
    
    * Fix case where wrapper props changed before store update render
    
    * Mark ReactDOM as global in UMD builds
    
    Matches state as of v7.0.0-alpha.2
    
    * Fix perf problems with out-of-bounds array access
    
    Matches state as of v7.0.0-alpha.3
    
    * Add modules to handle importing batchedUpdates
    
    * Use appropriate batched update API for subscriptions
    
    * Inject unstable_batchedUpdates in default entry point
    
    * Provide an alternate entry point for alternate renderers
    
    Matches state as of v7.0.0-alpha.4
    
    * Remove batch arg from createListenerCollection (#1205)
    
    This prevents a bug with Terser (webpack's default minifier) where the
    returned batch function isn't defined due to function inlining.
    
    Matches state as of v7.0.0-alpha.5
    
    * Remove older React versions from Travis
    
    * Add comments to connectAdvanced. Many much comments!
    
    * Re-add test for a custom store as a prop
    
    * Fix null pointer exception when store is given as a prop
    
    We were trying to read contextValue.subscription, even if that
    value was null.  Reworked logic to handle cases where the store
    came in as a prop.
    
    * Ensure wrapper props are passed correctly when forwarding refs
    
    * Add a test to verify subscription passthrough with store-as-prop
    
    * add non-batched tests (#1208)
    
    * Force SSR tests to mimic a Node environment
    
    * Restructure connect tests to group by category for easier reading
    
    Yeah, this kills the blame history. Sorry. But it's a lot easier
    to figure out what the tests are used for now.
    
    * Clean up dead code in Provider tests
    
    * Add tests to verify errors are thrown for bad mapState functions
    
    * Fix edge cases around saved wrapper props and error handling
    
    Changed to useLayoutEffect to ensure that the lastWrapperProps ref
    is written to synchronously when a render is committed. However,
    because React warns about this in SSR, added a check to fall back
    to plain useEffect under Node so we don't print warnings.
    
    Also added logic to ensure that if an error is thrown during a
    mapState function, but the component is unmounted before it can
    render, that the error will still be thrown.  This shouldn't happen
    given our top-down subscriptions, but this will help surface the
    problem in our tests if we ever break the top-down behavior.
    
    * Formatting
    
    * Add a test to verify no errors are printed in SSR usage
    
    * Ignore .idea/
    
    * 7.0.0-beta.0
    
    * Updated outdated SSR-test (dispatch in ancestors) (#1213)
    
    * Added test for injecting dynamic reducers on client and server (#1211)
    
    * Remove WebStorm gitignore
    
    This goes in a global gitignore file, not a project.
    
    * [FIX]: #1219 Save references before update (#1220)
    
    * Re-ignore .idea/
    
    * 7.0.0-beta.1
    
    * Update the codecov config to be more forgiving.
    
    * add test to verify that mapStateToProps is always called with latest store state (#1215)
    timdorr authored and markerikson committed Apr 9, 2019
    Copy the full SHA
    fa58572 View commit details
  2. 7.0.0

    markerikson committed Apr 9, 2019
    Copy the full SHA
    608c9c5 View commit details
Showing with 10,809 additions and 6,952 deletions.
  1. +1 −0 .gitignore
  2. +2 −7 .travis.yml
  3. +4 −1 README.md
  4. +7 −1 codecov.yml
  5. +1 −1 docs/api/connect.md
  6. +0 −1 docs/introduction/quick-start.md
  7. +4 −4 docs/using-react-redux/accessing-store.md
  8. +2,133 −4,618 package-lock.json
  9. +23 −23 package.json
  10. +5 −3 rollup.config.js
  11. +11 −0 src/alternate-renderers.js
  12. +23 −31 src/components/Provider.js
  13. +272 −121 src/components/connectAdvanced.js
  14. +6 −1 src/index.js
  15. +99 −0 src/utils/Subscription.js
  16. +12 −0 src/utils/batch.js
  17. +2 −0 src/utils/reactBatchedUpdates.js
  18. +4 −0 src/utils/reactBatchedUpdates.native.js
  19. +58 −21 test/components/Provider.spec.js
  20. +2,698 −2,088 test/components/connect.spec.js
  21. +19 −8 test/components/connectAdvanced.spec.js
  22. +122 −0 test/components/hooks.spec.js
  23. +6 −1 test/install-test-deps.js
  24. +165 −0 test/integration/dynamic-reducers.spec.js
  25. +172 −0 test/integration/server-rendering.spec.js
  26. +14 −14 test/react/16.8/package-lock.json
  27. +2 −2 test/react/16.8/package.json
  28. +5 −6 test/run-tests.js
  29. +104 −0 website/pages/en/versions.js
  30. +9 −0 website/siteConfig.js
  31. +492 −0 website/versioned_docs/version-5.x/api.md
  32. +121 −0 website/versioned_docs/version-5.x/api/Provider.md
  33. +51 −0 website/versioned_docs/version-5.x/api/api.md
  34. +88 −0 website/versioned_docs/version-5.x/api/connect-advanced.md
  35. +325 −0 website/versioned_docs/version-5.x/api/connect.md
  36. +459 −0 website/versioned_docs/version-5.x/introduction/basic-tutorial.md
  37. +71 −0 website/versioned_docs/version-5.x/introduction/quick-start.md
  38. +98 −0 website/versioned_docs/version-5.x/introduction/why-use-react-redux.md
  39. +88 −0 website/versioned_docs/version-5.x/troubleshooting.md
  40. +407 −0 ...rsioned_docs/version-5.x/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  41. +249 −0 website/versioned_docs/version-5.x/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  42. +101 −0 website/versioned_docs/version-6.x/api/Provider.md
  43. +87 −0 website/versioned_docs/version-6.x/api/connect-advanced.md
  44. +628 −0 website/versioned_docs/version-6.x/api/connect.md
  45. +459 −0 website/versioned_docs/version-6.x/introduction/basic-tutorial.md
  46. +84 −0 website/versioned_docs/version-6.x/introduction/quick-start.md
  47. +91 −0 website/versioned_docs/version-6.x/introduction/why-use-react-redux.md
  48. +95 −0 website/versioned_docs/version-6.x/troubleshooting.md
  49. +145 −0 website/versioned_docs/version-6.x/using-react-redux/accessing-store.md
  50. +410 −0 ...rsioned_docs/version-6.x/using-react-redux/connect-dispatching-actions-with-mapDispatchToProps.md
  51. +229 −0 website/versioned_docs/version-6.x/using-react-redux/connect-extracting-data-with-mapStateToProps.md
  52. +22 −0 website/versioned_sidebars/version-5.x-sidebars.json
  53. +22 −0 website/versioned_sidebars/version-6.x-sidebars.json
  54. +4 −0 website/versions.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ test/react/*/test/**/*.spec.js
test/react/**/src
test/jest-config.json
lcov.info
.idea/

lib/core/metadata.js
lib/core/MetadataBlog.js
9 changes: 2 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
language: node_js
node_js:
- "10"
node_js: node
cache: npm
env:
matrix:
- REACT=16.4
- REACT=16.5
- REACT=16.6
- REACT=16.8
sudo: false
script:
- npm test
after_success:
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -17,7 +17,10 @@ React Redux requires **React 16.4 or later.**
npm install --save react-redux
```

This assumes that you’re using [npm](http://npmjs.com/) package manager with a module bundler like [Webpack](https://webpack.js.org/) or [Browserify](http://browserify.org/) to consume [CommonJS modules](http://webpack.github.io/docs/commonjs.html).
This assumes that you’re using [npm](http://npmjs.com/) package manager
with a module bundler like [Webpack](https://webpack.js.org/) or
[Browserify](http://browserify.org/) to consume [CommonJS
modules](https://webpack.js.org/api/module-methods/#commonjs).

If you don’t yet use [npm](http://npmjs.com/) or a modern module bundler, and would rather prefer a single-file [UMD](https://github.com/umdjs/umd) build that makes `ReactRedux` available as a global object, you can grab a pre-built version from [cdnjs](https://cdnjs.com/libraries/react-redux). We *don’t* recommend this approach for any serious application, as most of the libraries complementary to Redux are only available on [npm](http://npmjs.com/).

8 changes: 7 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
comment: false
comment: off
coverage:
status:
project:
default:
threshold: 5%
patch: off
2 changes: 1 addition & 1 deletion docs/api/connect.md
Original file line number Diff line number Diff line change
@@ -121,7 +121,7 @@ The second parameter is normally referred to as `ownProps` by convention.
```js
// binds on component re-rendering
<button onClick={() => this.props.toggleTodo(this.props.todoId)} />
;<button onClick={() => this.props.toggleTodo(this.props.todoId)} />

// binds on `props` change
const mapDispatchToProps = (dispatch, ownProps) => {
1 change: 0 additions & 1 deletion docs/introduction/quick-start.md
Original file line number Diff line number Diff line change
@@ -75,7 +75,6 @@ export default connect(
)(Counter)
```


## Help and Discussion

The **[#redux channel](https://discord.gg/0ZcbPKXt5bZ6au5t)** of the **[Reactiflux Discord community](http://www.reactiflux.com)** is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - come join us!
8 changes: 4 additions & 4 deletions docs/using-react-redux/accessing-store.md
Original file line number Diff line number Diff line change
@@ -47,16 +47,16 @@ export default connect(
mapDispatch,
null,
{ context: MyContext }
)(MyComponent);
)(MyComponent)

// or, call connect as normal to start
const ConnectedComponent = connect(
mapState,
mapDispatch
)(MyComponent);
)(MyComponent)

// Later, pass the custom context as a prop to the connected component
<ConnectedComponent context={MyContext} />
;<ConnectedComponent context={MyContext} />
```

The following runtime error occurs when React Redux does not find a store in the context it is looking. For example:
@@ -132,7 +132,7 @@ function MyConnectedComponent() {
// component where it can be used in lifecycle methods
}}
</ReactReduxContext.Consumer>
);
)
}
```

Loading