Skip to content

Releases: strblr/typeroute

v0.12.1

25 Feb 21:06

Choose a tag to compare

  • Docs improvements: rewrote the three chapters dedicated to route building, route nesting and router setup. The unique philosophy and mental model behind TypeRoute is now expressed more clearly.

v0.12.0

19 Feb 02:30

Choose a tag to compare

  • Internally, child routes kept a reference to their parent route. This didn't have any practical utility besides a simpler route tree building algorithm in the devtools. In this version, this reference was removed and the devtools algorithm was rewritten to do prefix grouping instead. From the router's perspective, every route is flat and self-contained anyway. The concept of route hierarchy is for route building and not something the router actually sees. The devtools now align with this philosophy.
  • Updated docs to remove useless usage of .route("/"). The resulting route from this call is strictly equivalent to the parent route. The docs now use the parent route directly.
const home = layout.route("/").component(HomePage); // Old
const home = layout.component(HomePage);            // New

v0.11.2

15 Feb 16:50

Choose a tag to compare

  • Bundle size optimization:
    • gzip: 3.57 kB → 3.53 kB
    • minified: 8.76 kB → 8.42 kB

v0.11.1

15 Feb 09:12

Choose a tag to compare

  • Bundle size optimization:
    • gzip: 3.67 kB → 3.57 kB
    • minified: 9.01 kB → 8.76 kB

v0.11.0: Merge pull request #7 from strblr/feat-index

14 Feb 16:57
1027d5b

Choose a tag to compare

  • Added new route builder method .index(). You can now do:
const dashboard = route("/dashboard")
  .component(DashboardLayout)
  .index(Overview);

const settings = dashboard.route("/settings").component(Settings);

// ...

const routes = [dashboard, settings];

Here's what renders for each path:

/dashboard          → DashboardLayout > Overview
/dashboard/settings → DashboardLayout > Settings

.index(Comp) is shorthand for .component(() => useOutlet() ?? <Comp />).

v0.10.0

10 Feb 11:20

Choose a tag to compare

  • Router context: you can now pass an arbitrary context to your router and consume it in preloaders. Useful if you need contextual data or instances in preloaders, e.g., a different queryClient for test environments.
<RouterRoot routes={routes} context={{ queryClient }} />;

declare module "@typeroute/router" {
  interface Register {
    routes: typeof routes;
    context: { queryClient: QueryClient };
  }
}
  • Handle type now defaults to undefined instead of any, when not registered on the Register interface.

v0.9.0

08 Feb 03:34

Choose a tag to compare

  • You can now pass a routes record to new Router, RouterRoot and module augmentation (previously, only array was possible):
const routes = [home, about];
// Equivalent:
const routes = { home, about };

<RouterRoot routes={routes} />

declare module "@typeroute/router" {
  interface Register {
    routes: typeof routes;
  }
}

v0.8.1

05 Feb 18:36

Choose a tag to compare

  • Made devtools (@typeroute/devtools) compatible with touch screens
  • Dynamic page title example in docs' cookbook

v0.8.0

05 Feb 08:12

Choose a tag to compare

  • Renamed project from Waymark to TypeRoute
  • Added devtools (@typeroute/devtools), read more here
  • Simplified HistoryLike interface
  • Refactored history location source of truth (one useSyncExternalStore in RouterRoot + context)

v0.4.0

31 Jan 07:58

Choose a tag to compare

🚀 Features

  • Middlewares: bundle reusable route configuration (read more)