Socket
Socket
Sign inDemoInstall

react-router-redux

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-redux - npm Package Compare versions

Comparing version 4.0.0-rc.1 to 4.0.0-rc.2

10

CHANGELOG.md

@@ -1,5 +0,11 @@

## [HEAD](https://github.com/reactjs/react-router-redux/compare/3.0.0...master)
## [4.0.0](https://github.com/reactjs/react-router-redux/compare/3.0.0...4.0.0)
- Nothing yet!
This is a big breaking release, but the last one for the foreseeable future. The scope of this library has changed, so please re-evaluate its usefulness to you. You may not need it and this is ok!
#### Summary of Changes
The provided action creators and middleware are now separate from the history<->state syncing function. For the vast majority of cases, using action creators to trigger navigation is obsoleted by React Router's [new history singletons](https://github.com/rackt/react-router/blob/master/upgrade-guides/v2.0.0.md#history-singletons-provided) provided in 2.0. Building this functionality in by default and coupling it to our history syncing logic no longer makes sense.
We now sync by enhancing the history instance to listen for navigation events and dispatch those into the store. The enhanced history has its `listen` method overridden to respond to store changes, rather than directly to navigation events. When this history is provided to `<Router>`, the router will listen to it and receive these store changes. This means if we time travel with the store, the router will receive those store changes and update based on the location in the store, instead of what the browser says. Normal navigation events (hitting your browser back/forward buttons, telling a history singleton to `push` a location) flow through the history's listener like normal, so all the usual stuff works A-OK.
## [3.0.0](https://github.com/reactjs/react-router-redux/compare/2.1.0...3.0.0)

@@ -6,0 +12,0 @@

7

lib/sync.js

@@ -111,4 +111,2 @@ 'use strict';

var lastPublishedLocation = getLocationInStore(true);
// History listeners expect a synchronous call
listener(lastPublishedLocation);

@@ -129,2 +127,7 @@ // Keep track of whether we unsubscribed, as Redux store

// History listeners expect a synchronous call. Make the first call to the
// listener after subscribing to the store, in case the listener causes a
// location change (e.g. when it redirects)
listener(lastPublishedLocation);
// Let user unsubscribe later

@@ -131,0 +134,0 @@ return function () {

{
"name": "react-router-redux",
"version": "4.0.0-rc.1",
"version": "4.0.0-rc.2",
"description": "Ruthlessly simple bindings to keep react-router and redux in sync",

@@ -46,2 +46,3 @@ "main": "lib/index",

"babel-preset-es2015": "^6.3.13",
"babel-preset-react": "^6.5.0",
"babel-preset-stage-1": "^6.3.13",

@@ -68,2 +69,5 @@ "babel-register": "^6.4.3",

"react": "^0.14.3",
"react-dom": "^0.14.3",
"react-redux": "^4.4.0",
"react-router": "^2.0.0",
"redux": "^3.0.4",

@@ -70,0 +74,0 @@ "redux-devtools": "^3.0.0",

@@ -104,4 +104,2 @@ import { LOCATION_CHANGE } from './reducer'

let lastPublishedLocation = getLocationInStore(true)
// History listeners expect a synchronous call
listener(lastPublishedLocation)

@@ -122,2 +120,7 @@ // Keep track of whether we unsubscribed, as Redux store

// History listeners expect a synchronous call. Make the first call to the
// listener after subscribing to the store, in case the listener causes a
// location change (e.g. when it redirects)
listener(lastPublishedLocation)
// Let user unsubscribe later

@@ -124,0 +127,0 @@ return () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc