-
Notifications
You must be signed in to change notification settings - Fork 4
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 langugage support (and refactor and update a lot of dependencies) #78
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The website became pretty slow (took almost a second after clicking a link) when running start:dev
but was fine when doing a build.
I did however not encounter any hydration errors as you did, even after clicking a lot of links. (on node v20.12.2 and firefox 126.0.1)
It also seems like the language switching button always makes a full page reload which shouldn't be needed but I think that's from before and it's probably hard since it is in Methone.
Hmm, that seems to be true...
Interesting, maybe worth testing in v22 too, since that is what we're running on prod?
Yeah, thought about that too, but downprioritized to get it done. |
I think it's good enough with an error page for when the page doesn't exist in the given language. Unless there are a bunch of hydration errors that is. I guess one could just try by running in docker locally, that shouldn't be too hard. |
There is actually an error page from before, and it should show the new error now too. But it seems to have broken? (I'm assuming due to some dependency update). I have tried a bit to get it to work, but haven't really found the cause. Too tired to continue with it now though. But everything is building with docker as well, and seems to be running great. I even don't get the hyrdation error when running it that way. So the only thing that is in the way now is the error page I suppose, which is not critical if we want to get it up asap. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some quirks like the client-side routing completely shitting itself making going back to the previous page do nothing when you encounter a page that didn't exist in the given language, but that was probably a problem before as well.
I think it's good enough to deploy! (after removing the console.log haha)
src/components/Taitan.js
Outdated
}} | ||
</DataLoader> | ||
export const Taitan = ({ pathname, children, lang }) => { | ||
console.log(pathname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(pathname) |
pliz remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooops
possibly the last???? didnt find more with project search
I think this is related to the hydration issues, (which I have discovered is why the error page is broken). I think I've discovered the exact problem, but haven't found a good solution yet. |
Add support for the changes introduced in taitan#33 and bawang-content#534.
Ie:
lang
instead of by having an/en
in front of the path.Also includes a lot to refactoring and dependency updating since I wanted to use features that only existed in newer versions of libraries, and since that broke stuff I decided to just update and fix everything.
Currently not mergeable since a bug appeared causing all links etc to stop working sometimes, with the following error message:
Uncaught Error: Hydration failed because the initial UI does not match what was rendered on the server.
I also want to add an error page for when a page does not exists in a language.
Everything I've tested seems to have worked so far, but I might have missed something.
Fixes #32 and datasektionen/bawang-content#358