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
{{ message }}
Repository navigation
404 is shown for 1 second before matching client paths ( /blog is one of the example) - #5391
This is my first time open source contribution. I have followed the React Guidelines too.
Issue
When we hit the blogs Link from [Beta] docs, the 404 page is shown for a second and then actual content is got through graphQl Query and is displayed.
Bad UX
It's not naive to say that it creates a bad UX. I myself ( while i was on slow internet ), thought that docs server is down and moved away from website twice.
Solution for Gatsby
I have been working on this and found out that this thing was fixed in Gastby new versions, and there is an implemenation/work around to fix this into previous versions ( that react docs are using). I have managed to fix it and am creating this PR.
Testing
Please do let me know if there are further changes required in this PR. I have tested it and it's working fine. :)
Size Changes%0ADetails%0A%0A## 📦 Next.js Bundle Analysis%0A%0AThis analysis was generated by the next.js bundle analysis action 🤖%0A%0AThis PR introduced no changes to the javascript bundle 🙌%0A%0A
Assad-Ashraf
changed the title
404 is shown for 1 second before matching client paths
404 is shown for 1 second before matching client paths ( /blog is one of the example)
Dec 21, 2022
This doesn't look like a good fix to me. It tries to work around the problem by showing different content on the client on the server (which is not supported by React). What is the real canonical way to solve this?
@gaearon In 2018, Gatsby team fixed this problem in their package and they started supporting SSR stuff in V3. You are using a version lesser then v3. There is no actual way to resolve it other then updating the package itself. I had it updated and i think change of this level will not be accepted in this regard ( can also cause conflicts ). So i came up with this solution that i have implemented. I can also create a PR after updating the version of Gatsby to v3 if you want. ATM this is the only possibility to fix it. @gaearon What do you think about this? And please do mention why it is not a good solution ( just for the sake of getting the ideas you have in your mind )?
@gaearon I have seen there is a route to redirect /blog to /blog/all.html with all the Blogs listing, this can also be done here. Furthermore i have looked into updating the Gatsby to v3, the amount of work on it is drastic and has many conflicts with other packages. I think we should redirect the /blog to /blog/all.html or accept the work around done here because it is also recommended by Gatsby team if there is drastic change in codebase for version upgrade from v2 to v3. etc. What do you think ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Greetings
Hi React Team,
This is my first time open source contribution. I have followed the React Guidelines too.
Issue
When we hit the blogs Link from [Beta] docs, the 404 page is shown for a second and then actual content is got through graphQl Query and is displayed.
Bad UX
It's not naive to say that it creates a bad UX. I myself ( while i was on slow internet ), thought that docs server is down and moved away from website twice.
Solution for Gatsby
I have been working on this and found out that this thing was fixed in Gastby new versions, and there is an implemenation/work around to fix this into previous versions ( that react docs are using). I have managed to fix it and am creating this PR.
Testing
Please do let me know if there are further changes required in this PR. I have tested it and it's working fine. :)