Commit Graph
45 Commits
Author SHA1 Message Date
Jonathan Kelley 9c300ff266 Merge pull request #1324 from ealmloff/bool-attrs-ssr
Fix boolean attribute rendering in SSR
2023-09-16 12:01:52 -07:00
Leonard c866ae602b Add system for creating component attributes + new #[component] attribute (#1448)
* Add `#[component]` attribute + system for creating component attributes + other stuff

* Delete inlineprops.rs

* Update inline_props.rs

* Cargo fmt

* Fix clippy warnings and paths in props/mods.rs

* Include where clause in `#[inline_props]` output

* Allow Clippy type complexity in `LinkProps`

* Allow the type complexity lint for the entire link.rs file

* Remove snake_case -> PascalCase converter, but rather enforce PascalCase

Also:
- Put the second function inside the main one instead of besides it.
- Simplify

* Simplify type check lints so they don't return false positives

They will not always work, but they won't return any false positives, like for aliases. This is likely going to be replaced by a more polished Clippy-backed linting system.

* Fix #583

* Cargo fmt

* Add docs for `deserialize()` and remove useless comment

* Add `#[component]` to prelude

* Merge branch 'master' of https://github.com/tigerros/dioxus

* #[inline_props] is no more. Except in the docs folder, but that's going to be removed

* Remove docs folder

* Remove docs from workspace

* Resolve `DeserializerOutput` conversation
2023-09-15 09:13:36 -05:00
Evan Almloff e43bdd815f fix test failures 2023-08-08 11:27:29 -07:00
ealmloff cfd62e274e Make deprecated use router (#1260)
* make router props expansion better

* fix router data fields

* make a deprecated use_router hook
2023-07-27 10:32:23 -07:00
Evan Almloff cc94711d62 rename generic navigator to navigator 2023-07-26 11:09:40 -07:00
Evan Almloff 5f0dd3af3e it almost lives? 2023-07-25 18:14:48 -07:00
Evan Almloff a9307e57e6 fix CI 2023-06-02 12:33:47 -05:00
Evan Almloff fe601e2a48 restore navigator 2023-06-01 09:45:31 -05:00
Evan Almloff ece8f0fb22 general cleanup 2023-05-31 17:12:52 -05:00
Evan Almloff 09cabe4e8b update doc examples 2023-05-31 15:51:26 -05:00
Evan Almloff d3b21879fb create non generic wrappers for each route 2023-05-23 19:31:30 -05:00
Evan Almloff e4b8fbfafe Intigrate macro with router hooks and components 2023-05-22 16:42:32 -05:00
Adrian Wannenmacher 00174d4f46 switch router to async-lock 2023-04-11 19:58:07 +02:00
Adrian Wannenmacher f1e32f6358 rustfmt 2022-12-23 18:56:24 +01:00
Adrian Wannenmacher f1cbfe0874 change router to use option again 2022-12-23 18:55:03 +01:00
Adrian Wannenmacher 75357e974d rustfmt 2022-12-16 12:10:49 +01:00
Adrian Wannenmacher 10c2abf0d8 implement scroll restoration 2022-12-15 20:09:53 +01:00
Adrian Wannenmacher 53d97755fd add web history integration 2022-12-15 14:46:40 +01:00
Adrian Wannenmacher 4677a00adc apply clippy suggestions 2022-12-13 16:19:40 +01:00
Adrian Wannenmacher af6362ce3e deny missing docs in router 2022-12-13 12:42:18 +01:00
Adrian Wannenmacher 7d2466ff28 make hooks return a result instead of an option 2022-12-13 11:09:24 +01:00
Adrian Wannenmacher 3e86c0e364 make nested use_router calls behave correctly 2022-12-13 10:59:25 +01:00
Adrian Wannenmacher 64399794c0 document hooks 2022-12-13 10:46:30 +01:00
Adrian Wannenmacher 0cc0cba482 add navigator and use_navigate hook 2022-12-13 00:09:32 +01:00
Adrian Wannenmacher 8df588046d add use_route hook 2022-12-12 23:39:34 +01:00
Adrian Wannenmacher 9f48cab9ad add comp() and default failure components 2022-12-09 01:14:54 +01:00
Adrian Wannenmacher 89ac4d51ab fix breaks from previous merge 2022-12-08 23:56:41 +01:00
Adrian Wannenmacher 3b088be9a6 add use_router hook 2022-12-06 11:03:01 +01:00
Adrian Wannenmacher 998f9b9ec9 clean out router 2022-12-06 10:11:22 +01: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
Evan Almloff fbf8e13b8d clean up imports 2022-06-25 08:27:10 -05:00
Michael Mroz 078287301d Fix query parsing: the router was silently throwing away queries not prefixed with an extra '?' 2022-04-17 01:51:02 -07:00
Maccesch 1080ffe52d use_route hook can be used outside of Route components 2022-03-13 16:31:33 +00:00
Jonathan Kelley c7627f0b93 fix: tests pass 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
Jonathan Kelley babe862739 fix: login example to use proper methods 2022-02-16 14:11:31 -05:00
Jonathan Kelley e24957fc19 feat: enable use_router 2022-01-28 14:38:17 -05:00
Jonathan Kelley 79e09934aa chore: add docs to router UseRouteListener 2022-01-28 12:14:40 -05:00
Jonathan Kelley a21e7d4dd1 fix: use_route should subscribe to changes to the route 2022-01-28 12:00:13 -05:00
Dave Rolsky e06eac1ce5 More WIP router implementation 2022-01-13 12:26:49 -06:00
Dave Rolsky c9408da731 Implement UseRoute segment method
This relies on the RouterService to capture path params when it does path
matching.
2022-01-13 12:21:06 -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
Jonathan Kelley bd341f5571 fix: tests 2022-01-05 17:30:12 -05:00
Jonathan Kelley cb2782b4bb wip: memoize dom in the prescence of identical components 2022-01-05 00:27:22 -05:00