Skip to content

refactor(start): expose vinxi router middleware - #2893

Merged
SeanCassiere merged 7 commits into
TanStack:mainfrom
jadedevin13:patch-1
Dec 3, 2024
Merged

refactor(start): expose vinxi router middleware#2893
SeanCassiere merged 7 commits into
TanStack:mainfrom
jadedevin13:patch-1

Conversation

@jadedevin13

Copy link
Copy Markdown
Contributor

Make use of vinxi strength by being able to use custom routers and middlewares on top of tanstack start and routers. To be used by advanced users only.

Extra routers for custom behavior and middleware for custom middleware
Make use of middlewares and extra custom routers
Comment thread packages/start/src/config/index.ts Outdated
],
})

opts.routerExtras?.forEach((val => {

@SeanCassiere SeanCassiere Dec 2, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not allow adding extra Vinxi routers using this method.

The addRouter method is what I'd go for.

// app.config.ts
import { defineConfig } from '@tanstack/start/config'

export default defineConfig({
// ...
}).addRouter({
// ...
})

@SeanCassiere SeanCassiere left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the Vinxi router stuff in favor of .addRouter.

@nx-cloud

nx-cloud Bot commented Dec 3, 2024

Copy link
Copy Markdown
Contributor

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 1811e3c. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected --targets=test:eslint,test:unit,test:e2e,test:types,test:build,build --parallel=3

Sent with 💌 from NxCloud.

@SeanCassiere SeanCassiere changed the title Be able to extend the start config with custom routers and middlewares refactor(start): expose vinxi router middleware Dec 3, 2024
@pkg-pr-new

pkg-pr-new Bot commented Dec 3, 2024

Copy link
Copy Markdown

Open in Stackblitz

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@2893

@tanstack/create-router

npm i https://pkg.pr.new/@tanstack/create-router@2893

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@2893

@tanstack/react-cross-context

npm i https://pkg.pr.new/@tanstack/react-cross-context@2893

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@2893

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@2893

@tanstack/react-router-with-query

npm i https://pkg.pr.new/@tanstack/react-router-with-query@2893

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@2893

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@2893

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@2893

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@2893

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@2893

@tanstack/start

npm i https://pkg.pr.new/@tanstack/start@2893

@tanstack/start-vite-plugin

npm i https://pkg.pr.new/@tanstack/start-vite-plugin@2893

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@2893

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@2893

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@2893

commit: 1811e3c

@SeanCassiere
SeanCassiere merged commit 201ce5b into TanStack:main Dec 3, 2024
timoconnellaus pushed a commit to timoconnellaus/tanstack-router that referenced this pull request Dec 19, 2024
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants