Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions e2e/react-router/basic-file-based/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { createFileRoute } from '@tanstack/react-router'

import { Route as rootRouteImport } from './routes/__root'
import { Route as Char45824Char54620Char48124Char44397RouteImport } from './routes/대한민국'
import { Route as PostsRouteImport } from './routes/posts'
import { Route as EditingBRouteImport } from './routes/editing-b'
import { Route as EditingARouteImport } from './routes/editing-a'
Expand Down Expand Up @@ -58,6 +59,12 @@ const groupRoute = groupRouteImport.update({
id: '/(group)',
getParentRoute: () => rootRouteImport,
} as any)
const Char45824Char54620Char48124Char44397Route =
Char45824Char54620Char48124Char44397RouteImport.update({
id: '/대한민국',
path: '/대한민국',
getParentRoute: () => rootRouteImport,
} as any)
const PostsRoute = PostsRouteImport.update({
id: '/posts',
path: '/posts',
Expand Down Expand Up @@ -272,6 +279,7 @@ export interface FileRoutesByFullPath {
'/editing-a': typeof EditingARoute
'/editing-b': typeof EditingBRoute
'/posts': typeof PostsRouteWithChildren
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute
'/inside': typeof groupInsideRoute
'/lazyinside': typeof groupLazyinsideRoute
Expand Down Expand Up @@ -309,6 +317,7 @@ export interface FileRoutesByTo {
'/anchor': typeof AnchorRoute
'/editing-a': typeof EditingARoute
'/editing-b': typeof EditingBRoute
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute
'/inside': typeof groupInsideRoute
'/lazyinside': typeof groupLazyinsideRoute
Expand Down Expand Up @@ -349,6 +358,7 @@ export interface FileRoutesById {
'/editing-a': typeof EditingARoute
'/editing-b': typeof EditingBRoute
'/posts': typeof PostsRouteWithChildren
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/(another-group)/onlyrouteinside': typeof anotherGroupOnlyrouteinsideRoute
'/(group)': typeof groupRouteWithChildren
'/(group)/_layout': typeof groupLayoutRouteWithChildren
Expand Down Expand Up @@ -393,6 +403,7 @@ export interface FileRouteTypes {
| '/editing-a'
| '/editing-b'
| '/posts'
| '/대한민국'
| '/onlyrouteinside'
| '/inside'
| '/lazyinside'
Expand Down Expand Up @@ -430,6 +441,7 @@ export interface FileRouteTypes {
| '/anchor'
| '/editing-a'
| '/editing-b'
| '/대한민국'
| '/onlyrouteinside'
| '/inside'
| '/lazyinside'
Expand Down Expand Up @@ -469,6 +481,7 @@ export interface FileRouteTypes {
| '/editing-a'
| '/editing-b'
| '/posts'
| '/대한민국'
| '/(another-group)/onlyrouteinside'
| '/(group)'
| '/(group)/_layout'
Expand Down Expand Up @@ -513,6 +526,7 @@ export interface RootRouteChildren {
EditingARoute: typeof EditingARoute
EditingBRoute: typeof EditingBRoute
PostsRoute: typeof PostsRouteWithChildren
Char45824Char54620Char48124Char44397Route: typeof Char45824Char54620Char48124Char44397Route
anotherGroupOnlyrouteinsideRoute: typeof anotherGroupOnlyrouteinsideRoute
groupRoute: typeof groupRouteWithChildren
RedirectTargetRoute: typeof RedirectTargetRouteWithChildren
Expand Down Expand Up @@ -543,6 +557,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof groupRouteImport
parentRoute: typeof rootRouteImport
}
'/대한민국': {
id: '/대한민국'
path: '/대한민국'
fullPath: '/대한민국'
preLoaderRoute: typeof Char45824Char54620Char48124Char44397RouteImport
parentRoute: typeof rootRouteImport
}
'/posts': {
id: '/posts'
path: '/posts'
Expand Down Expand Up @@ -928,6 +949,8 @@ const rootRouteChildren: RootRouteChildren = {
EditingARoute: EditingARoute,
EditingBRoute: EditingBRoute,
PostsRoute: PostsRouteWithChildren,
Char45824Char54620Char48124Char44397Route:
Char45824Char54620Char48124Char44397Route,
anotherGroupOnlyrouteinsideRoute: anotherGroupOnlyrouteinsideRoute,
groupRoute: groupRouteWithChildren,
RedirectTargetRoute: RedirectTargetRouteWithChildren,
Expand Down
9 changes: 9 additions & 0 deletions e2e/react-router/basic-file-based/src/routes/대한민국.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/대한민국')({
component: RouteComponent,
})

function RouteComponent() {
return <div>Hello "/대한민국"!</div>
}
10 changes: 10 additions & 0 deletions e2e/react-router/basic-file-based/tests/params.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,13 @@ test.describe('params operations + prefix/suffix', () => {
})
})
})

test.describe('Unicode route rendering', () => {
test('should render non-latin route correctly', async ({ page, baseURL }) => {
await page.goto('/대한민국')

await expect(page.locator('body')).toContainText('Hello "/대한민국"!')

expect(page.url()).toBe(`${baseURL}/%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD`)
})
})
47 changes: 47 additions & 0 deletions e2e/react-start/basic/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {
import { createServerRootRoute } from '@tanstack/react-start/server'

import { Route as rootRouteImport } from './routes/__root'
import { Route as Char45824Char54620Char48124Char44397RouteImport } from './routes/대한민국'
import { Route as UsersRouteImport } from './routes/users'
import { Route as StreamRouteImport } from './routes/stream'
import { Route as ScriptsRouteImport } from './routes/scripts'
Expand Down Expand Up @@ -58,6 +59,12 @@ import { ServerRoute as ApiUsersIdServerRouteImport } from './routes/api/users.$
const FooBarQuxRouteImport = createFileRoute('/foo/$bar/$qux')()
const rootServerRouteImport = createServerRootRoute()

const Char45824Char54620Char48124Char44397Route =
Char45824Char54620Char48124Char44397RouteImport.update({
id: '/대한민국',
path: '/대한민국',
getParentRoute: () => rootRouteImport,
} as any)
const UsersRoute = UsersRouteImport.update({
id: '/users',
path: '/users',
Expand Down Expand Up @@ -262,6 +269,7 @@ export interface FileRoutesByFullPath {
'/scripts': typeof ScriptsRoute
'/stream': typeof StreamRoute
'/users': typeof UsersRouteWithChildren
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
'/posts/$postId': typeof PostsPostIdRoute
Expand Down Expand Up @@ -293,6 +301,7 @@ export interface FileRoutesByTo {
'/links': typeof LinksRoute
'/scripts': typeof ScriptsRoute
'/stream': typeof StreamRoute
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
'/posts/$postId': typeof PostsPostIdRoute
Expand Down Expand Up @@ -328,6 +337,7 @@ export interface FileRoutesById {
'/scripts': typeof ScriptsRoute
'/stream': typeof StreamRoute
'/users': typeof UsersRouteWithChildren
'/대한민국': typeof Char45824Char54620Char48124Char44397Route
'/_layout/_layout-2': typeof LayoutLayout2RouteWithChildren
'/not-found/via-beforeLoad': typeof NotFoundViaBeforeLoadRoute
'/not-found/via-loader': typeof NotFoundViaLoaderRoute
Expand Down Expand Up @@ -367,6 +377,7 @@ export interface FileRouteTypes {
| '/scripts'
| '/stream'
| '/users'
| '/대한민국'
| '/not-found/via-beforeLoad'
| '/not-found/via-loader'
| '/posts/$postId'
Expand Down Expand Up @@ -398,6 +409,7 @@ export interface FileRouteTypes {
| '/links'
| '/scripts'
| '/stream'
| '/대한민국'
| '/not-found/via-beforeLoad'
| '/not-found/via-loader'
| '/posts/$postId'
Expand Down Expand Up @@ -432,6 +444,7 @@ export interface FileRouteTypes {
| '/scripts'
| '/stream'
| '/users'
| '/대한민국'
| '/_layout/_layout-2'
| '/not-found/via-beforeLoad'
| '/not-found/via-loader'
Expand Down Expand Up @@ -471,6 +484,7 @@ export interface RootRouteChildren {
ScriptsRoute: typeof ScriptsRoute
StreamRoute: typeof StreamRoute
UsersRoute: typeof UsersRouteWithChildren
Char45824Char54620Char48124Char44397Route: typeof Char45824Char54620Char48124Char44397Route
RedirectTargetRoute: typeof RedirectTargetRouteWithChildren
RedirectIndexRoute: typeof RedirectIndexRoute
PostsPostIdDeepRoute: typeof PostsPostIdDeepRoute
Expand Down Expand Up @@ -573,6 +587,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof UsersRouteImport
parentRoute: typeof rootRouteImport
}
'/대한민국': {
id: '/대한민국'
path: '/대한민국'
fullPath: '/대한민국'
preLoaderRoute: typeof Char45824Char54620Char48124Char44397RouteImport
parentRoute: typeof rootRouteImport
}
'/_layout/_layout-2': {
id: '/_layout/_layout-2'
path: ''
Expand Down Expand Up @@ -843,6 +864,13 @@ declare module '@tanstack/react-start/server' {
preLoaderRoute: unknown
parentRoute: typeof rootServerRouteImport
}
'/대한민국': {
id: '/대한민국'
path: '/대한민국'
fullPath: '/대한민국'
preLoaderRoute: unknown
parentRoute: typeof rootServerRouteImport
}
'/_layout/_layout-2': {
id: '/_layout/_layout-2'
path: ''
Expand Down Expand Up @@ -1205,6 +1233,23 @@ declare module './routes/users' {
unknown
>
}
declare module './routes/대한민국' {
const createFileRoute: CreateFileRoute<
'/대한민국',
FileRoutesByPath['/대한민국']['parentRoute'],
FileRoutesByPath['/대한민국']['id'],
FileRoutesByPath['/대한민국']['path'],
FileRoutesByPath['/대한민국']['fullPath']
>

const createServerFileRoute: CreateServerFileRoute<
ServerFileRoutesByPath['/대한민국']['parentRoute'],
ServerFileRoutesByPath['/대한민국']['id'],
ServerFileRoutesByPath['/대한민국']['path'],
ServerFileRoutesByPath['/대한민국']['fullPath'],
unknown
>
}
declare module './routes/_layout/_layout-2' {
const createFileRoute: CreateFileRoute<
'/_layout/_layout-2',
Expand Down Expand Up @@ -1818,6 +1863,8 @@ const rootRouteChildren: RootRouteChildren = {
ScriptsRoute: ScriptsRoute,
StreamRoute: StreamRoute,
UsersRoute: UsersRouteWithChildren,
Char45824Char54620Char48124Char44397Route:
Char45824Char54620Char48124Char44397Route,
RedirectTargetRoute: RedirectTargetRouteWithChildren,
RedirectIndexRoute: RedirectIndexRoute,
PostsPostIdDeepRoute: PostsPostIdDeepRoute,
Expand Down
7 changes: 7 additions & 0 deletions e2e/react-start/basic/src/routes/대한민국.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const Route = createFileRoute({
component: RouteComponent,
})

function RouteComponent() {
return <div>Hello "/대한민국"!</div>
}
15 changes: 15 additions & 0 deletions e2e/react-start/basic/tests/params.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { expect, test } from '@playwright/test'

test.beforeEach(async ({ page }) => {
await page.goto('/')
})

test.describe('Unicode route rendering', () => {
test('should render non-latin route correctly', async ({ page, baseURL }) => {
await page.goto('/대한민국')

await expect(page.locator('body')).toContainText('Hello "/대한민국"!')

expect(page.url()).toBe(`${baseURL}/%EB%8C%80%ED%95%9C%EB%AF%BC%EA%B5%AD`)
})
})
2 changes: 1 addition & 1 deletion packages/start-server-core/src/createStartHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function createStartHandler<TRouter extends AnyRouter>({
}

const url = new URL(request.url)
const href = url.href.replace(url.origin, '')
const href = decodeURIComponent(url.href.replace(url.origin, ''))

const APP_BASE = process.env.TSS_APP_BASE || '/'

Expand Down