Skip to content

Conversation

@webJose
Copy link
Contributor

@webJose webJose commented Nov 26, 2025

Closes #74.

@webJose webJose requested a review from Copilot November 26, 2025 17:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the children snippet parameters for Router, Route, Link, and Fallback components to use a single context object instead of multiple positional parameters. This improves the API ergonomics by grouping related data together and making the parameter names more discoverable through IntelliSense.

Key changes include:

  • Introduced new type definitions (RouterChildrenContext, RouteChildrenContext, LinkChildrenContext) to represent the context objects passed to children snippets
  • Updated all component children snippets to pass a single context object with properties state, rs (route status), and rp (route parameters for Route components)
  • Added comprehensive test coverage for the new children snippet context APIs

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/types.ts Added new context type definitions and moved route parameter extraction types from Route.svelte
src/lib/testing/test-utils.ts Updated addRoutes function to accept undefined routes parameter
src/lib/testing/TestRouteWithRouter.svelte Updated to destructure the new context object format
src/lib/kernel/RouteHelper.svelte.ts Updated type import to use new RouteParamsRecord type
src/lib/Router/Router.svelte.test.ts Added comprehensive test suite for RouterChildrenContext
src/lib/Router/Router.svelte Updated children snippet to pass RouterChildrenContext object
src/lib/Router/README.md Updated documentation and examples to reflect new API
src/lib/Route/Route.svelte.test.ts Added comprehensive test suite for RouteChildrenContext
src/lib/Route/Route.svelte Updated children snippet to pass RouteChildrenContext object and moved type definitions to types.ts
src/lib/Route/README.md Updated documentation to reflect new type names
src/lib/Link/README.md Updated documentation and fixed aria attribute example
src/lib/Link/Link.svelte.test.ts Added comprehensive test suite for LinkChildrenContext
src/lib/Link/Link.svelte Updated children snippet to pass LinkChildrenContext object and minor formatting improvements
src/lib/Fallback/README.md Updated documentation to reflect new type names
src/lib/Fallback/Fallback.svelte.test.ts Added comprehensive test suite for FallbackChildrenContext
src/lib/Fallback/Fallback.svelte Updated children snippet to pass RouterChildrenContext object
README.md Updated examples to use new destructured context parameter format

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@webJose webJose merged commit 3feef49 into main Nov 26, 2025
1 check passed
@webJose webJose deleted the JP/cp branch November 26, 2025 17:25
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.

Unify all parameters of the children snippet of the Route and Router components under a single context object

2 participants