-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
feat(i18n): apply specific routing logic only to pages #9091
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ematipico
force-pushed
the
feat/apply-routing-to-pages-only
branch
from
November 13, 2023 20:23
c79944e
to
56d611f
Compare
🦋 Changeset detectedLatest commit: 5083580 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
github-actions
bot
added
pkg: astro
Related to the core `astro` package (scope)
pr: docs
A PR that includes documentation for review
labels
Nov 13, 2023
matthewp
reviewed
Nov 13, 2023
ematipico
force-pushed
the
feat/apply-routing-to-pages-only
branch
2 times, most recently
from
November 15, 2023 16:35
86a3e29
to
eb2789d
Compare
ematipico
force-pushed
the
feat/apply-routing-to-pages-only
branch
from
November 15, 2023 16:47
eb2789d
to
5083580
Compare
matthewp
approved these changes
Nov 15, 2023
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.
lgtm!
peng
added a commit
to peng/astro
that referenced
this pull request
Nov 17, 2023
* main: feat(i18n): add `Astro.currentLocale` (withastro#9101) [ci] release (withastro#9107) Add compatibility with cloudflare node (withastro#8925) [ci] format Cancel response stream when connection closes (withastro#9071) [ci] format feat(i18n): apply specific routing logic only to pages (withastro#9091) feat(dev-overlay): Hide plugins into a separate menu when there's too many enabled (withastro#9102) [ci] format Support Svelte 5 (experimental) (withastro#9098) [ci] release (withastro#9078) [ci] format Refactor shikiji syntax highlighting code (withastro#9083) [ci] format fix: Query params trigger the trailingSlash error in preview mode (withastro#9045) fix(assets): bundling regression for specific config on non-Node runtimes (withastro#9087)
natemoo-re
pushed a commit
that referenced
this pull request
Nov 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
pkg: astro
Related to the core `astro` package (scope)
pr: docs
A PR that includes documentation for review
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This PR addresses this new part of the RFC:withastro/roadmap@c93015d
There have been reports where:
After chatting with Matthew, we were more convinced that i18n routing should only work on pages. This PR updates the logic by.
I created some new logic inside the
Pipeline
, called hooks. Essentially, I created a generic way to run functions before before rendering a route. The reason why I created this generic logic is because I wanted to have a generic function inside my middleware, and then share the same logic among pipelines (dev, SSR and SSG).This worked out pretty well and I am satisfied with the result.
Testing
Added:
Docs
N/A but I will make a PR to reflect the change in logic