Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw instead of silently failing with history v3 #3571

Merged
merged 1 commit into from
Jun 23, 2016
Merged

Conversation

taion
Copy link
Contributor

@taion taion commented Jun 23, 2016

No description provided.

@taion taion force-pushed the history-v3-throw branch from 6aa514a to 612ff86 Compare June 23, 2016 02:52
@taion
Copy link
Contributor Author

taion commented Jun 23, 2016

Curses, why did I release history v2.5.0 before writing this?

@taion
Copy link
Contributor Author

taion commented Jun 23, 2016

There are more duck-type-y ways to make this check, like failing in the transition manager if history.listen doesn't synchronously call back with an initial position, but this is the easiest and most straightforward way, and as far as I can tell it works.

@RobertWarrenGilmore
Copy link

Does history 2.5.0 cause the same bug as 3.x?

@taion
Copy link
Contributor Author

taion commented Jun 23, 2016

There is no history 2.5.0.

@timdorr timdorr merged commit 44b3c6e into master Jun 23, 2016
@timdorr
Copy link
Member

timdorr commented Jun 23, 2016

Push a 2.5.1 :)

@timdorr timdorr deleted the history-v3-throw branch June 23, 2016 04:02
@@ -91,6 +98,13 @@ const Router = React.createClass({
let { history } = this.props
const { routes, children } = this.props

invariant(
!isUnsupportedHistory(history),
'You have provided a history object from created with history v3.x. ' +
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"from created with", is that a typo?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

):

@taion
Copy link
Contributor Author

taion commented Jun 23, 2016

I'll release this tomorrow... about to call it a night and probably should be around in case this breaks people.

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.

4 participants