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

fix: router stream injection #3216

Merged
merged 32 commits into from
Jan 24, 2025
Merged

Conversation

tannerlinsley
Copy link
Collaborator

No description provided.

Copy link

nx-cloud bot commented Jan 22, 2025

View your CI Pipeline Execution ↗ for commit 91bf350.

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ❌ Failed 5m 19s View ↗
nx run-many --target=build --exclude=examples/*... ✅ Succeeded 1m 19s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-24 22:21:31 UTC

Copy link

pkg-pr-new bot commented Jan 22, 2025

Open in Stackblitz

More templates

@tanstack/arktype-adapter

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

@tanstack/create-router

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

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/@tanstack/directive-functions-plugin@3216

@tanstack/eslint-plugin-router

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

@tanstack/create-start

npm i https://pkg.pr.new/@tanstack/create-start@3216

@tanstack/history

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

@tanstack/react-cross-context

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

@tanstack/react-router

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

@tanstack/react-router-with-query

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

@tanstack/router-cli

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

@tanstack/router-devtools

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

@tanstack/router-generator

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

@tanstack/router-plugin

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

@tanstack/router-vite-plugin

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

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/@tanstack/server-functions-plugin@3216

@tanstack/start

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

@tanstack/start-api-routes

npm i https://pkg.pr.new/@tanstack/start-api-routes@3216

@tanstack/start-client

npm i https://pkg.pr.new/@tanstack/start-client@3216

@tanstack/start-config

npm i https://pkg.pr.new/@tanstack/start-config@3216

@tanstack/start-plugin

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

@tanstack/start-router-manifest

npm i https://pkg.pr.new/@tanstack/start-router-manifest@3216

@tanstack/start-server

npm i https://pkg.pr.new/@tanstack/start-server@3216

@tanstack/start-server-functions-client

npm i https://pkg.pr.new/@tanstack/start-server-functions-client@3216

@tanstack/start-server-functions-fetcher

npm i https://pkg.pr.new/@tanstack/start-server-functions-fetcher@3216

@tanstack/start-server-functions-handler

npm i https://pkg.pr.new/@tanstack/start-server-functions-handler@3216

@tanstack/start-server-functions-server

npm i https://pkg.pr.new/@tanstack/start-server-functions-server@3216

@tanstack/start-server-functions-ssr

npm i https://pkg.pr.new/@tanstack/start-server-functions-ssr@3216

@tanstack/valibot-adapter

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

@tanstack/virtual-file-routes

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

@tanstack/zod-adapter

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

commit: 91bf350

@schiller-manuel schiller-manuel force-pushed the fix-router-stream-injection branch from 90abc8e to 1163814 Compare January 24, 2025 16:10
@tannerlinsley tannerlinsley marked this pull request as ready for review January 24, 2025 19:48
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.

The removal of a user-configurable serializer/transformer is quite a breaking change for Start.

Should this go forward "as-is", we'll need to update it on the breaking changes tracking list (#2863).

* @link [API Docs](https://tanstack.com/router/latest/docs/framework/react/api/router/RouterOptionsType#transformer-property)
* @link [Guide](https://tanstack.com/router/latest/docs/framework/react/guide/ssr#data-transformers)
*/
transformer?: RouterTransformer
Copy link
Member

Choose a reason for hiding this comment

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

At this current stage, the removal of the user-configurable transformer property would be a breaking change.

If the argument is that since this has the most impact on Start and that it's fine to make these breaking changes, could we perhaps move these Start-specific options under their own key?

Something like this perhaps?

createRouter({
	// ...
	server: { // or framework / start
		serializer: {}
	}
})

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need a different API approach to configure server stuff. Ideally, it does not touch the router at all.


```tsx
import { SuperJSON } from 'superjson'

const router = createRouter({
transformer: SuperJSON,
serializer: SuperJSON,
Copy link
Member

Choose a reason for hiding this comment

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

As far as I can see, at this current time, this action of setting serializer: SuperJSON is not possible since the serializer property (previously named transformer) no longer exists on RouterOptions.

Copy link
Contributor

Choose a reason for hiding this comment

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

the whole non-start SSR story needs a major overhaul. let's do this separately

Copy link
Member

@SeanCassiere SeanCassiere Jan 24, 2025

Choose a reason for hiding this comment

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

👍🏼

Are we committing to removing user-configurable transformer/serializer though?

If not, I think it'd make sense to introduce a bug where we leave the RouterOptions interface "as-is" but disable functionality in code. Then wire it back up in another PR with any renaming that needs to be done.

Copy link
Contributor

Choose a reason for hiding this comment

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

for now it cant be configured. but this functionality should be re-added at some point.

@schiller-manuel schiller-manuel force-pushed the fix-router-stream-injection branch from f22015e to 91bf350 Compare January 24, 2025 22:15
@schiller-manuel schiller-manuel merged commit bb1a14a into main Jan 24, 2025
4 of 5 checks passed
@schiller-manuel schiller-manuel deleted the fix-router-stream-injection branch January 24, 2025 22:47
phryneas added a commit to phryneas/tanstack-router that referenced this pull request Jan 27, 2025
@arolson101
Copy link

the hydrate and dehydrate methods on router were removed - this change breaks @ssrx/plugin-tanstack-router

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.

4 participants