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

avoid extra round trip for action redirect? #394

Open
hi-ogawa opened this issue Jun 11, 2024 · 0 comments
Open

avoid extra round trip for action redirect? #394

hi-ogawa opened this issue Jun 11, 2024 · 0 comments

Comments

@hi-ogawa
Copy link
Owner

hi-ogawa commented Jun 11, 2024

Currently, action redirect is propagated back to client, then let it handle client side navigation again. It might be possible to skip this roundtrip by processing redirect internally and return flight render of new path.
(Also check what Next.js does.)

this part is fixed in another way

(see #530)

This also avoids confusing issues when redirecting after resource deletion like in this demo:

https://github.com/hi-ogawa/rsc-on-vite/blob/89303058e0b46799da581b42fdf5797aa52faa8a/remix-tutorial/src/routes/_action.ts#L13-L18

  // TODO
  // action response stream renders `src/routes/contacts/[contactId]/page.tsx`
  // but contact doesn't exists anymore and server component throws,
  // which makes this redirect error to not caught by client
  // when users don't have custom error page
  throw redirect("/");
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

No branches or pull requests

1 participant