Closed cristinecula closed 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.
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.
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.