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

Better SPA Routing #249

Open
hlanderdev opened this issue Jan 5, 2023 · 0 comments
Open

Better SPA Routing #249

hlanderdev opened this issue Jan 5, 2023 · 0 comments

Comments

@hlanderdev
Copy link
Contributor

Just recording some key points of discussion on improving routing in Plenti. Expect this issue to be edited as more ideas and points are made.

Currently, Plenti's routing is entirely content-driven, meaning routing is determined by the directory structure and JSON content file names in the content/ folder. These routes should align with Svelte components in the layouts/content/ directory. This routing is done in a single page application (SPA) style, meaning the page does not do a reload when routing. This means that your routes do not actually exist on the server. If you try to go directly to a nested route you would get a 404. Plenti handles this by creating HTML fallbacks, which load in the SPA.

We need a way for the developer to extend the base routing, for example in a case where they want routes that do not require Plenti content but use an external API. There are some key issues to think about when trying to figure out the best way to implement this.

  • Generating HTML fallbacks of the custom routes
  • Cohesion with the content-driven routing
  • Allow for path parameters (i.e. /orders/:id/)

Note: I will update this issue later with more details, as well as some different ideas we had and their drawbacks.

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

No branches or pull requests

1 participant