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

feat: add support for optional dynamic route params #1706

Merged
merged 8 commits into from
Sep 7, 2023

Conversation

mbhrznr
Copy link
Contributor

@mbhrznr mbhrznr commented Aug 25, 2023

tackles #1690.

this pr is a first attempt to support optional dynamic routes.
the file name convention is inspired by sveltekit's established convention.

the feature can be tested in the primary fixture by running:

deno task fixture

once started, navigate to /i18n/lang and /i18n/:lang/lang.

@mbhrznr
Copy link
Contributor Author

mbhrznr commented Aug 25, 2023

would add some documentation once we've settled on the general approach.

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

This is fantastic! Going with the way Svelte does it makes a lot of sense. Like this much more then the original proposed [...id]. Found one additional case to account for, but other than that it looks really good and I'm excited to have this in Fresh 👍

src/server/context_test.ts Show resolved Hide resolved
@mbhrznr
Copy link
Contributor Author

mbhrznr commented Sep 5, 2023

would it make sense to refactor www's docs/[...slug].tsx to make use of the new concept?
or would you prefer to have this tackled in another pr?

@marvinhagemeister
Copy link
Collaborator

would it make sense to refactor www's docs/[...slug].tsx to make use of the new concept?
or would you prefer to have this tackled in another pr?

Let's tackle that in another PR

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Awesome, this is great!

Copy link
Collaborator

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

Awesome, this is great!

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