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

New routing system #12

Closed
arctic-hen7 opened this issue Sep 16, 2021 · 1 comment
Closed

New routing system #12

arctic-hen7 opened this issue Sep 16, 2021 · 1 comment
Assignees
Labels
C-enhancement Category: enhancement
Milestone

Comments

@arctic-hen7
Copy link
Member

Perseus currently actually has two routing systems: one for the client (which is based on Sycamore), and an unrelated system on the server. However, the latter is all that's actually required.

The rationale behind this is that we already know everything about every page in the user's app except for the pages rendered with ISR, which are already handled by the old server-side algorithms. By using those, we'll be able to only perform routing on the client-side, and the server can act as an intermediary to static files (with request-time rendering strategies being applied there).

This will achieve much tighter integration between templates and routing, as it requires no specification of any paths like /post/<slug..> whatsoever (again, Perseus isn't an SPA, we already know almost everything about routing at build-time from the templates). This means that the system of template root paths is now far more important, as it defines exactly how routing will work. This will be documented closely for v0.2.0.

The only caveat of this approach that I see right now is no (current) support for dynamic parameters that come before the template root path, like i18n. As with that system, this would have to be implemented at a lower level outside the router. I'll think on possible ways to integrate this into the template-based routing systems.

@arctic-hen7 arctic-hen7 added the C-enhancement Category: enhancement label Sep 16, 2021
@arctic-hen7 arctic-hen7 self-assigned this Sep 16, 2021
@arctic-hen7
Copy link
Member Author

This will also make #2 much easier and should remove many more complex issues with #8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant