Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(start): expose vinxi router middleware #2893

Merged
merged 7 commits into from
Dec 3, 2024

Conversation

jadedevin13
Copy link
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
@@ -280,6 +294,11 @@ export function defineConfig(
],
})

opts.routerExtras?.forEach((val => {
Copy link
Member

@SeanCassiere SeanCassiere Dec 2, 2024

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({
// ...
})

Copy link
Member

@SeanCassiere SeanCassiere left a comment

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.

Copy link

nx-cloud bot commented Dec 3, 2024

☁️ 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
Copy link

pkg-pr-new bot commented Dec 3, 2024

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
4 of 5 checks passed
timoconnellaus pushed a commit to timoconnellaus/tanstack-router that referenced this pull request Dec 4, 2024
Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
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