Giter Site home page Giter Site logo

Comments (2)

reneviering avatar reneviering commented on May 21, 2024 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.

Javiani avatar Javiani commented on May 21, 2024 1

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 photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.