Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

aurelia-route-recognizer

aurelia45.3kMIT1.3.2TypeScript support: included

A lightweight JavaScript library that matches paths against registered routes. It includes support for dynamic and star segments and nested handlers.

aurelia, route

readme

aurelia-route-recognizer

npm Version ZenHub Join the chat at https://gitter.im/aurelia/discuss CircleCI

This library is part of the Aurelia platform and contains a lightweight JavaScript library that matches paths against registered routes. It includes support for dynamic and star segments and nested handlers.

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions look around our Discourse forums, chat in our community on Gitter or use stack overflow. Documentation can be found in our developer hub. If you would like to have deeper insight into our development process, please install the ZenHub Chrome or Firefox Extension and visit any of our repository's boards.

Platform Support

This library can be used in the browser as well as on the server.

Building The Code

To build the code, follow these steps.

  1. Ensure that NodeJS is installed. This provides the platform on which the build tooling runs.
  2. From the project folder, execute the following command:

    npm install
  3. Ensure that Gulp is installed. If you need to install it, use the following command:

    npm install -g gulp
  4. To build the code, you can now run:

    gulp build
  5. You will find the compiled code in the dist folder, available in three module formats: AMD, CommonJS and ES6.

  6. See gulpfile.js for other tasks related to generating the docs and linting.

Running The Tests

To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps:

  1. Ensure that the Karma CLI is installed. If you need to install it, use the following command:

    npm install -g karma-cli
  2. Ensure that jspm is installed. If you need to install it, use the following commnand:

    npm install -g jspm
  3. Install the client-side dependencies with jspm:

    jspm install
  4. You can now run the tests with this command:

    karma start

changelog

1.3.2 (2019-02-04)

Bug Fixes

  • all: change es2015 back to native-modules (2696e84)

1.3.1 (2018-11-20)

1.3.0 (2018-11-20)

Features

  • route-recognizer: Support generating a route by route config in addition to name (ba9eb61)

1.2.0 (2018-06-14)

Bug Fixes

  • Require leading slashes to optional segments (27f72a5)

1.1.1 (2017-10-01)

Bug Fixes

  • Improve TypeScript types
  • Remove unnecessary return statement

1.1.0 (2016-09-22)

Features

  • Support Optional Parameters with :paramName?

1.0.0 (2016-07-27)

Bug Fixes

  • route-recognizer: use href for generation only when specified (97b377b), closes #24

1.0.0-rc.1.0.1 (2016-07-12)

Bug Fixes

  • route-recognizer: respect explicit href during generation (335f2a7)

1.0.0-rc.1.0.0 (2016-06-22)

1.0.0-beta.1.2.1 (2016-05-10)

Bug Fixes

  • route-recognizer: route recognizer is case insensitive by default (d89cde4c)

1.0.0-beta.1.2.0 (2016-03-22)

  • Update to Babel 6

1.0.0-beta.1.1.3 (2016-03-02)

Bug Fixes

1.0.0-beta.1.1.2 (2016-03-01)

Bug Fixes

Features

  • route-recognizer: Support multiple names per route (6b5637d2)

1.0.0-beta.1.1.1 (2016-02-08)

1.0.0-beta.1.1.0 (2016-01-29)

Features

  • all: update jspm meta; core-js; aurelia deps (59b29532)

1.0.0-beta.1 (2015-11-16)

0.9.0 (2015-11-10)

0.8.0 (2015-10-13)

Bug Fixes

  • all: update compiler (6f834b02)
  • build:
    • update linting, testing and tools (f49bf0d3)
    • add missing bower bump (600b7409)
  • package:
    • update aurelia tools and dts generator (1786cd45)
    • change jspm directories (43b094ce)
  • route-recognizer:
    • Use correct import for core-js We were previously using `import core from core-j (d37d1687)
    • ensure required route segments are specified when generating (513aeeb7)
    • allow unnamed routes to be registered (240a9e2d)
    • fix bug where array keys were not encoded in querystrings (f5019d95)
    • adjust querystring parsing for several edge cases (10664338)
    • require route names to be specified (a62cd3b8)
    • fix bug preventing uri generation from working (e04351dd)
  • tests: correct import source (dbb913c9)

Features

  • all:
  • build:
    • d.ts building from babel (503776f6)
    • initial work on dts generation (3af59915)
    • update compiler and switch to register module format (8b31d638)
  • docs: generate api.json from .d.ts file (e5441c97)
  • route-recognizer:
    • use query string helpers from aurelia-path (a96f5a0f)
    • don't encode '$' in query string keys (b7aca7fd)
    • return the registered state from add (293d8417)
    • automatically add unused route generation params to the query string (c3c8a3e7, closes #3)

0.7.0 (2015-09-04)

Bug Fixes

  • build: update linting, testing and tools (f49bf0d3)

Features

  • docs: generate api.json from .d.ts file (e5441c97)
  • route-recognizer: use query string helpers from aurelia-path (a96f5a0f)

0.6.2 (2015-08-14)

Bug Fixes

  • route-recognizer: Use correct import for core-js We were previously using `import core from core-j (d37d1687)

Features

0.6.1 (2015-07-29)

  • improve output file name

0.6.0 (2015-07-02)

Bug Fixes

  • package: update aurelia tools and dts generator (1786cd45)
  • tests: correct import source (dbb913c9)

Features

  • all: working on improving d.ts generation (60b547a8)
  • build:

0.5.0 (2015-06-08)

Features

  • route-recognizer: don't encode '$' in query string keys (b7aca7fd)

0.4.0 (2015-04-30)

  • all: update compilation process

0.3.0 (2015-04-09)

Bug Fixes

  • all: update compiler (6f834b02)
  • route-recognizer:
    • ensure required route segments are specified when generating (513aeeb7)
    • allow unnamed routes to be registered (240a9e2d)
    • fix bug where array keys were not encoded in querystrings (f5019d95)
    • adjust querystring parsing for several edge cases (10664338)
    • require route names to be specified (a62cd3b8)
    • fix bug preventing uri generation from working (e04351dd)

Features

  • route-recognizer:
    • return the registered state from add (293d8417)
    • automatically add unused route generation params to the query string (c3c8a3e7, closes #3)

0.2.4 (2015-02-28)

Bug Fixes

  • package: change jspm directories (43b094ce)

0.2.3 (2015-02-28)

Bug Fixes

  • build: add missing bower bump (600b7409)

0.2.2 (2015-01-22)

  • Update compiler.

0.2.1 (2015-01-12)

  • Update compiled output.

0.2.0 (2015-01-06)

Features

  • build: update compiler and switch to register module format (8b31d638)