All Versions
29
Latest Version
Avg Release Cycle
82 days
Latest Release
1009 days ago

Changelog History
Page 2

  • v5.1.0 Changes

    January 16, 2018
    • ๐Ÿ‘ Allow any string to be a valid route name (#145)
  • v5.0.0 Changes

    October 30, 2017
    • Skip nested routes when a middleware route returns null (BREAKING CHANGE #140)

    Migration from v4 to v5:

    • If you are using resolveRoute option for custom route handling logic then you need to return undefined instead of null in cases when a route should not match
    • ๐Ÿ‘‰ Make sure that your middleware routes which return null are working as you expect, child routes are no longer executed in this case, use undefined instead if necessary
  • v4.3.0 Changes

    October 22, 2017
  • v4.2.1 Changes

    October 06, 2017
    • ๐Ÿ›  Fix order of context.keys when they preserved from parent routes (i.e. keys order is the same as they appear in a url) (#129)
  • v4.2.0 Changes

    September 20, 2017
    • Correctly handle trailing slashes in paths of routes (#124) If you are using trailing slashes in your paths, then the router will match urls only with trailing slashes: js const routes = [ { path: '/posts', ... }, // matches both "/posts" and "/posts/" { path: '/posts/', ... }, // matches only "/posts/" ]
    • Generate url from first path for routes with an array of paths (#124) js const router = new UniversalRouter({ name: 'page', path: ['/one', '/two', /RegExp/], // only first path is used for url generation }) const url = generateUrls(router) url('page') // => /one
  • v4.1.0 Changes

    September 20, 2017
    • ๐Ÿ‘Œ Support for using the same param name in array of paths (#122)
      const router = new UniversalRouter({
        path: ['/one/:parameter', '/two/:parameter'],
        action: context => context.params,
      })
    
      router.resolve('/one/a') // => { parameter: 'a' }
      router.resolve('/two/b') // => { parameter: 'b' }
    
  • v4.0.0 Changes

    September 15, 2017
    • ๐Ÿ“‡ Rename router.resolve({ path }) to router.resolve({ pathname }) (BREAKING CHANGE #114)
    • ๐Ÿ“‡ Rename context.url to context.pathname (BREAKING CHANGE #114)
    • โœ‚ Remove pretty option from generateUrls(router, options) function in favor of new encode option (BREAKING CHANGE #111)
    • โšก๏ธ Update path-to-regexp to v2.0.0, see changelog (BREAKING CHANGE #111)
      • Explicitly handle trailing delimiters (e.g. /test/ is now treated as /test/ instead of /test when matching)
      • No wildcard asterisk (*) - use parameters instead ((.*))
    • โž• Add support for repeat parameters (#116)
    • โž• Add encode option to generateUrls(router, options) function for pretty encoding (e.g. pass your own implementation) (#111)
    • Preserve context.keys values from the parent route (#111)
    • Inherit context.params and queryParams from Object (e.g. params.hasOwnProperty() won't throw an exception anymore) (#111)
    • ๐Ÿ“ฆ Include the source code of the router in the npm package (#110)

    Migration from v3 to v4:

    • ๐Ÿ”„ Change router.resolve({ path, ... }) to router.resolve({ pathname, ... })
    • โœ‚ Remove trailing slashes from all paths of your routes, i.e.
      • path: '/posts/:uri/' => path: '/posts/:uri'
      • path: '/posts/' => path: '/posts'
      • path: '/' => path: ''
      • etc.
    • Replace path: '*' with path: '(.*)' if any
    • ๐Ÿ”ง If you are using webpack, change rule (loader) for .js files to include .mjs extension, i.e.
      • test: /\.js$/ => test: /\.m?js$/
  • v3.2.0 Changes

    May 10, 2017
    • โž• Add stringifyQueryParams option to generateUrls(router, options) to generate URL with query string from unknown route params (#93)
  • v3.1.0 Changes

    April 20, 2017
    • ๐Ÿ›  Fix context.next() for multiple nested routes (#91)
    • โž• Add pretty option for generateUrls(router, options) to prettier encoding of URI path segments (#88)
    • โž• Add source maps for minified builds (#87)
    • ๐Ÿ— Include UMD builds to the git repository
  • v3.0.0 Changes

    March 25, 2017
    • โšก๏ธ 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

    • 0๏ธโƒฃ 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 js 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