Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
b50dee0
first pass
birkskyum Mar 19, 2025
6608e6e
calling .value on refs
birkskyum Mar 19, 2025
d8d874a
use template
birkskyum Mar 21, 2025
3215eff
more work on jsx
birkskyum Mar 21, 2025
1f38448
fix routerprovider type test
birkskyum Mar 21, 2025
e009a5f
fix matches type test
birkskyum Mar 21, 2025
074f2b5
fix link type test
birkskyum Mar 21, 2025
88a6951
cleanup additionalProps
birkskyum Mar 21, 2025
0b90bad
align vue to solid/react
birkskyum Mar 21, 2025
a5bbabe
work on routerContext
birkskyum Mar 21, 2025
d9e5be1
use getRouterContext
birkskyum Mar 21, 2025
bedf4de
vue example
birkskyum Mar 21, 2025
ad8ad0f
work on devtools
birkskyum Mar 21, 2025
c7b80d8
less noisy catch boundary
birkskyum Mar 21, 2025
5e297af
working devtools
birkskyum Mar 21, 2025
ee64791
add the devtools panel
birkskyum Mar 21, 2025
f377449
fix loading of posts
birkskyum Mar 21, 2025
6b07240
add vue to router-plugin
birkskyum Mar 21, 2025
9990ed6
add basic-file-based-jsx
birkskyum Mar 21, 2025
cca11da
.value instead of ()
birkskyum Mar 21, 2025
3a26545
remove double dash
birkskyum Mar 21, 2025
86e2886
fix import source
birkskyum Apr 2, 2025
9674059
fix import source
birkskyum Apr 2, 2025
f389bf1
lockfile
birkskyum Jul 10, 2025
7787aef
fix lint issues
birkskyum Jul 10, 2025
74b2af2
add hybrid file based example
birkskyum Jul 10, 2025
c39bd1e
add @testing-library/jest-dom
birkskyum Jul 10, 2025
c250305
lockfile
birkskyum Nov 29, 2025
c515247
make build work again
birkskyum Nov 29, 2025
3c2663a
work on transitioner
birkskyum Nov 29, 2025
fd6c86e
transitioner
birkskyum Nov 29, 2025
3212055
use fragments
birkskyum Nov 29, 2025
2c5065a
fix usematch tests
birkskyum Nov 29, 2025
0ee6cc0
redirect tests
birkskyum Nov 29, 2025
9c1c3cc
error component tests
birkskyum Nov 29, 2025
bb4da7b
get fresh link props on render
birkskyum Nov 29, 2025
533e1b7
fix bug in matchcontext
birkskyum Nov 29, 2025
bbfec57
26 failing
birkskyum Nov 29, 2025
ec2da7d
sync router tests
birkskyum Nov 29, 2025
d3253fb
591 passing
birkskyum Nov 29, 2025
8e7894c
fix store update tests
birkskyum Nov 29, 2025
638d63f
fix catch test
birkskyum Nov 29, 2025
df17290
add missing tests
birkskyum Nov 29, 2025
7994c41
remove soild import
birkskyum Nov 29, 2025
f5eb42e
fix blocker, matches tests
birkskyum Nov 29, 2025
9d3163d
loaders tests
birkskyum Nov 29, 2025
788b148
fix tests
birkskyum Nov 29, 2025
bc66d04
fix basepath
birkskyum Nov 29, 2025
6b9be76
fix some tests
birkskyum Nov 29, 2025
2a43139
work on link
birkskyum Nov 29, 2025
17bd7e2
fix tests
birkskyum Nov 29, 2025
05077d2
fix link lowercase
birkskyum Nov 29, 2025
b2f8730
work on matches
birkskyum Nov 29, 2025
9d4431b
fix link
birkskyum Nov 29, 2025
ed83894
fix catch
birkskyum Nov 29, 2025
60cbce5
fix catch boundary
birkskyum Nov 29, 2025
0669409
basic e2e
birkskyum Nov 29, 2025
83e55e7
view transition
birkskyum Nov 29, 2025
58af8be
enable view trasntision
birkskyum Nov 29, 2025
c6430f7
import vue in file based
birkskyum Nov 29, 2025
8972a80
use new syntax
birkskyum Nov 29, 2025
ac8bc76
use new comp system
birkskyum Nov 29, 2025
cf8e6b3
readme
birkskyum Nov 29, 2025
b01b778
allow __root.component and __root.notFoundComponent
birkskyum Nov 29, 2025
f5adaab
add missing postcss
birkskyum Nov 29, 2025
24d002d
auto wire root
birkskyum Nov 29, 2025
7662301
keep / route in manifest
birkskyum Nov 29, 2025
0c6d88a
fix import order
birkskyum Nov 29, 2025
6398292
store update
birkskyum Nov 30, 2025
fb42ed8
lint
birkskyum Nov 30, 2025
7c5ca09
lint
birkskyum Nov 30, 2025
533ebb4
fix devtools
birkskyum Nov 30, 2025
d07eedc
Revert inferFullPath change that broke layout routes
birkskyum Nov 30, 2025
100212b
Update vue-router-devtools package.json to match react pattern
birkskyum Nov 30, 2025
e442542
Fix inferFullPath to include '/' in FileRoutesByTo for index routes
birkskyum Nov 30, 2025
522e053
fix route generator root link
birkskyum Nov 30, 2025
96403c2
lockfile
birkskyum Nov 30, 2025
e07784a
add jsx basic-file-based e2e
birkskyum Dec 2, 2025
416a40f
inline PostErrorComponent
birkskyum Dec 2, 2025
51f2453
add vue logo counter and vue-tsc
birkskyum Dec 2, 2025
8a07f04
make some component .vue files
birkskyum Dec 2, 2025
6f34695
dd vue linting
birkskyum Dec 2, 2025
2d416ad
allow vue component in types
birkskyum Dec 2, 2025
8bfdf1b
use Vue.Component
birkskyum Dec 2, 2025
c904d8a
use vueComponent wrapper
birkskyum Dec 2, 2025
68dc497
structural matching
birkskyum Dec 2, 2025
e076142
add vue sfc for demonstration
birkskyum Dec 2, 2025
f1ed258
fix e2e
birkskyum Dec 2, 2025
ea61216
reset snapshots
birkskyum Dec 3, 2025
f391f46
dont use .route.ts syntax
birkskyum Dec 3, 2025
517d6d7
clen utils
birkskyum Dec 3, 2025
8591874
update vue examples
birkskyum Dec 3, 2025
64a1c2a
add vue logo
birkskyum Dec 3, 2025
8a9f13e
add eslint file
birkskyum Dec 3, 2025
e3e17c9
adjust examples
birkskyum Dec 3, 2025
2fdbafd
lockfile
birkskyum Dec 3, 2025
7a0cb52
add vue plugin
birkskyum Dec 3, 2025
9d6d5c5
fix e2e
birkskyum Dec 3, 2025
920ae00
remove redundant files
birkskyum Dec 3, 2025
9c221a5
vue-tsc
birkskyum Dec 3, 2025
0ffbcf6
ci: apply automated fixes
autofix-ci[bot] Dec 3, 2025
af74e8e
add to publish
birkskyum Dec 3, 2025
7213983
fix e2e
birkskyum Dec 3, 2025
73fc4dc
ci: apply automated fixes
autofix-ci[bot] Dec 3, 2025
852c887
add vue-router-devtools to publish
birkskyum Dec 3, 2025
94f6955
use workspace for example until first public release
birkskyum Dec 3, 2025
126abb9
cleanup lock
birkskyum Dec 3, 2025
51c15a5
fix e2e
birkskyum Dec 3, 2025
b3eac9e
use workspace until public release
birkskyum Dec 3, 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