Skip to content

Releases: preactjs/preact-router

2.0.0-beta1

31 May 20:54
Compare
Choose a tag to compare
2.0.0-beta1 Pre-release
Pre-release

Installation:

npm install --save preact-router@beta

Possibly Breaking Changes:

  • #33: HTML links (<a href="/..">) with href attributes beginning with / are now automatically wired up to routers.
    • You can still use <Link>, but it is no longer needed.
    • Links that match routes for any Router will be handled by preact-router, otherwise the normal behavior for an HTML link is preserved.

New Features:

  • #34: route(url) now returns true if url resolved to any routes, false if nothing matched (for all routers)
    • Default routes always match, so route() will return true if you're using them.

Other:

  • Build migrated to Babel 6

1.4.0

19 Apr 00:43
Compare
Choose a tag to compare
  • Add support for passing a url prop on initial render, useful for server-rendering (thanks to @impronunciable & @cslarson for the idea)

1.3.0

10 Mar 17:41
Compare
Choose a tag to compare
  • Add support for Express-style splat params (/:a* and /:a+).

1.2.4

10 Mar 17:39
Compare
Choose a tag to compare
  • Allow use with any version of Preact as a peer dependency.

1.2.0

02 Feb 02:35
Compare
Choose a tag to compare
  • Adds support for default routes, which are rendered when no other routes match:
  • Adds reasonably good test coverage

Example: Dedicated 404 route

<Router>
    <Home path="/" />
    <Profile path="/profile/:user" />
    <Error404 default />
</Router>

Example: Fall back to homepage for 404's:

<Router>
    <Home path="/" default />
    <Profile path="/profile/:user" />
</Router>

1.1.0

29 Jan 01:13
Compare
Choose a tag to compare
  • Support for a boolean replace argument to route(), which skips adding an entry to history: route(url, false)

1.0.0

29 Jan 01:13
Compare
Choose a tag to compare
  • [breaking change] Switch to using high order components.

0.1.3

20 Nov 15:41
Compare
Choose a tag to compare
0.1.3