mefechoel / svelte-navigator

Simple, accessible routing for Svelte
Other
502 stars 39 forks source link

lazy loading & chunk bundles #37

Closed sysmat closed 3 years ago

sysmat commented 3 years ago

Is your feature request related to a problem? Please describe.

Describe the solution you'd like

<Router {basepath}>
  <main>
    <Navbar />

    <Route path="" component={Queries} />
    <Route path="queries" component={Queries} />
    <Route path="statistics" component={Statistics} lazy="true"/>
    <Route path="status" component={Status}  lazy="true"/>
  </main>
</Router>
mefechoel commented 3 years ago

This is also possible with the help of a few little helper components. Checkout the lazy routes example as a starting point. Again, I don't think this should be part of the libraries api, as it is relatively straight forward to implement yourself and might be a burden on users who don't use the feature.