mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
* refactor(start-plugin-core): derive server-fn ids from the stable key, with 22-character defaults `serverFns.generateFunctionId` now receives the server function's stable name (`greetUser`) as `functionName` instead of the generated handler name (`greetUser_createServerFn_handler`). Repeats of the same variable name in one file get `#1`, `#2`, ... Default production ids are the first 22 base64url characters of the SHA256 of `<file>#<stable key>` instead of the full 64-character hex digest. Split out of #8817, which derives ids the same way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(start-plugin-core): keep generateFunctionId's handler-name input, reject custom ids that aren't one URL path segment Follows #8817's current id contract: - `generateFunctionId` receives the generated handler name again (`greetUser_createServerFn_handler`, `_1`, `_2`… for repeats), with characters outside `[A-Za-z0-9_$]` as `_`. The handler export keeps its name. - The default id stays 22 base64url characters of `sha256("<root-relative file>#<variable name>")`, `#n` for repeats. - A custom id outside RFC 3986's unreserved characters and `$` (or `.`, `..`, empty) fails the build, naming the file, the function and the id. - The e2e id maps return to main's keys. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(start-plugin-core): a repeated server function name loses leading and doubled underscores The generator's `functionName` for a repeated name goes through the old increment rule, which strips leading underscores and collapses runs of underscores (a second `_x` gets `x_createServerFn_handler_1`). Say so, and pin it with `_x` twice and `café` then `caf_`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(start-plugin-core): names that become equal after the `_` replacement get suffixes too `café` and `caf_` both give `caf__createServerFn_handler`, so the later one gets `caf_createServerFn_handler_1`, like a repeated variable name. Describe the replacement first, then the suffix rule for any resulting duplicate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * refactor(start-plugin-core): keep main's server-fn ids; refuse custom ids that never worked over HTTP #8817 now prints main's default ids and passes main's functionName to generateFunctionId, so this reverts the shorter default ids, the generator-name split and the empty-id failure. What stays is #8817's custom-id check: an id the URL never carries whole fails the build, one with other characters outside the unreserved set and $ builds with a deprecation warning, and the resolver manifest escapes a `'` in an id. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
History
|
|
|---|---|---|
| .. | ||
| router | ||
| start | ||
| AGENTS.md | ||