vaadin/vaadin-router

Name: vaadin-router

Owner: Vaadin

Description: Small and powerful client-side router for Web Components. Framework-agnostic.

Created: 2018-03-19 10:00:42.0

Updated: 2018-05-24 13:50:34.0

Pushed: 2018-05-24 13:50:34.0

Homepage: https://vaadin.github.io/vaadin-router/vaadin-router/

Size: 1962

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NPM version Bundle size Build Status Gitter

Vaadin.Router

Live Demo ? | API documentation ?

under construction

Vaadin.Router is a small yet powerfull client-side router JS library. It uses the widely adopted express.js syntax for routes (/users/:id) to map URLs to Web Component views. All features one might expect from a modern router are supported: async route resolution, animated transitions, navigation guards, redirects, and more. It is framework-agnostic and works equally well with all Web Components regardless of how they are created (Polymer / SkateJS / Stencil / Angular / Vue / etc).

Vaadin.Router is a good fit for developers that do not want to go all-in with one framework, and prefer to have freedom in picking the components that work best for their specific needs.

rt {Router} from '@vaadin/router';

t router = new Router(document.getElementById('outlet'));
er.setRoutes([
ath: '/', component: 'x-home-view'},
ath: '/users', component: 'x-user-list'}

Running demos and tests in the browser
  1. Fork the vaadin-router repository and clone it locally.

  2. Make sure you have npm installed.

  3. When in the vaadin-router directory, run npm install to install dependencies.

  4. Run npm start, and open http://127.0.0.1:8000/components/vaadin-router in your browser to see the component API documentation.

  5. You can also open demo or in-browser tests by adding demo or test to the URL, for example:

  6. http://127.0.0.1:8000/components/vaadin-router/demo

  7. Public API tests: http://127.0.0.1:8000/components/vaadin-router/test

  8. Unit tests: http://127.0.0.1:8000/components/vaadin-router/test/index.coverage.html

Running tests from the command line
  1. When in the vaadin-router directory, run npm test
Following the coding style

We are using ESLint for linting JavaScript code. You can check if your code is following our standards by running npm run lint, which will automatically lint all .js files as well as JavaScript snippets inside .html files.

Contributing
License

Apache License 2.0


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.