Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
be45562
first pass
birkskyum Mar 19, 2025
02c1c7e
calling .value on refs
birkskyum Mar 19, 2025
3cc7f04
use template
birkskyum Mar 21, 2025
e91cd1a
more work on jsx
birkskyum Mar 21, 2025
766dbc6
fix routerprovider type test
birkskyum Mar 21, 2025
3cafedb
fix matches type test
birkskyum Mar 21, 2025
e04c351
fix link type test
birkskyum Mar 21, 2025
4b3188c
cleanup additionalProps
birkskyum Mar 21, 2025
e2f113d
align vue to solid/react
birkskyum Mar 21, 2025
30ec806
work on routerContext
birkskyum Mar 21, 2025
4e26469
use getRouterContext
birkskyum Mar 21, 2025
c73df72
vue example
birkskyum Mar 21, 2025
e7cbda7
work on devtools
birkskyum Mar 21, 2025
7633973
less noisy catch boundary
birkskyum Mar 21, 2025
5a13afb
working devtools
birkskyum Mar 21, 2025
87d68ed
add the devtools panel
birkskyum Mar 21, 2025
bb2ae24
fix loading of posts
birkskyum Mar 21, 2025
0c7ddc9
add vue to router-plugin
birkskyum Mar 21, 2025
000532f
add basic-file-based-jsx
birkskyum Mar 21, 2025
3a98d8c
.value instead of ()
birkskyum Mar 21, 2025
61df0cc
remove double dash
birkskyum Mar 21, 2025
f64e38b
fix import source
birkskyum Apr 2, 2025
fd4baec
fix import source
birkskyum Apr 2, 2025
45cb4a2
lockfile
birkskyum Jul 10, 2025
d4c72b9
fix lint issues
birkskyum Jul 10, 2025
2c05047
add hybrid file based example
birkskyum Jul 10, 2025
f3a98a4
add @testing-library/jest-dom
birkskyum Jul 10, 2025
7e2c502
lockfile
birkskyum Nov 29, 2025
52fccc9
make build work again
birkskyum Nov 29, 2025
cb30f3a
work on transitioner
birkskyum Nov 29, 2025
82b0825
transitioner
birkskyum Nov 29, 2025
9d8eed9
use fragments
birkskyum Nov 29, 2025
efbd236
fix usematch tests
birkskyum Nov 29, 2025
f4153f5
redirect tests
birkskyum Nov 29, 2025
9de503b
error component tests
birkskyum Nov 29, 2025
9948326
get fresh link props on render
birkskyum Nov 29, 2025
5d5fe5e
fix bug in matchcontext
birkskyum Nov 29, 2025
61634b1
26 failing
birkskyum Nov 29, 2025
137ba04
sync router tests
birkskyum Nov 29, 2025
b785846
591 passing
birkskyum Nov 29, 2025
6425a66
fix store update tests
birkskyum Nov 29, 2025
5e450f9
fix catch test
birkskyum Nov 29, 2025
f0c8deb
add missing tests
birkskyum Nov 29, 2025
cb03bb1
remove soild import
birkskyum Nov 29, 2025
ae6c73e
fix blocker, matches tests
birkskyum Nov 29, 2025
3c6953e
loaders tests
birkskyum Nov 29, 2025
62461fe
fix tests
birkskyum Nov 29, 2025
b46933e
fix basepath
birkskyum Nov 29, 2025
62e6f87
fix some tests
birkskyum Nov 29, 2025
d9a8202
work on link
birkskyum Nov 29, 2025
aebdb28
fix tests
birkskyum Nov 29, 2025
f33946e
fix link lowercase
birkskyum Nov 29, 2025
1beefdf
work on matches
birkskyum Nov 29, 2025
d384a0b
fix link
birkskyum Nov 29, 2025
eb540f1
fix catch
birkskyum Nov 29, 2025
ae0221b
fix catch boundary
birkskyum Nov 29, 2025
eaac302
basic e2e
birkskyum Nov 29, 2025
4074a68
view transition
birkskyum Nov 29, 2025
f8f1cf7
enable view trasntision
birkskyum Nov 29, 2025
c1cdc3a
import vue in file based
birkskyum Nov 29, 2025
2b87b7e
use new syntax
birkskyum Nov 29, 2025
c8f693d
use new comp system
birkskyum Nov 29, 2025
a45c62f
readme
birkskyum Nov 29, 2025
9b0a045
allow __root.component and __root.notFoundComponent
birkskyum Nov 29, 2025
e53e924
add missing postcss
birkskyum Nov 29, 2025
fd6c220
auto wire root
birkskyum Nov 29, 2025
2f4b902
keep / route in manifest
birkskyum Nov 29, 2025
1dcfa0f
fix import order
birkskyum Nov 29, 2025
067f240
store update
birkskyum Nov 30, 2025
a7bf2e7
lint
birkskyum Nov 30, 2025
d07465d
lint
birkskyum Nov 30, 2025
a69222a
fix devtools
birkskyum Nov 30, 2025
f5d971f
Revert inferFullPath change that broke layout routes
birkskyum Nov 30, 2025
63e0f8a
Update vue-router-devtools package.json to match react pattern
birkskyum Nov 30, 2025
af528bc
Fix inferFullPath to include '/' in FileRoutesByTo for index routes
birkskyum Nov 30, 2025
2d63143
fix route generator root link
birkskyum Nov 30, 2025
1e75fdb
lockfile
birkskyum Nov 30, 2025
b005282
add jsx basic-file-based e2e
birkskyum Dec 2, 2025
3c44c46
inline PostErrorComponent
birkskyum Dec 2, 2025
9bf5227
add vue logo counter and vue-tsc
birkskyum Dec 2, 2025
af0f08c
make some component .vue files
birkskyum Dec 2, 2025
3315ce5
dd vue linting
birkskyum Dec 2, 2025
a45db99
allow vue component in types
birkskyum Dec 2, 2025
4d5147e
use Vue.Component
birkskyum Dec 2, 2025
67aa203
use vueComponent wrapper
birkskyum Dec 2, 2025
2326b13
structural matching
birkskyum Dec 2, 2025
9f10945
add vue sfc for demonstration
birkskyum Dec 2, 2025
848b0c0
fix e2e
birkskyum Dec 2, 2025
353d670
reset snapshots
birkskyum Dec 3, 2025
912d68b
dont use .route.ts syntax
birkskyum Dec 3, 2025
76e598b
clen utils
birkskyum Dec 3, 2025
4e61d50
update vue examples
birkskyum Dec 3, 2025
023f05c
add vue logo
birkskyum Dec 3, 2025
4ad1d6b
add eslint file
birkskyum Dec 3, 2025
467f678
adjust examples
birkskyum Dec 3, 2025
99a0561
lockfile
birkskyum Dec 3, 2025
9a564be
add vue plugin
birkskyum Dec 3, 2025
6d54d21
fix e2e
birkskyum Dec 3, 2025
1050284
remove redundant files
birkskyum Dec 3, 2025
3c022a5
vue-tsc
birkskyum Dec 3, 2025
8de98b7
ci: apply automated fixes
autofix-ci[bot] Dec 3, 2025
2cf1238
add to publish
birkskyum Dec 3, 2025
0afd238
fix e2e
birkskyum Dec 3, 2025
5a38b9e
ci: apply automated fixes
autofix-ci[bot] Dec 3, 2025
467ea37
add vue-router-devtools to publish
birkskyum Dec 3, 2025
0a352ff
use workspace for example until first public release
birkskyum Dec 3, 2025
932c65f
cleanup lock
birkskyum Dec 3, 2025
dc73cb5
fix e2e
birkskyum Dec 3, 2025
722e85b
use workspace until public release
birkskyum Dec 3, 2025
08977e3
vue-router-ssr-query
birkskyum Dec 6, 2025
2eb4154
update readme
birkskyum Dec 6, 2025
b97d273
lockfile
birkskyum Dec 6, 2025
c21a82b
reomve tsconfig.build.json
birkskyum Dec 6, 2025
a878fce
ci: apply automated fixes
autofix-ci[bot] Dec 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
49 changes: 49 additions & 0 deletions e2e/vue-router/basic-file-based-jsx/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import js from '@eslint/js'
import typescript from '@typescript-eslint/eslint-plugin'
import typescriptParser from '@typescript-eslint/parser'
import vue from 'eslint-plugin-vue'
import vueParser from 'vue-eslint-parser'

export default [
js.configs.recommended,
...vue.configs['flat/recommended'],
{
files: ['**/*.{js,jsx,ts,tsx,vue}'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: typescriptParser,
ecmaVersion: 'latest',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
'@typescript-eslint': typescript,
vue,
},
rules: {
// Vue specific rules
'vue/multi-word-component-names': 'off',
'vue/no-unused-vars': 'error',

// TypeScript rules
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-explicit-any': 'warn',

// General rules
'no-unused-vars': 'off', // Let TypeScript handle this
},
},
{
files: ['**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: typescriptParser,
},
},
},
]
11 changes: 11 additions & 0 deletions e2e/vue-router/basic-file-based-jsx/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions e2e/vue-router/basic-file-based-jsx/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "tanstack-router-e2e-vue-basic-file-based-jsx",
"private": true,
"type": "module",
"scripts": {
"dev": "vite --port 3000",
"dev:e2e": "vite",
"build": "vite build && vue-tsc --noEmit",
"preview": "vite preview",
"start": "vite",
"test:e2e": "rm -rf port*.txt; playwright test --project=chromium"
},
"dependencies": {
"@tailwindcss/postcss": "^4.1.15",
"@tanstack/router-plugin": "workspace:^",
"@tanstack/vue-router": "workspace:^",
"@tanstack/vue-router-devtools": "workspace:^",
"@tanstack/zod-adapter": "workspace:^",
"postcss": "^8.5.1",
"redaxios": "^0.5.1",
"tailwindcss": "^4.1.15",
"vue": "^3.5.16",
"zod": "^3.24.2"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@playwright/test": "^1.50.1",
"@tanstack/router-e2e-utils": "workspace:^",
"@typescript-eslint/eslint-plugin": "^8.44.1",
"@typescript-eslint/parser": "^8.44.1",
"@vitejs/plugin-vue": "^5.2.3",
"@vitejs/plugin-vue-jsx": "^4.1.2",
"eslint-plugin-vue": "^9.33.0",
"typescript": "~5.8.3",
"vite": "^7.1.7",
"vue-eslint-parser": "^9.4.3",
"vue-tsc": "^3.1.5"
}
}
41 changes: 41 additions & 0 deletions e2e/vue-router/basic-file-based-jsx/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineConfig, devices } from '@playwright/test'
import {
getDummyServerPort,
getTestServerPort,
} from '@tanstack/router-e2e-utils'
import packageJson from './package.json' with { type: 'json' }

const PORT = await getTestServerPort(packageJson.name)
const EXTERNAL_PORT = await getDummyServerPort(packageJson.name)
const baseURL = `http://localhost:${PORT}`
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
workers: 1,

reporter: [['line']],

globalSetup: './tests/setup/global.setup.ts',
globalTeardown: './tests/setup/global.teardown.ts',

use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL,
},

webServer: {
command: `VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm build && VITE_NODE_ENV="test" VITE_EXTERNAL_PORT=${EXTERNAL_PORT} VITE_SERVER_PORT=${PORT} pnpm preview --port ${PORT}`,
url: baseURL,
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
},

projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})
5 changes: 5 additions & 0 deletions e2e/vue-router/basic-file-based-jsx/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default {
plugins: {
'@tailwindcss/postcss': {},
},
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ref, defineComponent } from 'vue'
import { useBlocker, useNavigate } from '@tanstack/vue-router'

export const EditingAComponent = defineComponent({
setup() {
const navigate = useNavigate()
const input = ref('')

const blocker = useBlocker({
shouldBlockFn: ({ next }) => {
if (next.fullPath === '/editing-b' && input.value.length > 0) {
return true
}
return false
},
withResolver: true,
})

return () => (
<div>
<h1>Editing A</h1>
<label>
Enter your name:
<input
name="input"
value={input.value}
onInput={(e) =>
(input.value = (e.target as HTMLInputElement).value)
}
/>
</label>
<button onClick={() => navigate({ to: '/editing-b' })}>
Go to next step
</button>
{blocker.value.status === 'blocked' && (
<button onClick={() => blocker.value.proceed?.()}>Proceed</button>
)}
</div>
)
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { ref, toValue, defineComponent } from 'vue'
import { useBlocker, useNavigate } from '@tanstack/vue-router'

export const EditingBComponent = defineComponent({
setup() {
const navigate = useNavigate()
const input = ref('')

const blocker = useBlocker({
shouldBlockFn: () => !!toValue(input),
withResolver: true,
})

return () => (
<div>
<h1>Editing B</h1>
<label>
Enter your name:
<input
name="input"
value={input.value}
onInput={(e) =>
(input.value = (e.target as HTMLInputElement).value)
}
/>
</label>
<button onClick={() => navigate({ to: '/editing-a' })}>Go back</button>
{blocker.value.status === 'blocked' && (
<button onClick={() => blocker.value.proceed?.()}>Proceed</button>
)}
</div>
)
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
import { Link } from '@tanstack/vue-router'
</script>

<template>
<div>
<p>This is the notFoundComponent configured on root route</p>
<Link to="/">Start Over</Link>
</div>
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { ref, onMounted, defineComponent } from 'vue'
import { useSearch, useNavigate } from '@tanstack/vue-router'

export const NotRemountDepsComponent = defineComponent({
setup() {
// Component-scoped ref - will be recreated on component remount
const mounts = ref(0)
const search = useSearch({ from: '/notRemountDeps' })
const navigate = useNavigate()

onMounted(() => {
mounts.value++
})

return () => (
<div class="p-2">
<button
onClick={() =>
navigate({
to: '/notRemountDeps',
search: {
searchParam: Math.random().toString(36).substring(2, 8),
},
})
}
>
Regenerate search param
</button>

<div>Search: {search.value.searchParam}</div>
<div data-testid="component-mounts">
Page component mounts: {mounts.value}
</div>
</div>
)
},
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<script setup lang="ts">
import { ErrorComponent } from '@tanstack/vue-router'
import type { ErrorComponentProps } from '@tanstack/vue-router'
defineProps<ErrorComponentProps>()
</script>

<template>
<ErrorComponent :error="error" />
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { ref, onMounted, defineComponent } from 'vue'
import { useSearch, useNavigate } from '@tanstack/vue-router'

// Module-scoped ref to persist across component remounts
const mounts = ref(0)

export const RemountDepsComponent = defineComponent({
setup() {
const search = useSearch({ from: '/remountDeps' })
const navigate = useNavigate()

onMounted(() => {
mounts.value++
})

return () => (
<div class="p-2">
<button
onClick={() =>
navigate({
to: '/remountDeps',
search: {
searchParam: Math.random().toString(36).substring(2, 8),
},
})
}
>
Regenerate search param
</button>

<div>Search: {search.value.searchParam}</div>
<div data-testid="component-mounts">
Page component mounts: {mounts.value}
</div>
</div>
)
},
})
Loading
Loading