nocterm_unrouter 0.2.0 copy "nocterm_unrouter: ^0.2.0" to clipboard
nocterm_unrouter: ^0.2.0 copied to clipboard

Declarative nested router for Nocterm apps with guards and nested outlets.

Changelog #

0.2.0 #

Migration guide: See Migration note below.

Highlights #

Nocterm Unrouter 0.2.0 rebuilds the package on top of unrouter_core and aligns the terminal API with the shared route-tree model used across the workspace. This release replaces the old typed route-data adapter surface with createRouter, Inlet, RouterView, and Outlet, adds route scope helpers for terminal components, refreshes the Nocterm example app, and keeps guard handling on the shared core runtime.

Breaking Changes #

  • Routers are now created with createRouter(routes: [...]) and Inlet declarations instead of Unrouter<T>(routes: ...).
  • The old typed route-data adapter surface from 0.1.x is gone.
  • The adapter no longer exposes the old runtime widget/controller API from the pre-core implementation.

What's New #

Route tree rendering

  • Added RouterView to render the matched route chain in Nocterm apps.
  • Added Outlet for nested terminal layouts backed by child routes.

Route scope and navigation

  • Added route scope helpers such as useRouteParams, useQuery, useLocation, useRouteState<T>, and useFromLocation.
  • Shared guard handling now comes from unrouter_core.

Examples and tests

  • Added a refreshed Nocterm example app with nested docs routes, named profile navigation, history pop, and query/state inspection.
  • Added adapter tests covering nested rendering and wildcard params.

Migration note #

  • Replace Unrouter<T>(routes: ...) with createRouter(routes: [...]). Nocterm routes are now declared with Inlet, not the old typed route-data adapter helpers.

  • Replace typed route-data parsing with direct path trees.

    Before:

    final router = Unrouter<AppRoute>(
      routes: <RouteRecord<AppRoute>>[
        route<HomeRoute>(
          path: '/',
          parse: (_) => const HomeRoute(),
          builder: (_, __) => const HomeView(),
        ),
      ],
    );
    

    After:

    final router = createRouter(
      routes: const [
        Inlet(path: '/', view: HomeView.new),
      ],
    );
    
  • Replace the old runtime root widget with RouterView(router: router).

  • Replace shell-style parent layouts with nested Inlet(children: [...]) plus Outlet() inside the parent component.

  • Replace old scope/controller access with useRouteParams, useQuery, useLocation, useRouteState<T>, and useFromLocation.

Full Changelog #

0.1.0 #

Migration guide: Not required.

Highlights #

Nocterm Unrouter 0.1.0 introduced the first standalone Nocterm adapter for Unrouter, pairing the original typed route-data model with a keyboard-first terminal navigation runtime.

Breaking Changes #

  • None.

What's New #

Initial adapter package

  • Added the initial Nocterm adapter package for unrouter.
  • Inherited the original core Unrouter controller directly and kept the adapter runtime thin.

Examples and tests

  • Added a complete keyboard-first example with shell branches, guards, redirects, loaders, and typed navigation flows.
  • Added functional runtime tests for scope/controller access, navigation behavior, fallback rendering, and lifecycle updates.
  • Added default runtime error handling that renders a fallback error component when onError is not provided.

Migration note #

  • No migration is required for the initial release.
1
likes
160
points
9
downloads

Documentation

API reference

Publisher

verified publishermedz.dev

Weekly Downloads

Declarative nested router for Nocterm apps with guards and nested outlets.

Repository (GitHub)
View/report issues

Topics

#router #navigation #terminal #tui #cli

Funding

Consider supporting this project:

github.com

License

MIT (license)

Dependencies

nocterm, unrouter_core, unstory

More

Packages that depend on nocterm_unrouter