Pre-release

@mjackson mjackson released this Nov 1, 2018 · 24 commits to master since this release

Assets 2

Fixes

  • Fixed import of react-is in the CommonJS build (see #6445)
  • Added missing prop-types dependency for ESM build (see #6438)
Pre-release

@mjackson mjackson released this Oct 30, 2018 · 33 commits to master since this release

Assets 2

Fixes

  • Fixed <Route component> prop-type warning when using forwardRef (see #6417, thanks @frehner and @eXon)
  • Added missing file to react-router-config package (see #6415, thanks @Anomen)
  • Several docs improvements (see #6410, thanks @justsml)
Pre-release

@mjackson mjackson released this Oct 17, 2018 · 52 commits to master since this release

Assets 2

Features

  • Adds support for an array of paths in <Route path> (thanks @baronswindle)

Fixes

  • Fix for <Link rel="_self"> (thanks @ericyang89)
  • MUCH smaller CJS + ESM builds (thanks @pshrmn and @TrySound)
  • Include required deprecation warning file for require('react-router/Route') statements (thanks @timdorr)

Enjoy! 😅

Pre-release

@mjackson mjackson released this Oct 15, 2018 · 64 commits to master since this release

Assets 2

Fixed ESM entry point from 4.4.0-beta.2 🤦‍♂️

Pre-release

@mjackson mjackson released this Oct 14, 2018 · 66 commits to master since this release

Assets 2

Getting closer to 4.4 final! We've received some great feedback during the past few weeks on the 4.4 beta. Please keep it coming :)

Features

  • Both our CJS and ESM builds now use Rollup, which means they are smaller and should be easier to consume. Requiring individual files (e.g. require('react-router/Route')) from any of our packages is no longer supported.
  • We now provide a pre-built production-ready CJS and ESM builds instead of requiring consumers to build it themselves.

Fixes

  • Eliminate all warnings when using the router under React 16's <StrictMode>. In fact, we now wrap all our tests in <StrictMode>!
  • Don't leak memory when a <Router> is rendered server side (introduced in a previous 4.4 beta).

Enjoy! 😅

Pre-release

@mjackson mjackson released this Sep 30, 2018 · 98 commits to master since this release

Assets 2

This release fixes a few issues with the build in v4.4.0-beta.0 where the 4.4.0-beta.0 version was not specified correctly in the dependencies of react-router-dom.

Also, please be careful which build you are using. Prior to this release, you could mix your import styles, i.e.:

// Be careful, this won't work anymore!
import BrowserRouter from 'react-router-dom/BrowserRouter';
import { Route } from 'react-router-dom';

<BrowserRouter>
  <Route />
</BrowserRouter>

The problem here is that, although it may not be obvious the first import is actually using the CommonJS build while the 2nd import is (probably, depending on what your bundler is doing) using the ES modules build. Your bundler can probably handle the variation in module formats just fine, but when you go to run your code you'll see a warning like:

You should not render a <Route> outside a <Router>

Basically, what this means is that <Route> can't find the correct context object because each build has its own context object and the <Router> component was imported from a different build!

Instead, just import both components using the same method:

// These are both from the same build and use the same context object
// so there won't be a mismatch :)
import { BrowserRouter, Route } from 'react-router-dom';

I'm going to try and figure out a better way to detect if you're using 2 different builds so we can give you a better warning.

Enjoy! 😅

Pre-release

@mjackson mjackson released this Sep 29, 2018 · 105 commits to master since this release

Assets 2

This is primarily a maintenance release that is fully backwards compatible with 4.3.1 while also improving compatibility with React 16 and preparing for the future.

The main features of this release are:

  • Removed the single-child restriction in <Router> so you can have multiple children, provided you're using React 16
  • Migrated our underlying infrastructure to use React's new context API. A HUGE thank-you to @timdorr who provided the initial work required to migrate the codebase to React's new context API (see #5908)
  • Removed all traces of the deprecated componentWillMount and componentWillReceiveProps

We also made it explicit in this release that you can't use contextTypes to access properties on this.context.router anymore. If you try, you'll get a warning. That's our private API! If you need stuff on context, just use a <Route> or withRouter instead. It's all the same stuff, and that's our public API 👍

🚨 In a future release, we will remove the old context API entirely so your app will break if you were using our private API. 🚨

Other housekeeping that was done:

  • Migrated to use babel-preset-env + a custom list of proposal plugins we use instead of the deprecated babel-preset-es2015 + babel-preset-stage-1
  • Improved testing infrastructure. Now, instead of running a build when you're working on e.g. react-router-dom and you need some changes in react-router, you don't have to go and rebuild it to test things out. This should make the repo easier to work with
  • Added some more warnings in dev mode

As always, you can try everything out using the next tag:

yarn add react-router@next
yarn add react-router-dom@next
yarn add react-router-config@next

We will be paying close attention to the feedback on this release and hope to release 4.4.0 final soon!

Enjoy 😅

@timdorr timdorr released this Jun 6, 2018 · 176 commits to master since this release

Assets 2

Just a patch to fix an accidental move of warning from a normal dependency to a devDependency, which was causing issues with installation.

@timdorr timdorr released this Jun 6, 2018 · 180 commits to master since this release

Assets 2

The major new things of this release are Redirect with params (see #5209) and the new generatePath API. We also cleaned up the code with Prettier, so browsing through it should be more enjoyable.

One other thing to mention, while I have your attention, is the deprecation of react-router-redux. It's no longer maintained and has a number of fundamental problems (particularly around time travel). Integrating Redux and the DOM History API is challenging because they don't maintain the same semantics and the resulting integration is error prone. Getting to the router context will be easier in future versions of React Router, so the main motivations for needing it will be going away. So, while I would advise against trying to integrate the two, for those that still want this functionality can turn to libraries like @supasate's connected-react-router.

Changes

Pre-release

@timdorr timdorr released this Apr 26, 2018 · 190 commits to master since this release

Assets 2

Changes

  • Fix broken UMD builds.
  • Add sideEffects: false for webpack tree shaking (#6082 by @taylorc93)