Skip to content

Conversation

@webJose
Copy link
Contributor

@webJose webJose commented Sep 4, 2025

This also removes the when property.

Fixes #20.

This also removes the when property.

Fixes #20.
@webJose webJose requested a review from Copilot September 4, 2025 05:06
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 adds a new ignoreForFallback property to Route components while removing the when property. The purpose is to allow routes to be ignored when determining whether fallback content should be displayed, providing more granular control over route matching behavior for fallback scenarios.

  • Replaces the when predicate function with a simpler boolean ignoreForFallback property
  • Updates route matching logic to consider the ignoreForFallback flag when calculating noMatches
  • Adds comprehensive test coverage for the new fallback behavior

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/lib/types.ts Removes WhenPredicate type and updates CoreRouteInfo to replace when with ignoreForFallback
src/lib/core/RouterEngine.svelte.ts Updates route pattern parsing and matching logic to handle ignoreForFallback property
src/lib/core/RouterEngine.svelte.test.ts Adds test cases for noMatches behavior with ignoreForFallback routes
src/lib/Route/Route.svelte Updates Route component to use ignoreForFallback instead of when property
src/lib/Route/README.md Updates documentation to reflect the new ignoreForFallback property

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

webJose and others added 2 commits September 3, 2025 23:13
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This has restored functionality to the Fallback content in the demo.
@webJose webJose merged commit 53790e2 into main Sep 4, 2025
1 check passed
@webJose webJose deleted the JP/Remove-When branch September 4, 2025 17:45
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.

Decide on a better mechanism for the "when" property

2 participants