Skip to content

Releases: kriasoft/universal-router

3.0.0 - 2017-03-25

25 Mar 19:09
Compare
Choose a tag to compare
  • Update Router API (BREAKING CHANGE)
    import Router from 'universal-router';
    const router = new Router(routes, options);
    router.resolve({ path, ...context }); // => Promise<any>
    
    // previously
    import { resolve } from 'universal-router';
    resolve(routes, { path, ...context }); // => Promise<any>
    See #83 for more info and examples
  • context.next() now iterates only child routes by default (BREAKING CHANGE)
    use context.next(true) to iterate through the all remaining routes
  • Remove babel-runtime dependency to decrease library size (BREAKING CHANGE)
    Now you need to care about these polyfills yourself:
  • Add support for URL Generation
    import generateUrls from 'universal-router/generate-urls';
    const url = generateUrls(router);
    url(routeName, params); // => String
  • Add support for Dynamic Breadcrumbs, use context.route.parent to iterate
  • Add support for Declarative Routes
    new Router(routes, { resolveRoute: customResolveRouteFn });
  • Add support for Base URL option
    new Router(routes, { baseUrl: '/base' });
  • Add ability to specify custom context properties once
    new Router(routes, { context: {/* ... */} });
  • Rewrite matchRoute function without usage of generators to decrease amount of necessary polyfills
  • Remove usage of String.prototype.startsWith()
  • Add context.url with the original url passed to resolve method
  • Add context property to Route not found error

2.0.0 - 2016-10-20

25 Mar 19:11
Compare
Choose a tag to compare
  • Preserve context.params values from the parent route (#57)
  • Throws an error if no route found (#62)
  • Remove obsolete context.end() method (#60)
  • Remove obsolete match alias for resolve function (#59)
  • Do not throw an error for malformed URI params (#54)
  • Handle null the same way as undefined (#51)
  • Return null instead of undefined to signal no match (#51)
  • Support context.next() across multiple routes (#49)
  • Sequential execution of asynchronous routes (#49)
  • Remove errors handler from core (#48)
  • Drop support of node.js v5 and below (#47)

1.2.2 - 2016-05-31

25 Mar 19:11
Compare
Choose a tag to compare
  • Update UMD build to include missing dependencies (#33)

1.2.1 - 2016-05-12

25 Mar 19:12
Compare
Choose a tag to compare
  • Rename src/browser.js to src/main.js

1.2.0 - 2016-05-12

26 Mar 20:48
Compare
Choose a tag to compare
  • Rename match() to resolve(). E.g. import { resovle } from 'universal-router'
  • Fix an issue when the router throws an exception when the top-level route doesn't have children property
  • Include CommonJS, Harmony Modules, ES5.1 and UMD builds into NPM package
  • Include source maps into NPM package

1.1.0-beta.4 - 2016-04-27

25 Mar 19:13
Compare
Choose a tag to compare
  • Fix optional parameters, e.g. /products/:id? (#27)

1.1.0-beta.3 - 2016-04-08

25 Mar 19:13
Compare
Choose a tag to compare
  • Fix matchRoute() yielding the same route twice when it matches to both full and base URLs

1.1.0-beta.2 - 2016-04-08

25 Mar 19:14
Compare
Choose a tag to compare
  • match(routes, { path, ...context) now throws an error if a matching route was not found (BREAKING CHANGE)
  • If there is a top-level route with path equal to /error, it will be used for error handling by convention

1.1.0-beta.1 - 2016-04-05

25 Mar 19:14
Compare
Choose a tag to compare
  • Remove Router class and router.dispatch() method in favor of
    match(routes, { path, ...context }), where routes is just a plain JavaScript objects containing
    the list of routes (BREAKING CHANGE)
  • Add context.end() method to be used from inside route actions
  • Update documentation and code samples

1.0.0-beta.1 - 2016-03-25

25 Mar 19:15
Compare
Choose a tag to compare
  • Rename react-routing to universal-router (BREAKING CHANGE)
  • Remove router.on(path, ...actions) in favor of router.route(path, ...actions) (BREAKING CHANGE)
  • Remove new Router(on => { ... }) initialization option in favor of new Router(routes) (BREAKING CHANGE)
  • Fix ESLint warnings; update unit tests
  • Remove build tools related to project's homepage in favor of Easystatic
  • Refactor project's homepage layout. See docs/assets.
  • Clean up package.json, update Babel and its plug-ins to the latest versions
  • Make the library use babel-runtime package instead of an inline runtime
  • Add CHANGELOG.md file with the notable changes to this project