-
-
Notifications
You must be signed in to change notification settings - Fork 704
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
Chained Server Fn Syntax, ServerFn Middleware #2513
Conversation
Let's goooo 🚀 |
path: babel.NodePath<t.CallExpression>, | ||
opts: ParseAstOptions, | ||
) { | ||
// const firstArg = path.node.arguments[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup
packages/start/src/config/index.ts
Outdated
{ | ||
name: 'custom-hot-update-client', | ||
handleHotUpdate(ctx) { | ||
console.log('server hot', ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
…uter into server-fn-middleware
loader: ({ params: { _splat } }) => getDocument(_splat!), | ||
loader: ({ params: { _splat } }) => | ||
getDocument({ | ||
data: _splat!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the _splat
param needs to be asserted here as NOT undefined?
Unless, is the splat route also expected to be matched when a not is in the "notFound"
status? This wouldn't make sense to me, since if we hit a "notFound"
the router should grab the nearest notFoundComponent
by default (or the root route's notFoundComponent
based on the router's setting).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could probably ensure it's at least a string, even if it's empty
# Conflicts: # docs/framework/react/start/getting-started.md # examples/react/search-validator-adapters/package.json # packages/arktype-adapter/package.json # packages/react-router/src/fileRoute.ts # packages/react-router/src/route.ts # packages/start-vite-plugin/package.json # packages/start/src/config/index.ts # packages/valibot-adapter/package.json # packages/zod-adapter/package.json # pnpm-lock.yaml
…uter into server-fn-middleware
except the search-validator-adapters example, everything else builds fine
This PR included a new Middleware Guide page for Start. It is visible as a link in Server Functions page but not in the main contents menu. Should it also be visible there? |
Fixed. |
Great, thanks! |
This PR silently changes the package name of adapters between two patch versions ( -import { zodSearchValidator } from '@tanstack/router-zod-adapter';
+import { zodValidator } from '@tanstack/zod-adapter'; After bumping dependencies, the types for Why isn't something like this marked as a breaking change, but just thrown into a huge PR with no description? The damage is done, but could you at least:
|
@thebuilder |
* init * Refactor createServerFn, add createServerMiddleware * checkpoint * checkpoint * checkpoint * update docs and examples to use new server function syntax * fix: compilers, and update examples * refactor: added merging of context and some type tests * feat: createServerMiddleware context and input validation types * checkpoint * Server function middleware * checkpoint * checkpoint * fix: return types from handlers, merging inputs etc * checkpoint * checkpoint * checkpoint * checkpoint * feat: add types for client context and server context * fix: merge server context * checkpoint * docs * fix: better compilation of server functions * fix: deferred example * Html, Head, Body... be GONE! * fix: API Routes * checkpoint * fix: support optional input types * checkpoint * fix lossy merge * ci: fix build * ci: fix start examples * checkpoint * feat: add client after context types * test: add type tests * checkpoint * checkpoint * Remove now-unnecessary data type headers * checkpoint * fix e2e test * fix up merge conflicts * ci: apply automated fixes * fix: a few tests and a runtime bug * chore: pnpm dedupe except the search-validator-adapters example, everything else builds fine * fix merge conflict --------- Co-authored-by: chorobin <chrishorobin@hotmail.com> Co-authored-by: Manuel Schiller <manuel.schiller@caligano.de> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: SeanCassiere <33615041+SeanCassiere@users.noreply.github.com>
No description provided.