Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support deploying on github pages with /docs and /libs generated by sphinx #33

Merged
merged 5 commits into from
Jul 10, 2024

Conversation

azeey
Copy link
Collaborator

@azeey azeey commented Jun 5, 2024

This is in support of gazebosim/docs#441 which is part of gazebosim/docs#412. Based on https://github.com/rafgraph/spa-github-pages, this makes it possible to deploy the frontend (this repo) on Github Pages. This PR also removes the /docs, /libs and /lib routes which are to be handled by the statically generated pages in gazebosim/docs#441. We could remove all the code that handles those routes, but I opted for a smaller PR for now and do the removal in a follow up PR.

To test locally,

npm install
npm run build
npm install http-server
http-server dist

Open the URL printed out by http-server and navigate to /features. This should work. Now refresh the page or go to the /features page by typing the full URL. This is what's fixed by this PR and should also work.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested review from nkoenig and nuclearsandwich June 5, 2024 20:39
azeey added 2 commits June 5, 2024 17:45
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@nkoenig
Copy link
Contributor

nkoenig commented Jun 17, 2024

If I type a URL into the navigation bar, such as localhost:8080/features, I see this appear on the navigation bar:

http://localhost:8080/home/?/&/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/~and~/

and a similar console message.

Does this happen to you?

@nuclearsandwich
Copy link

Does this happen to you?

I saw the same problem with node v20.15 and http-server@14.1.1.
It looks like some kind of error in the 404 handler which is recursively spamming the path.
It's been a long time since I've done javascript debugging. It's possible that rafgraph/spa-github-pages#57 is related.

If debugging this is too much effort, we could plan to keep this on a web host that we control (with OSUOSL) and support the SPA at the web server level.

@azeey
Copy link
Collaborator Author

azeey commented Jun 27, 2024

Can you try setting pathSegmentsToKeep to 0? I set it to 1 in
8d925e8 to test deploying to a GitHub project page. We'll probably set it back to 0 when deploying to gazebosim.org

@nuclearsandwich
Copy link

Can you try setting pathSegmentsToKeep to 0? I set it to 1 in 8d925e8 to test deploying to a GitHub project page. We'll probably set it back to 0 when deploying to gazebosim.org

I gave this a shot and it now works when I click links but if I navigate directly to localhost:8080/features I get the same recursive redirect issue.

@nuclearsandwich
Copy link

From testing on https://addisu.taddese.com/docs/home it seems like this is a problem specifically with local dev using http-server

Copy link

@nuclearsandwich nuclearsandwich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one change I'd like to see but otherwise, I think it's okay to proceed even though we have some issues with local development, I don't see them in the published page.

azeey added 2 commits July 9, 2024 14:35
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey merged commit 0a42941 into main Jul 10, 2024
@azeey azeey deleted the support_github_pages branch July 10, 2024 14:43
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants