@timber-js/app 0.2.0-alpha.109 → 0.2.0-alpha.110
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.
- package/dist/_chunks/{actions-n9qTlpmY.js → actions-D6gyxlGQ.js} +2 -2
- package/dist/_chunks/{actions-n9qTlpmY.js.map → actions-D6gyxlGQ.js.map} +1 -1
- package/dist/_chunks/{define-Btmz9B20.js → define-BflNsrwD.js} +2 -1
- package/dist/_chunks/{define-Btmz9B20.js.map → define-BflNsrwD.js.map} +1 -1
- package/dist/client/index.js +1 -1
- package/dist/segment-params/define.d.ts.map +1 -1
- package/dist/segment-params/index.js +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/internal.js +2 -2
- package/dist/server/internal.js.map +1 -1
- package/package.json +1 -1
- package/src/segment-params/define.ts +5 -1
- package/src/server/param-coercion.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timber-js/app",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.110",
|
|
4
4
|
"description": "Vite-native React framework built for Servers and Serverless Platforms — correct HTTP semantics, real status codes, pages that work without JavaScript",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare-workers",
|
|
@@ -257,7 +257,11 @@ export function defineSegmentParams<C extends Record<string, ParamField>>(
|
|
|
257
257
|
|
|
258
258
|
for (const [key, codec] of Object.entries(resolvedCodecs)) {
|
|
259
259
|
const rawValue = raw[key];
|
|
260
|
-
//
|
|
260
|
+
// Skip params not present in the URL at this route depth.
|
|
261
|
+
// This supports TIM-834 inheritance: a parent params.ts can declare
|
|
262
|
+
// codecs for descendant segments. At shallower depths those params
|
|
263
|
+
// don't exist yet — skip them instead of passing undefined to the codec.
|
|
264
|
+
if (rawValue === undefined) continue;
|
|
261
265
|
result[key] = codec.parse(rawValue);
|
|
262
266
|
}
|
|
263
267
|
|
|
@@ -85,8 +85,8 @@ export async function coerceSegmentParams(match: RouteMatch): Promise<void> {
|
|
|
85
85
|
` Error: ${message}\n` +
|
|
86
86
|
` Available raw params: { ${rawKeys} }\n` +
|
|
87
87
|
` Params file: ${segment.params}\n` +
|
|
88
|
-
` Hint:
|
|
89
|
-
`
|
|
88
|
+
` Hint: this usually means a codec threw for the raw URL value.\n` +
|
|
89
|
+
` Check that the regex/schema accepts the actual path segment string.`
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
throw new ParamCoercionError(message);
|