javascript - In Aurelia.js, how do I make supporting html for routers load on demand rather than startup? -
in aurelia.js, if @ network traffic, seems html pages routers loaded @ start-time (loaded system.js since bundling). makes page load slower. need them load on demand, when router corresponding hyperlink clicked.
this interesting idea. i'm not core team member maybe deep knowledge of router can comment on ability you're asking. know i'm below doesn't directly answer question, i'm providing as-is in case it's still helpful.
generally, people "bundle" app before deploying production. see https://github.com/aurelia/bundler example on how in aurelia. aurelia skeleton app has build pipeline wired in default (https://github.com/aurelia/skeleton-navigation).
bundling reduces number of network requests, still loads entire app @ once. have think of spa apps more desktop apps. html template or "view" template edit compiled javascript, combined data needs "view model". 1 approach results in smaller downloads break large monolithic application several smaller applications. create separate aurelia apps loaded @ different server urls. have mixture of server routing (to route users between applications) , client routing (to route user within application). creates complexity in development lifecycle though.
Comments
Post a Comment