Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

universal-router

Package Overview
Dependencies
Maintainers
2
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

universal-router - npm Package Versions

134

6.0.0

Diff

Changelog

Source

[6.0.0] - 2018-02-06

  • No special configuration is required for your bundler anymore (say hi to parcel.js).
  • Add an option for global error handling (#147).

Migration from v5 to v6:

  • Use error.code instead of error.status or error.statusCode for error handling.
frenzzy
published 5.1.0 •

Changelog

Source

[5.1.0] - 2018-01-16

  • Allow any string to be a valid route name (#145)
frenzzy
published 5.0.0 •

Changelog

Source

[5.0.0] - 2017-10-30

  • 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
frenzzy
published 4.3.0 •

Changelog

Source

[4.3.0] - 2017-10-22

frenzzy
published 4.2.1 •

Changelog

Source

[4.2.1] - 2017-10-06

  • 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)
frenzzy
published 4.2.0 •

Changelog

Source

[4.2.0] - 2017-09-20

  • Correctly handle trailing slashes in paths of routes (#124)<br> If you are using trailing slashes in your paths, then the router will match urls only with trailing slashes:
    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)
    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
    
frenzzy
published 4.1.0 •

Changelog

Source

[4.1.0] - 2017-09-20

  • 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' }
    
frenzzy
published 4.0.0 •

Changelog

Source

[4.0.0] - 2017-09-15

  • 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$/
frenzzy
published 3.2.0 •

Changelog

Source

[3.2.0] - 2017-05-10

  • Add stringifyQueryParams option to generateUrls(router, options) to generate URL with query string from unknown route params (#93)
frenzzy
published 3.1.0 •

Changelog

Source

[3.1.0] - 2017-04-20

  • 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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc