@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timber-js/app",
3
- "version": "0.2.0-alpha.109",
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
- // Route params are always present (the route matched)
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: if some params are only present at deeper route depths,\n` +
89
- ` make them optional in defineSegmentParams().`
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);