Commit Graph
32 Commits
Author SHA1 Message Date
Joshua Kifer 213f54c4d8 Convert all logs to trace 2022-03-27 09:23:44 -06:00
Jonathan Kelley dc028df0dd clippy: make it happier 2022-03-20 21:50:43 -04:00
Maccesch a2825fb13c updated examples with the new optional props 2022-03-16 06:36:39 +00:00
Maccesch 9a23ee4612 active_class prop for Router 2022-03-13 16:35:28 +00:00
Jon Kelley 0fdd6d268f Merge pull request #294 from Synphonyte/master 2022-03-12 11:56:25 -05:00
Maccesch 1a2624952a fixed cargo fmt 2022-03-09 23:06:14 +00:00
Jonathan Kelley cc4b073f0d fix: use ordering of routes for router 2022-03-09 17:50:39 -05:00
Jonathan Kelley 0ce326566e wip: fix router slashing 2022-03-09 16:26:13 -05:00
Maccesch 82fc9739bb updated to new way of checking path of route 2022-03-09 03:25:40 +00:00
Maccesch ef82ffd217 added active class to router link 2022-03-06 23:17:24 +00:00
Jonathan Kelley f47d2900fb feat: add a redirect 2022-03-05 14:06:54 -05:00
Jonathan Kelley c7627f0b93 fix: tests pass 2022-03-04 13:16:37 -05:00
Jonathan Kelley 06d4a5640b docs: fix doc comment 2022-03-04 13:16:37 -05:00
Jonathan Kelley cc83900334 feat: router crate is polished up 2022-03-04 13:16:37 -05:00
Jonathan Kelley f2979cb12a feat: apply local router changes 2022-03-04 13:16:37 -05:00
Denis Richartz b71cf6ed4a cargo fmt 2022-02-16 16:11:57 +01:00
Denis Richartz ee2e986a30 fix unnecessary div 2022-02-16 15:34:43 +01:00
Jonathan Kelley 8ca505b65b feat: better link 2022-02-14 09:30:08 -05:00
Jonathan Kelley 3edf3e367f wip: debugging 2022-01-30 14:08:03 -05:00
Dave Rolsky 72c6bb3d0b Make log message in Link component trace level, not debug
All the other routing-related messages are at the trace level. Leaving this at
debug was an oversight on my part.
2022-01-28 15:31:43 -06:00
Jonathan Kelley 29ed7ebece feat: connect an onchange listener 2022-01-25 15:06:37 -05:00
Dave Rolsky 9e4ec43b1e Fix various typos and grammar nits
I also removed all trailing whitespace from lines since I have Emacs
configured to highlight this.
2022-01-21 21:43:43 -06:00
Dave Rolsky 64080588d0 Add a warning when Link it called outside of a Router context 2022-01-17 15:52:01 -06:00
Dave Rolsky 3c6142fb9d Commit WIP on router
There are a few different changes in here that probably need to be picked
apart. I'm sure much of this is wrong.

* Fix missing `dyn` that compiler complained about in router.rs

* Make UseRoute store a `Rc<RouterService>` rather than a string so we can get
information out of the router like current location.

* Implement `UseRoute`'s nth_segment and last_segment methods. I changed the
return type to a String because of the above.

* Remove some unused imports in platform/mod.rs and service.rs

* Implement the `use_route` fn. It panics if called outside a Router { } (I
think). I think that makes sense.

* Add a `current_location` method to `RouterService` that returns the current
location. I needed this both for the `UseRoute` implementation and _also_ so I
could get at this in my webapp code. I think having some way to get this will
be useful for others, whether or not this exact API is used. In my case, I
want to compare the current path to the `to` path of a `Link` so I can use a
different class for that `Link` if it is the currently active page.
2022-01-13 12:21:06 -06:00
Dave Rolsky 3a5b417ad1 Add more trace messages to the RouterService code
I was trying to debug some issues with my routes and this additional tracing
was quite helpful.
2022-01-13 12:21:06 -06:00
Dave Rolsky e22ba5b1e5 Add title prop to Link
Every element can have a title, but it's particularly useful on links, so I
think making it an explicit option is worthwhile.
2022-01-13 12:21:06 -06:00
Jonathan Kelley d2372717bd feat: flatten props attrs 2022-01-10 02:57:03 -05:00
Alexandre Kirszenberg b6903bf558 Enable clippy 2022-01-08 16:35:26 +01:00
Jonathan Kelley bd341f5571 fix: tests 2022-01-05 17:30:12 -05:00
Jonathan Kelley e2a6454527 chore: switch to log tracing 2022-01-05 16:36:42 -05:00
Jonathan Kelley 427b126bc1 feat: add prevent default attribute and upgrade router 2022-01-05 16:34:24 -05:00
Jonathan Kelley cb2782b4bb wip: memoize dom in the prescence of identical components 2022-01-05 00:27:22 -05:00