Skip to content
John Horback edited this page Sep 22, 2021 · 18 revisions

Feature Ideas

Import Maps for Lazy Route Loading

Use import maps to support automatically calling named imports for lazy loading This could enable adding an attribute to a route to automatically call import when the route matches.

This could be as simple as registering an import map with the Router.

Router.setImportMap((importScript) => {
    switch(importScript) {
    case "user-page":
        import("/user-script");
        break;
    case "default":
        throw new Error("import not found");
    };
});

Would still want to check out the import map specification: "bare import specifiers". See Import Maps

API pattern

  • Create a class that can make requests
  • Could supplement sendRequest (and perhaps MockServer)
  • Could create a class for each base URL
  • Server caching: https://swr.vercel.app/
  • MockServer element?!
  • sendRequest()?!
Clone this wiki locally