Skip to content

feat: handle region: prefix in local server #164

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

Merged
merged 3 commits into from
Apr 3, 2024
Merged

Conversation

eduardoboucas
Copy link
Member

Which problem is this pull request solving?

When using the new experimentalRegion property in a deploy-scoped store in conjunction with edgeURL, the client will send the region in the URL path with a region: prefix. This PR makes the local server understand that and point requests to the right path on disk.

@eduardoboucas eduardoboucas requested a review from a team as a code owner April 3, 2024 08:56
@github-actions github-actions bot added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Apr 3, 2024
Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for blobs-js ready!

Name Link
🔨 Latest commit bafca5e
🔍 Latest deploy log https://app.netlify.com/sites/blobs-js/deploys/660d215b56cf5d0008d2575f
😎 Deploy Preview https://deploy-preview-164--blobs-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

let parts = url.pathname.split('/').slice(1)

if (parts[0].startsWith(REGION_PREFIX)) {
parts = parts.slice(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

we're discarding the region parameter, which means that in local dev, stores with different experimentalRegion parameters all share the same data. Is that exepcted?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think that's fine for now. We will likely need to rethink the whole namespacing we use locally once we make region selection a customer-facing thing, but I think just ignoring regions for now is an okay first step.

Co-authored-by: Simon Knott <[email protected]>
@eduardoboucas eduardoboucas merged commit fe7d899 into main Apr 3, 2024
9 checks passed
@eduardoboucas eduardoboucas deleted the feat/server-region branch April 3, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants