You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the translation feature as well as having global build state causes an error when the user navigates directly to the root page (or any valid page) when not including the locale in the path.
#267
Closed
ktsimpso opened this issue
Mar 12, 2023
· 1 comment
· Fixed by #268
This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels.
The author described their issue as follows:
Using the translation feature as well as having global build state causes an error when the user navigates directly to the root page (or any valid page) when not including the locale in the path.
The steps to reproduce this issue are as follows:
See MRE repo and navigate directly to http://localhost:8080 or http://localhost:8080/about notice that the url gets redirected to http://localhost:8080/en-US/ or http://localhost:8080/en-US/about as expected but an error in the browser occurs.
This bug requires both translation and some global build state to reproduce.
This actually raises a much deeper problem as well. Right now, the global state is dependent on the locale, but if a user switches locales, their global state remains unchanged, which could lead to very misleading behavior.
Right now, I think the most logical option is to remove support for localized global state entirely as a breaking change before v0.4.0 goes stable. Short of adding support for a function that amalgamates the global states of different locales which is called whenever global state is thawed as well, I don't think there's any other option. Let me stew on this for a day or so, and then I'll decide how we'll move forward.
* feat: removed localized global state
This completely axes the feature, and returns global state to a
one-per-app system.
BREAKING CHANGE: removed localized global state (global state functions
should no longer take a locale)
* fix: transmitted global state in locale redirection pages
This fixes#267, but only when global state is unlocalized.
* fix: fixed broken examples
* fix: fixed broken demo example
* chore(deps): updated dependencies extensively
Not strictly relevant to this PR, but important nonetheless. Note that
this includes a progression of the `minify-html-onepass` crate version,
which *could* cause problems, so that should be reverted to v0.10.1 if
there are issues.
This issue is reporting a bug in the code of Perseus. Details of the scope will be available in issue labels.
The author described their issue as follows:
The steps to reproduce this issue are as follows:
This bug requires both translation and some global build state to reproduce.
A minimum reproducible example is available at https://github.com/ktsimpso/perseus_bug_report.
Tribble internal data
dHJpYmJsZS1yZXBvcnRlZCxDLWJ1Zw==
The text was updated successfully, but these errors were encountered: