Commit Graph
180 Commits
Author SHA1 Message Date
Jonathan Kelley 8f70509bc3 Merge pull request #1680 from ealmloff/derive-query-parsing
Automatically derive standard query parsing in the router macro
2024-01-05 12:16:37 -08:00
Jonathan Kelley 799be5e4e3 Merge branch 'master' into jk/global-window-fun 2024-01-04 10:22:10 -08:00
Evan Almloff 8a44fe8d03 derive query parsing in the router macro 2023-12-01 15:31:45 -06: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
Stephen AndaryandEvan Almloff b25fada776 Add Newtype so that Rust-url can be IntoRoutable (#1579)
* add newtype so that rust-url can IntoRoutable

* add doc line

* implement From<Url> directly

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-10-25 15:36:38 -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 3bf6d2d7cf add must use to several hooks 2023-10-14 12:08:54 -05:00
Leonard 2d1234c3d1 Include README and Dioxus logo in package docs (#1536)
* Include README in docs.rs and add Dioxus logo

* Update README.md
2023-10-10 10:52:48 -05:00
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
Jonathan Kelley 2f1fbf3ca4 Merge pull request #1406 from DioxusLabs/fix-router-query
Fix web query segments
2023-09-16 11:55:43 -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
Jonathan Kelley b68a1f57e0 Merge pull request #1436 from ealmloff/tracing 2023-09-13 10:41:23 -07:00
Leonard ae5dca8f43 Routable improvements (#1461)
* Fix `SegmentType::CatchAll` `Display`

* Rename `display_route_segements` to `display_route_segments` and add dots to docs

* Fix `Routeable::static_routes` and add more route retrieval methods

* Fix Clippy and extract duplication to function

* Return route strings instead of instances

* Remove some methods

* Clippy
2023-09-13 11:55:26 -05:00
Evan Almloff c55c17cb81 switch to tracing for logging 2023-09-06 17:47:33 -05:00
ealmloff c8127e164b Url decode routes (#1407)
* fix a few new clippy lints

* url decode routes

* fix catch all segments

* fix clippy
2023-09-06 12:56:43 -05:00
StygmatesandEvan Almloff 1b977fdce9 Add query segment example and documentation (#1417)
* fix a few new clippy lints

* Add query segment example

* Add trait documentation

* Change core package to root package

The core package contains the virtual dom implementation ([here](https://github.com/DioxusLabs/dioxus/tree/master/packages/core)). Root package might be a more clear way to refer to the main directory

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-09-02 10:24:30 -05:00
Evan Almloff 0554a5db5d Merge branch 'fix-new-clippy-lints' into fix-router-query 2023-08-30 09:03:41 -05:00
Evan Almloff 2d916ef628 fix web query segments 2023-08-30 08:21:24 -05:00
Evan Almloff 3ac2346e46 fix a few new clippy lints 2023-08-25 07:54:04 -05:00
Evan Almloff e43bdd815f fix test failures 2023-08-08 11:27:29 -07:00
Evan Almloff f7eba62a5d Merge branch 'master' into update-scroll-history-lazy 2023-08-01 10:47:04 -07:00
Evan Almloff 549db35de3 update scroll history lazily when you leave a page 2023-08-01 10:45:54 -07:00
Jonathan Kelley fe1ce3bbe7 Merge pull request #1273 from Demonthos/dedup-history
Deduplicate route history
2023-08-01 10:35:20 -07:00
Evan Almloff 4062e232d9 fix navigator 2023-08-01 10:21:16 -07:00
Evan Almloff 98de423d99 deduplicate route history 2023-08-01 10:16:19 -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 d2ec27e761 fix clippy 2023-07-26 11:29:34 -07:00
Evan Almloff cc94711d62 rename generic navigator to navigator 2023-07-26 11:09:40 -07: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 e7a9161066 fix link component 2023-07-26 10:18:39 -07:00
Evan Almloff 5f0dd3af3e it almost lives? 2023-07-25 18:14:48 -07:00
Jonathan Kelley 7d4361a701 Merge pull request #1244 from Demonthos/is-decendant
Add is_child_of function to Routable
2023-07-24 17:36:30 -07:00
Evan Almloff 61dc549ba1 Make new enum router less breaking 2023-07-24 11:57:56 -07:00
Evan Almloff 1ddda0cc17 fix clippy 2023-07-24 11:30:52 -07:00
Evan Almloff 6760c2f961 add doc example 2023-07-24 11:22:59 -07:00
Evan Almloff 440d2922be add is_child_of function to Routable 2023-07-24 10:33:55 -07:00
Evan Almloff 9e70aae989 fix route prerendering 2023-07-21 11:10:21 -07:00
Evan Almloff dd5d974aeb fix suspense 2023-07-17 16:48:54 -07:00
Evan Almloff 97115f6537 fix nested nest segments 2023-07-14 12:32:46 -07:00
Evan Almloff 1dac04ba8a fix with_initial_path 2023-07-14 08:22:31 -07:00
Evan Almloff 8a142bbc95 improve index route parsing error message 2023-07-14 08:13:44 -07:00
Evan Almloff 5f37dcc2ac fix layouts in child routes 2023-07-13 19:56:30 -07:00
Evan Almloff 128f3e4425 fix nested routers 2023-07-13 19:29:43 -07:00
Evan Almloff 73a45fb113 fix incremental router cache 2023-07-08 12:22:54 -07:00
Evan Almloff 523be82965 fix clippy 2023-07-06 12:14:40 -07:00
Evan Almloff 1110026d54 allow nested routers 2023-07-06 11:52:17 -07:00
Evan Almloff cbeaa07be0 create static_routes helper 2023-06-30 18:51:33 -07:00
Evan Almloff f5c60eeb4c make fullstack helpers compatable with prerendering 2023-06-28 18:48:42 -07:00
Evan Almloff 2da1f7faa7 allow nested routes 2023-06-26 16:08:53 -07:00