Repository navigation
Upgrade dependencies and route pages with react-router - #61
Merged
Merged
Conversation
Bump all dependencies to their latest versions, including TypeScript 7, Vite 8, Vitest 5 and Biome 2.5. TypeScript 7 no longer accepts the `Node` module resolution, so it is switched to `bundler`, and the Biome configuration is migrated to the new schema. Replace the component selection kept in App state with react-router. App is now the layout route around the home page at `/` and the edit page at `/components/:componentId`, so the edited component survives a reload and can be linked to. An unknown component ID redirects to the home page. The editor is keyed by the component ID, since its store is created once per mount and would otherwise keep showing the previous component after navigating to another one.
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.
Bumps all dependencies to their latest versions and replaces the component selection kept in
Appstate with react-router.Dependency upgrade
Nodemodule resolution, sotsconfig.jsonswitches tobundler.biome.jsonis migrated to the 2.5.15 schema withbiome migrate, since the CLI reports a version mismatch otherwise.Routing
Appis now a layout route (global header +<Outlet />) around two pages:/→HomePage/components/:componentId→EditPageHomePagelinks each card to its edit page and navigates to a newly created component.EditPagereads the ID from the URL and navigates when the editor asks to open another component or to close./withreplace, so Back does not return to the broken URL.CCComponentEditoris keyed by the component ID.ComponentEditorStoreProvidercreates its store once per mount, so without the key the editor kept the previous component's store after navigating from one component to another. This was already the case before this PR, but URL navigation and Back make it much easier to hit.Verification
npm run type-check,npm run check,npm testandnpm run buildpass.