Commit Graph
83 Commits
Author SHA1 Message Date
Evan Almloff d795995e20 Create closure type; allow async event handlers in props; allow short hand event handlers (#2437)
* create closure type; allow async event handlers in props; allow shorthand event handlers

* test forwarding event handlers with the shorthand syntax

* fix clippy

* fix imports in spawn async doctest
2024-06-10 18:47:07 -07:00
Evan Almloff e8491d5cf4 Require every field in router variants to be present in the route in the web history (#2159)
* require every field to be present in the URL in the web history

* remove desktop only extra field from the simple routes example
2024-03-27 18:12:35 -07:00
Evan Almloff 4bc2f4a713 add more docs around lifetime downcasting 2024-03-08 10:46:34 -06:00
Jonathan Kelley 64a321eacc Get more axum stuff upgraded to 0.7 2024-02-15 18:59:57 -08:00
Jonathan Kelley 214a907adc Upgrade to axum 0.7, drop 3rd party adapters 2024-02-15 18:05:30 -08:00
Jonathan Kelley 6818bbe10a Make use_future take an impl FnMut + 'static, don't include router prelude when we don't need to 2024-01-31 16:33:53 -08:00
Jonathan Kelley 0bd9692e45 Fix cargo test and a number of little cleanup bugs 2024-01-30 17:33:14 -08:00
Jonathan Kelley 85c7c22619 Make router work on web 2024-01-19 16:36:40 -08:00
Jonathan Kelley 83bce6ce97 Make cargo check --all --examples work! 2024-01-19 14:19:49 -08:00
Evan Almloff e65c5f0eb3 depreciate the render macro 2024-01-16 13:18:46 -06:00
Evan Almloff d2cdcc602b impl ComponentFunction for Routes 2024-01-16 09:40:17 -06:00
Jonathan Kelley 1dde044697 remove cx.render 2024-01-13 21:12:21 -08:00
Jonathan Kelley fae0b08e61 Fix the router and stub out a number of crates to get compiling 2024-01-13 20:51:37 -08:00
Jonathan Kelley d9b84f9f8f Disambiguate expressions in rsx by requiring curlies 2024-01-10 19:33:34 -08:00
ealmloff 08a679147f Merge branch 'master' into liveview-history-default 2024-01-08 13:11:55 -06:00
Evan Almloff 0388a5c1f4 fix formatting 2024-01-04 19:21:06 -06:00
Evan Almloff dccfba12d8 Merge branch 'master' into events-2 2024-01-04 19:02:00 -06:00
Jonathan Kelley 799be5e4e3 Merge branch 'master' into jk/global-window-fun 2024-01-04 10:22:10 -08:00
Evan Almloff 3feee729bc enabled the liveview history by default if the liveview feature is enabled in the router 2023-12-20 09:53:41 -06:00
ealmloff 5bb06b9719 Merge branch 'master' into events-2 2023-10-30 15:37:29 -05:00
f5bc1a9856 Implement LiveView Router Integration (#1505)
* Fix GoForwardButton calling can_go_back instead of can_go_forward

* Add first draft of LiveviewHistory

* Add external URL redirect

* Lock evaluator channel outside loop

* Add liveview to router examples

* fixup! Add liveview to router examples

* Communicate with liveview server on page load

* Add PopState event to Liveview routing

* Call updater callback from liveview history

* Add rudimentary PopState functionality to liveview router.

* Fix linter errors

* Refactor

* Fix navigator external redirection not working.

* Add go back and go forward buttons to router examples

* Finish functionality for timeline stack in liveview router

* Add docs to LiveviewHistory

* Replace Liveview history context attachment with constructor that takes context

* Fix go forward/backward history/future shuffle

* Support history across entire liveview session, if contiguous page jumps.

* Remove unnecessary bounds

* Add query and hash to location string

* Run rustfmt

* fix: Update server function docs link (#1489)

* liveview: Add `interpreter_glue_relative_uri (#1481)

* liveview: Add `interpreter_glue_relative_uri`

By utilizing `window.location.host` in the client-side JavaScript, we can easily derive the WebSocket URI from a relative path URI. This approach obviates the need for host address retrieval on the server side, unlike the method of serving glue code in liveview using `interpreter_glue`.

* liveview: Merge `.._relative_url` functionality

- Merged `.._relative_url` to current API `interpreter_glue`.
- Edit axum example to work with new feature.

* liveview: Fix clippy warning

* Rename modules to use snake_case (#1498)

* Change Scope into &ScopeState

* Move synchronization of state into router and make it opt-in

---------

Co-authored-by: Marc Espín <mespinsanz@gmail.com>
Co-authored-by: Seungwoo Kang <ki6080@gmail.com>
Co-authored-by: Leonard <tigerros.gh@gmail.com>
Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-10-26 14:19:51 -05:00
Jonathan Kelley dd4547d753 Feat: add global context functions
Add functions like window() and router() to
allow dynamically grabbing global contexts
without have to use the hook variants.

Deprecates the existing hook variants to
discourage folks from adding more noise
to their codebases.
2023-10-23 16:26:10 -04:00
Evan Almloff 219c068283 Merge branch 'master' into events-2 2023-09-17 20:01:21 -05: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 baf36ab9ec Merge branch 'master' into events-2 2023-09-02 18:14:36 -05:00
Evan Almloff df222c121a port examples to new events 2023-09-01 15:38:55 -05:00
Luca 37eb929d69 Explain features necessary for the pre_cache_static_routes function. (#1401) 2023-08-25 14:00:38 -05:00
Evan Almloff 947a153347 make navigator non-generic 2023-07-26 11:08:45 -07:00
Evan Almloff 0ebcb5f1be remove some logging 2023-07-26 10:28:49 -07:00
Evan Almloff 5f0dd3af3e it almost lives? 2023-07-25 18:14:48 -07:00
Evan Almloff 61dc549ba1 Make new enum router less breaking 2023-07-24 11:57:56 -07:00
Evan Almloff d19a33d59c fix reversed nests 2023-07-14 11:40:38 -07:00
Evan Almloff 0600a1bb49 simpilify static generation example 2023-06-27 16:06:44 -07:00
Evan Almloff 2da1f7faa7 allow nested routes 2023-06-26 16:08:53 -07:00
Evan Almloff e83866b986 fix router examples 2023-06-24 13:44:22 -07:00
Evan Almloff 1704ee0068 router/fullstack/ssr intigration 2023-06-22 16:51:48 -07:00
Evan Almloff 28f875857e add timestamps to incremental rendering 2023-06-22 12:13:51 -07:00
Evan Almloff 3d41dd95c9 remove logging 2023-06-21 18:51:40 -07:00
Evan Almloff 3a690877d1 basic incremental renderer 2023-06-21 18:36:32 -07:00
Evan Almloff bc99d9b01a fix formatting 2023-06-01 17:48:43 -05:00
Evan Almloff b5a2f0d6cb finish router refrence 2023-06-01 17:31:13 -05:00
Evan Almloff 67992f7da9 create cfg factory 2023-06-01 13:13:50 -05:00
Evan Almloff 2f473f7c97 make serde optional 2023-06-01 11:03:44 -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 35befa1784 update tests 2023-05-31 13:57:33 -05:00
Evan Almloff 58b74c1155 create redirects 2023-05-31 12:11:11 -05:00
Evan Almloff ecc99cd013 format example 2023-05-23 19:39:18 -05:00
Evan Almloff d3b21879fb create non generic wrappers for each route 2023-05-23 19:31:30 -05:00
Evan Almloff 3678fa1d3f create example 2023-05-23 19:09:24 -05:00