Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify navigate functions in router #759

Merged
merged 2 commits into from
Nov 17, 2024

Conversation

lukechu10
Copy link
Collaborator

Simplify the implementations of the navigate, navigate_replace, and navigate_no_history functions by sharing more code.

@lukechu10 lukechu10 added the A-router Area: router label Nov 17, 2024

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (3)

packages/sycamore-router/src/router.rs:399

  • [nitpick] Ensure consistency in error messages across the codebase. The message 'cannot navigate outside of a Router' should be consistent with similar messages.
assert!(pathname.get().is_some(), "cannot navigate outside of a Router");

packages/sycamore-router/src/router.rs:419

  • [nitpick] Ensure consistency in error messages across the codebase. The message 'cannot refresh outside of a Router' should be consistent with similar messages.
assert!(pathname.get().is_some(), "cannot refresh outside of a Router");

packages/sycamore-router/src/router.rs:10

  • The line 'pathname.ends_with('/')' does not modify the pathname variable. Consider removing this line if it is not serving any purpose.
pathname.ends_with('/');
Copy link

codecov bot commented Nov 17, 2024

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 71.50%. Comparing base (0e82e2e) to head (c882486).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/sycamore-router/src/router.rs 0.00% 20 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #759      +/-   ##
==========================================
+ Coverage   71.32%   71.50%   +0.17%     
==========================================
  Files          45       45              
  Lines        6648     6632      -16     
==========================================
  Hits         4742     4742              
+ Misses       1906     1890      -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

Comments skipped due to low confidence (1)

packages/sycamore-router/src/router.rs:359

  • The line 'pathname.ends_with('/')' is redundant and does not affect the code. It should be removed.
pathname.ends_with('/');
@lukechu10
Copy link
Collaborator Author

Copilot review is actually pretty cool!

@lukechu10 lukechu10 merged commit 1e492e2 into sycamore-rs:main Nov 17, 2024
10 of 11 checks passed
@lukechu10 lukechu10 deleted the refactor-router branch November 17, 2024 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-router Area: router
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant