Repository navigation
fix(web): make the demo link open the demo - #21
Merged
Merged
Conversation
On the product page, "Try the demo" was relative to the current page, and `npm run dev:product` answered every path with the product page. So /demo/ showed the product page again and each click added another /demo/. - `npm run dev:product` now starts the demo too and serves it at /demo/; the product server no longer falls back to the product page. - The built site uses relative paths, so it also works under joshchen-dev.github.io/raidy/ before a custom domain is set. The demo's "About Raidy" link and Sign out go back to the product page. - Each Vite config and mode keeps its own dependency cache, so the dev servers stop re-optimizing each other's dependencies mid-load. Release v0.0.19.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On the product page, "Try the demo" didn't open the demo locally. Each click added another
/demo/to the URL (/demo/demo/demo/…).The link was relative to the current page, and
npm run dev:producthad no demo to serve. Vite's single-page fallback therefore answered/demo/with the product page again.Fix
npm run dev:productstarts the demo as well (web/scripts/dev-site.mjs) and serves it at/demo/. The product server usesappType: "mpa", so an unknown path is a 404 rather than the product page. The script runsvitedirectly, so stopping it stops both servers.base: "./"for both builds). It now also works underjoshchen-dev.github.io/raidy/before a custom domain is set. The demo's "About Raidy" link and Sign out go back to the product page (productURLinweb/src/lib/paths.ts).node_modules/.vite, so each one invalidated the others' dependencies on start-up. That made first loads fail when they ran together.Release v0.0.19.
Tests
/demo/, then clicks "About Raidy" and checks it returns to/. The CI product server now runs the samedev-sitescript asnpm run dev:product./raidy/prefix. "Try the demo", "About Raidy" and "Open in Raidy" each land on the right page.npm run check,format:check,screenshots,build:pages, and the full Playwright suite (32 passed) all pass locally.