@plumile/router 0.1.154 → 0.1.156

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +26 -1
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -14,7 +14,7 @@ points of the repository.
14
14
  - **Data preloading** for faster navigation
15
15
  - **React Suspense** integration for smooth loading states
16
16
  - **Browser history** management with push/replace state
17
- - **Nested routing** support
17
+ - **Nested routing** support for shells, layouts, and leaf pages
18
18
  - **Route-based redirects**
19
19
  - **Active link detection** with exact/partial matching
20
20
 
@@ -44,11 +44,36 @@ This package is ESM-only. If your tooling expects CommonJS, enable ESM support (
44
44
  ## Documentation & Guides
45
45
 
46
46
  - Getting started: [User guide](https://gitlab.com/plumile/js/-/blob/main/docs/index.md)
47
+ - Routing model for agents: [Routing model](https://gitlab.com/plumile/js/-/blob/main/docs/router-routing-model.md)
47
48
  - Relay integration walkthrough: [Relay guide](https://gitlab.com/plumile/js/-/blob/main/docs/router-relay.md)
48
49
  - Examples: [Examples](https://gitlab.com/plumile/js/-/blob/main/packages/router/EXAMPLES.md)
49
50
  - Migration strategies: [Migration guide](https://gitlab.com/plumile/js/-/blob/main/packages/router/MIGRATION.md)
50
51
  - DevTools extension usage: [DevTools documentation](https://gitlab.com/plumile/js/-/blob/main/docs/router-devtools-extension.md)
51
52
 
53
+ ## Routing Model For Agents
54
+
55
+ Nested routes are matched as a flattened leaf path, but the matched parent
56
+ chain is preserved and rendered back into a React tree. Each active route
57
+ segment can prepare data, lazy-load a component, and receive its child segment
58
+ as `children`.
59
+
60
+ Use this mental model when building layouts:
61
+
62
+ ```text
63
+ AppShell
64
+ EntityLayout
65
+ EntityDetailLayout
66
+ EntityTabPage
67
+ ```
68
+
69
+ For a URL such as `/entities/:entityId/:tab`, the entity detail layout should
70
+ own persistent UI like headers and tabs, while the leaf tab route should render
71
+ only the content below those tabs. Parent route components or `render`
72
+ callbacks must render `{children}` for descendants to appear.
73
+
74
+ See [docs/router-routing-model.md](../../docs/router-routing-model.md) for the
75
+ full LLM-oriented guide and common mistakes.
76
+
52
77
  ## Quick Start
53
78
 
54
79
  ### 1. Define Your Routes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumile/router",
3
- "version": "0.1.154",
3
+ "version": "0.1.156",
4
4
  "description": "A modern, type-safe React router with code splitting, data preloading, and Suspense integration",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -125,14 +125,14 @@
125
125
  "tslib": "^2.8.1"
126
126
  },
127
127
  "devDependencies": {
128
- "@plumile/filter-query": "^0.1.154",
128
+ "@plumile/filter-query": "^0.1.156",
129
129
  "react": "19.2.6",
130
130
  "react-dom": "19.2.6",
131
131
  "rimraf": "6.1.3",
132
132
  "typescript": "6.0.3"
133
133
  },
134
134
  "peerDependencies": {
135
- "@plumile/filter-query": "^0.1.153",
135
+ "@plumile/filter-query": "^0.1.154",
136
136
  "react": "^19.2.6",
137
137
  "react-dom": "^19.2.6"
138
138
  },