Comments (2)
Hi,
thanks for your interest in vanilla-ui-router and for your feature request :) Sounds very interesting.
I plan a "middleware" feature (similar to that of redux or expressjs) which is registered once while creating the router-object and is called immediately before any route-handler is invoked. Then it's possible to write a lazy-loading middleware or any other "plugins". I like the middleware concept because it keeps the router-core very simple and small and you can achieve complex additions which are completely encapsulated from the rest.
What do you think about that?
I hope I'll find some time in the near future, implementing the middleware feature. Then we could test the lazy loading as a middleware. If you are interested, pull requests are very welcome :)
RenΓ©
from vanilla-ui-router.
What do you think about that?
Perfect!
I hope I'll find some time in the near future, implementing the middleware feature. Then we could test the lazy loading as a middleware. If you are interested, pull requests are very welcome :)
Sure! I am not sure if I can write some poc because I'm already committed to another project, but I can certainly help with fixes and tests.
I can share my solution so maybe it can be useful somehow.
My abstraction that loads html, css, js : https://github.com/jails-org/Demos/blob/master/TodoSPA/front/modules/loader/index.js
The use-case can be found here:
https://github.com/jails-org/Demos/blob/master/TodoSPA/front/apps/application/index.js#L42
The third-party router calls my loader
on every url changes, the loader will get all assets and cache them, it will always load them only once.
Thank you for your attention, I'm hoping for more vanilla js contribution from front-end community just like this one.
o/
from vanilla-ui-router.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vanilla-ui-router.