Skip to content

Conversation

@shubham6822
Copy link
Contributor


name: Update HashRouter to BrowserRouter
about: implement BrowserRouter for clean links and better SEO

Description

This PR updates the app’s routing from HashRouter to BrowserRouter for cleaner URLs and improved SEO. Previously, the app used HashRouter, which added a # in the URL, resulting in unclean links that aren’t ideal for search engine indexing. With BrowserRouter, the URLs are now more readable and SEO-friendly.

Related Issue

This PR fixes #52

Changes Made

-Replaced createHashRouter with createBrowserRouter in routes.tsx.
-Ensured all routes remain unchanged while eliminating the hash fragment from URLs.

Testing Performed

  • The code builds successfully
  • all changed files are linted using `npm run format: file

Checklist

  • I have tested these changes locally and they work as expected.
  • I have added/updated tests that prove the effectiveness of these changes.
  • I have updated the documentation to reflect these changes, if applicable.
  • I have followed the project's coding style guidelines.
  • I have addressed the code review feedback from the previous submission, if applicable.

Additional Notes for Reviewers

Now you can see there was no # in link
https://github.com/user-attachments/assets/71a29e8e-71a5-4902-9f10-5226afda27af

@sa-fw-an
Copy link
Member

sa-fw-an commented Mar 17, 2025

This PR does not work on GH pages when deployed. Make sure it works when deployed on your fork and all the links work

@shubham6822
Copy link
Contributor Author

I don't get what you mean; build was prefect, there was no conflicts
You want me to deploy the BrowserRouter branch on GH pages and check all the links are working?

@sa-fw-an
Copy link
Member

I don't get what you mean; build was prefect, there was no conflicts You want me to deploy the BrowserRouter branch on GH pages and check all the links are working?

Yes. Deploy it. Links do not work

@shubham6822
Copy link
Contributor Author

shubham6822 commented Mar 18, 2025

image
getting this error on deployment link is this related to deployment setting ?
cause i change the branch to main in GH pages its also not work
this is deployed link https://shubham6822.github.io/www-v2/

@sa-fw-an
Copy link
Member

image getting this error on deployment link is this related to deployment setting ? cause i change the branch to main in GH pages its also not work this is deployed link https://shubham6822.github.io/www-v2/

I cannot see the depolyed site. I can see is just a white screen

@quozl
Copy link

quozl commented Mar 18, 2025

You have made more than 15 notifications to all Sugar Labs organisation members in a few hours; this is too much. Please work in your own branch until you are ready to make a pull request, thanks.

@sa-fw-an
Copy link
Member

@shubham6822 This is not the way to handle commits. If you want to make a commit, please work on your fork and, whenever you are done, raise a PR. I'll be closing this PR. Whenever you are ready with the implemented task, raise a new PR. If you have any doubts, contact me.

@sa-fw-an sa-fw-an closed this Mar 18, 2025
@shubham6822
Copy link
Contributor Author

Sorry, I don't get it why this thing are not work on GH page deployment
all links are work properly in locally here you can see

Screencast.from.2025-03-18.14-01-24.webm

@sa-fw-an
Copy link
Member

sa-fw-an commented Mar 18, 2025

Sorry, I don't get it why this thing are not work on GH page deployment all links are work properly in locally here you can see

Screencast.from.2025-03-18.14-01-24.webm

That is the trick with BrowserRouter in GH Pages. One way is you could use basename of the repo in Routes.tsx, but that would be just a short-term fix. Find a proper solution. Whenever you are done implementing, raise a new PR.

@shubham6822
Copy link
Contributor Author

Sorry, I don't get it why this thing are not work on GH page deployment all links are work properly in locally here you can see
Screencast.from.2025-03-18.14-01-24.webm

That is the trick with BrowserRouter in GH Pages. One way is you could use basename of the repo in Routes.tsx, but that would be just a short-term fix. Find a proper solution. Whenever you are done implementing, raise a new PR.

ok

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

Successfully merging this pull request may close these issues.

3 participants