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(gatsby-plugin-nginx): Spread routes support #895

Merged
merged 4 commits into from
Aug 16, 2021

Conversation

tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented Aug 14, 2021

What's the purpose of this pull request?

This PR adds support to spread routes only.

How it works?

Suppose we have the following taxonomy:

pages
...
│
├── {StoreCollection.slug}
│   └── [...].tsx
...

Currently, any page created will be available at, and only at: /:slug/. If the user enters in /:slug it will receive a 404.
This PR solves this problem by making the route /{StoreCollection.slug}/ also respond at /:slug.

Note that if the user has the following taxonomy:

├── account.tsx
├── {StoreCollection.slug}
│   └── [...].tsx
│   └── index.tsx
...

Both account.tsx and index.tsx will still work because of route precedence.

How to test it?

Make sure no route was lost on either of these stores:

https://github.com/vtex-sites/storecomponents.store/pull/1124
https://github.com/vtex-sites/marinbrasil.store/pull/610
https://github.com/vtex-sites/btglobal.store/pull/789

@netlify
Copy link

netlify bot commented Aug 14, 2021

✔️ Deploy Preview for storeui ready!

🔨 Explore the source changes: f1ec069

🔍 Inspect the deploy log: https://app.netlify.com/sites/storeui/deploys/611a679a71af160007cecc02

😎 Browse the preview: https://deploy-preview-895--storeui.netlify.app

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 14, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit f1ec069:

Sandbox Source
Store UI Typescript Configuration

@tlgimenes tlgimenes changed the title Spread routes support fix(gatsby-plugin-nginx): Spread routes support Aug 16, 2021
@tlgimenes tlgimenes marked this pull request as ready for review August 16, 2021 11:48
@tlgimenes tlgimenes requested a review from a team as a code owner August 16, 2021 11:48
@tlgimenes tlgimenes marked this pull request as draft August 16, 2021 12:22
@tlgimenes tlgimenes marked this pull request as ready for review August 16, 2021 13:48
Copy link
Contributor

@cezar-guimaraes cezar-guimaraes left a comment

Choose a reason for hiding this comment

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

LGTM

@tlgimenes tlgimenes merged commit 6bb2331 into master Aug 16, 2021
@tlgimenes tlgimenes deleted the fix/support-spread-routes branch August 16, 2021 14:06
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