Neovici / cosmoz-router

Ad-hoc web component page router
Apache License 2.0
11 stars 1 forks source link

Clean up uses of HTML imports #58

Closed cristinecula closed 5 years ago

cristinecula commented 5 years ago

Considering that HTML imports are deprecated and the recent move in cosmoz-frontend to es modules, we should clean up all uses of this feature.

nomego commented 5 years ago

Yes I think we basically should refactor all of cosmoz-page-router.

We originally forked app-router and just continued with the design, even though it doesn't really fit our process.

I think we can drop like 80% of the code and just simplify it around ES modules/imports.

cristinecula commented 5 years ago

I noted a few framework agnostic routing libraries that we might use to replace our custom logic.

https://github.com/chrisdavies/rlite https://router5.js.org/ https://github.com/flatiron/director https://github.com/aMarCruz/easyrouter https://github.com/visionmedia/page.js https://github.com/leeluolee/stateman

I think that this library could evolve to become just a collection of custom elements (e.g.: to define routes declaratively) and some helpers for parsing and generating urls, maybe even some lit-html directives, on top of a mature router implementation.

cristinecula commented 5 years ago

Other interesting resources: https://nicedoc.io/mksarge/redux-first-routing https://github.com/kriasoft/universal-router https://www.freecodecamp.org/news/an-introduction-to-the-redux-first-routing-model-98926ebf53cb/ https://vaadin.com/router