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

Support SPA through single entry point #16

Open
varevarao opened this issue Oct 15, 2019 · 1 comment
Open

Support SPA through single entry point #16

varevarao opened this issue Oct 15, 2019 · 1 comment

Comments

@varevarao
Copy link
Contributor

Issue

Client side routing breaks in Single Page Applications built on Kitsune.

Expected Behaviour

If a particular link does not have an HTML file associated with it, the 'default' HTML should be returned instead, which will allow the client side router to handle routing based on client logic. This 'default' HTML could either be based on the HTTP status (200.html), or a predefined named file.

More Information

Single Page Applications with client side routing have a requirement of returning the same HTML file irrespective of path, in order to work correctly.

Currently Kitsune applications offer the option to use k-dl (Kit-dynamic link) in order to support such a use case,
For example,

<head k-dl="/path/with/[[variable-slug]]">
<!-- OR -->
<head k-dl="/[[dynamic]]/[[slugs]]/[[everywhere]]">

but this is limited, as the format and number of slugs in a link must be defined at build-time. While this is certainly possible for SPA's, it's a development, and maintenance nightmare for frameworks which are more JS heavy, than HTML (ex. React)

@varevarao varevarao added the enhancement New feature or request label Oct 15, 2019
@varevarao
Copy link
Contributor Author

varevarao commented Oct 15, 2019

surge.sh uses the file named 200.html, if found, as a fallback for any 404 issues to address this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants