Commit Graph
43 Commits
Author SHA1 Message Date
Jonathan Kelley 7e45f2aa04 feat: add scroll to 0 for web router 2022-12-13 15:00:54 -08:00
Jonathan Kelley 79e786aca5 chore: convert to logs 2022-12-13 12:38:27 -08:00
Jonathan Kelley d4b6bb8a7b feat: fix the scope rollover bug 2022-12-12 18:31:30 -08:00
Jonathan Kelley 0bf4725639 fix: namespacing of dynamic attributes 2022-12-07 15:11:51 -08:00
Jonathan Kelley 5673017def chore: clean up the repo some 2022-12-06 17:50:25 -08:00
Jonathan Kelley df4a1b6c7a chore: finish tweaking context api 2022-12-05 15:30:49 -08:00
Jonathan Kelley 3c19def550 chore: get create working and simplify dynamic nodes 2022-11-30 11:24:13 -05:00
Norman Paniagua 6e66d6fe36 Added initial_url to the router component (#510)
* added active_url

* renamed active_url to initial_url

* updated docs
2022-09-13 13:09:00 -07:00
Reinis Mazeiks d734dc5b46 Remove argument from use_hook closure (#496)
Also; update docs for said function
2022-07-11 15:50:56 -04:00
Jon Kelley d9546d9504 Renderers are now packages, not features. (#387)
* feat: use synchronous router design

* feat: function to get router out of dom

* chore: restructure workspace to use renderers as packages, not features
2022-07-09 15:15:20 -04:00
Evan Almloff fbf8e13b8d clean up imports 2022-06-25 08:27:10 -05:00
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