-
Notifications
You must be signed in to change notification settings - Fork 324
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
Support redirects #89
Comments
@jplhomer what's our thinking on how redirects are set up by the developer? |
@igrigorik I'm kicking around a few options: Option 1.
|
Is there a declarative path that Oxygen could pick up directly? E.g. next allows you to enumerate an array of redirect rules, which Oxygen could consume directly and build out a routing map.. or we could take those roles and push them into CF workers for faster routing, etc. |
Update: react-router is dropping I think we lean into our |
Question: How would it behave in SPA takeover? Should the developer take care of that and just rely on Or maybe this is a no-issue, I don't know yet how this plays with RSC 🤔 |
@frandiox I just wondered the same... but I think we're good:
The only outstanding questions I have:
|
I think this is the main problem I thought of. And since 3xx responses are opaque to fetch, we can't even know that there was a redirect (we would just receive the page B props/components when we asked for page A). Perhaps we could include the requested page parameter in a response header? Say we request pageA but the server redirects to pageB and browser fetch makes that request internally automatically. When pageB is handled, we return -- edit: or perhaps the
As far as I understand, fetch handles redirects internally unless you provide |
Thoughts on https://github.com/Shopify/hydrogen/pull/172 (using option 2)?
The problem is that fetch would get an HTML response from |
The Admin API currently provides a Some merchants may have dozens of URL redirects already set up for their liquid shop. Then, when migrating to Hydrogen, it would be a pain to have to manually recreate these all. Some initial questions:
For reference, screenshot below of the URL Redirects settings page in admin: |
No, since Hydrogen talks to the Storefront API and not the Admin API. If the Storefront API exposes redirect data (similar to what we're exploring for nav/menu data), then it would be a possibility. Since Hydrogen is developer-focused, devs should be able to enter and program their own redirects. We could provide some utilities in e.g. |
Closing in favor of the new routing API and client router we've built https://github.com/Shopify/hydrogen/discussions/569 |
…w-27ha Add Oxygen deployment workflow file
Just need to make sure this works on server and client.
The text was updated successfully, but these errors were encountered: