* fix: do not pass signal into server function
* fix test
* ci: apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* convert AuthKit example to use new SDK
* clean up and fixes
* remove vite dep in start-server-core
* fix(examples): remove unnecessary dotenv import from WorkOS example
Vite automatically loads .env files, so the manual dotenv.config() call is unnecessary and causes a build failure since dotenv is not installed as a dependency.
* fix lint issue
* fix(examples): fix WorkOS AuthKit sign-in and sign-out
- Add parentheses to handleCallbackRoute() in callback route
- Add reloadDocument to logout Links to prevent CORS errors
- Upgrade SDK to v0.5.0 and remove unused dependencies
The sign-out was failing with CORS errors because client-side
navigation via server functions caused fetch to follow the external
redirect to WorkOS. Using reloadDocument forces a full page navigation,
allowing the server to return a proper HTTP redirect.
* fix(examples): use re-exported User type from authkit package
Import User from @workos/authkit-tanstack-react-start instead of
@workos-inc/node to fix tsc --noEmit failure in CI. The authkit
package already re-exports this type to avoid server-only deps
in client code.
* fix(examples): restore authkit-tanstack-react-start dependency
Replace @workos-inc/node with @workos/authkit-tanstack-react-start
in the WorkOS example. The code imports from the authkit package,
not the low-level node SDK.
---------
Co-authored-by: Tanner Linsley <tannerlinsley@gmail.com>
* Updated typo in internationalization-i18n.md
Optional path parameters typescript example had a typo (/abotu not /about).
* ci: apply automated fixes
* Fix typo in internationalization guide
reapply change that was undone by ci: apply automated fixes
---------
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix(router-core): use encodeURIComponent for splat route params
Use encodeURIComponent instead of encodeURI for splat route parameters
to properly encode spaces, plus signs, and other special characters.
This fixes an SSR redirect loop that occurs when:
1. User navigates to a splat route with encoded characters (e.g., %20)
2. TanStack Router decodes params with decodeURIComponent
3. When rebuilding URL, encodeURI doesn't encode spaces/special chars
4. URL mismatch triggers redirect loop (307 redirects)
encodeURIComponent properly encodes these characters, preventing the
mismatch while still preserving forward slashes as path separators.
* update tests to use correct encoding for splat params
* use encodePathParam for splat/catch-all
* perf(router-core): add early return for URL-safe splat values
Add performance optimization that skips the split/map/join operation
when splat values only contain URL-safe characters (alphanumeric,
dash, period, underscore, tilde, exclamation, forward slash).
This avoids unnecessary processing in the hot path for common cases.
* fix(router-core): encode whitespace in encodeNonAscii
Update encodeNonAscii to also encode whitespace characters (spaces, tabs, etc.)
in addition to non-ASCII characters. This fixes SSR redirect loops where:
1. Request URL contains encoded spaces: /path/file%20name.pdf
2. parseLocation decodes pathname: /path/file name.pdf
3. buildLocation calls encodeNonAscii but spaces weren't encoded
4. URL mismatch triggers redirect loop
Now encodeNonAscii properly encodes:
- Whitespace characters (spaces become %20)
- Non-ASCII/unicode characters (including emojis)
Other ASCII special characters (parentheses, brackets, etc.) are preserved
as they are valid in URL paths.
* refactor(router-core): use regex in encodeNonAscii like original
* refactor(router-core): rename encodeNonAscii to encodePathLikeUrl
Rename the function to better reflect its expanded responsibility of
encoding paths the same way new URL() would, including:
- Whitespace characters (spaces → %20, tabs → %09)
- Non-ASCII/Unicode characters (emojis, accented characters)
The old name 'encodeNonAscii' was misleading since the function now
encodes more than just non-ASCII characters.
---------
Co-authored-by: Nico Lynzaad <nlynzaad@zylangroup.com>
Co-authored-by: Nico Lynzaad <44094871+nlynzaad@users.noreply.github.com>