-
Notifications
You must be signed in to change notification settings - Fork 169
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
Support query parameters in routes #752
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #752 +/- ##
==========================================
- Coverage 72.35% 71.32% -1.03%
==========================================
Files 45 45
Lines 6557 6648 +91
==========================================
- Hits 4744 4742 -2
- Misses 1813 1906 +93 ☔ View full report in Codecov by Sentry. |
I couldn't find web tests for the router and i'm not sure if u want me to add them to sycamore web tests or create new web tests in sycamore-router (or not write tests at all), (i manually tested it at least) |
I'm not actually sure how to create web tests in this case since navigating will take you away from the generated wasm test page and thus stop the test. It would be nice if we could find a way to test this but for now this is fine I think. |
personally i would test this with an e2e test using selenium (at my previous job (softwareag, working student) that is all i did) |
Yeah something like that would work but that probably belongs in another PR. I was hoping to get e2e tests for all the examples as well so we could just e2e test the router example for this case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added an example of query parameters to the router example. Also left a few comments.
i just realized i accidentally deleted the functions from my previous pr (prob during merge or stash pop) |
Ok I'm running into something a little weird where the query parameter seems to require two page navigations for it to be reset. Recording.2024-11-04.mp4I'm trying to figure out why now... |
Ah got it. It's because we're calling |
I also updated the order in the naviagte_* fuctions which essentially have the same logic as the click handler. Eventually, it would be a good idea to refactor this a bit to remove the duplicate logic. |
closes: #130
also fixes bug that when going from a url with hash to a url with no hash (and with the same path) it causes a reload of the whole site (it was probably there before i started coding new features but i don't know for sure)