Commit Graph
253 Commits
Author SHA1 Message Date
Exotik850 493b0693c5 Put channels back in hook 2023-12-12 13:15:41 -06:00
Exotik850 fdce7bbe5a Return to just TaskId, still polling 2023-12-12 13:02:35 -06:00
kidkool850@gmail.com 69ca1fd8a7 Make cx.spawn() return an Option<TaskId>, returns None if finished immediately 2023-12-11 16:01:40 -06:00
Jonathan Kelley ad885ec47a Merge pull request #1650 from ealmloff/effect-cleanup
Add an optional cleanup closure to the use effect hook
2023-12-06 22:13:08 -08:00
Jonathan Kelley 4444ba0b97 Merge pull request #1576 from ealmloff/fix-lints-release-web
Fix use shared state lint in release mode
2023-12-06 21:39:36 -08:00
Exotik850 694989e826 Add use_const hook (#1667)
* Add use_const hook

* cargo fmt

* clippy allow

* pub fn on get_rc
2023-11-28 09:51:09 -06:00
Exotik850 18fa1e4831 Make UseFuture Clone, factor out dependencies field (#1666) 2023-11-27 15:42:48 -06:00
ealmloffandMarc Espín 7a459e15d8 Update packages/hooks/src/use_effect.rs
Co-authored-by: Marc Espín <mespinsanz@gmail.com>
2023-11-21 16:28:06 -06:00
Evan Almloff 83f7ef9a44 add an optional cleanup closure to the use effect hook 2023-11-19 09:58:00 -06:00
Evan Almloff 6e85ecea12 fix use shared state lint in release mode 2023-10-25 10:23:23 -05:00
Evan Almloff 9f729dd6de fix clippy 2023-10-14 14:32:08 -05: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
LeonardandEvan Almloff 30a3283438 Add use_on_mount and fix some typos (#1497)
* Add `use_on_mount` and fix some typos

* Optimize away UseOnMount struct

* `use_on_mount`, `use_on_unmount` -> `use_on_create`, `use_on_destroy`

* Make `use_on_unmount` deprecated

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-10-04 08:23:21 -05:00
Leonard a2dd926f7f Rename modules to use snake_case (#1498) 2023-09-26 17:20:29 -05:00
Calastrophe 98babe1096 partial ord impl (#1473) 2023-09-18 19:50:57 -05:00
Jonathan Kelley 1a093b895e Merge pull request #1464 from marc2332/fix/update-doc-links-v3-to-v4
fix: Update doc links from v0.3 to v0.4
2023-09-16 11:53:17 -07:00
Jonathan Kelley f2b05bcfb4 Merge pull request #1440 from ealmloff/fix-use-future-docs
Fix use_future docs
2023-09-16 11:52:54 -07:00
marc2332 7f8c963cd9 fix: Update doc links from v3 to v4 2023-09-16 19:03:27 +02: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
Daniel AlblandEvan Almloff 18dca07e4b Use a gen in PartialEq for UseSharedState (#1389)
* Special case UseFutureDep for UseSharedState

* Add 'gen' to UseSharedState for use in 'PartialEq'

* Update 'gen' in 'UseSharedState::new'

* Don't require PartialEq for T in UseSharedState

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-09-13 12:10:03 -05:00
Evan Almloff da627cdf3a fix use_future docs 2023-09-08 09:44:09 -05:00
Evan Almloff c55c17cb81 switch to tracing for logging 2023-09-06 17:47:33 -05:00
Marc Espín a0d1e5de3a fix: Typo on use_on_unmount (#1421) 2023-09-02 17:51:34 -05:00
Daniel Albl 555f4d5834 Add 'with' and 'with_mut' to 'use_shared_state' (#1353) 2023-08-15 13:27:19 -05:00
Evan Almloff 24c626b306 fix clippy 2023-08-08 13:43:57 -07:00
Evan Almloff 4ee4cf23d3 restore a few unneeded breaking changes 2023-08-08 13:37:29 -07:00
Evan Almloff cfd68bf7d9 document signals crate 2023-08-07 16:56:49 -07:00
Jonathan Kelley 39e89c1fac Bump crate versions, fix any publish errors 2023-07-31 18:49:54 -07:00
Jonathan Kelley 456b553c93 Merge pull request #1230 from Demonthos/add-computed
Add computed hook
2023-07-31 17:37:47 -07:00
Evan Almloff d7f7116ce3 clean up the API a bit 2023-07-28 14:17:52 -07:00
Marc Espín fad3272afb fix: Update use_coroutine example (#1237) 2023-07-24 11:32:32 -05:00
Miles MurgawandEvan Almloff 6210c6fefe Convert use_eval to use send/recv system (#1080)
* progress: reworked

don't run this, it'll kill your web browser

* feat: use_eval but with comms

* revision: async recv & recv_sync

* revision: use_eval

* revision: standard eval interface

* revision: use serde_json::Value instead of JsValue

* revision: docs

* revision: error message

* create: desktop eval (wip)

* fix: desktop eval

* revision: wrap use_eval in Rc<RefCell<_>>

* fix: fmt, clippy

* fix: desktop tests

* revision: change to channel system

- fixes clippy errors
- fixes playwright tests

* fix: tests

* fix: eval example

* fix: fmt

* fix: tests, desktop stuff

* fix: tests

* feat: drop handler

* fix: tests

* fix: rustfmt

* revision: web promise/callback system

* fix: recv error

* revision: IntoFuture, functionation

* fix: ci

* revision: playwright web

* remove: unescessary code

* remove dioxus-html from public examples

* prototype-patch

* fix web eval

* fix: rustfmt

* fix: CI

* make use_eval more efficient

* implement eval for liveview as well

* fix playwright tests

* fix clippy

* more clippy fixes

* fix clippy

* fix stack overflow

* fix desktop mock

* fix clippy

---------

Co-authored-by: Evan Almloff <evanalmloff@gmail.com>
2023-07-21 17:36:25 -05:00
Evan Almloff 8af0f0a76a Fix future value never updating 2023-07-21 12:47:51 -07:00
Evan Almloff bfc8240438 Fix use_future always spawning a new task 2023-07-21 11:52:41 -07:00
Evan Almloff 33ee0636d6 add computed hook 2023-07-20 11:07:55 -07:00
Jonathan Kelley 91d4207fa7 Merge branch 'master' into feature/use-shared-state-better-diagnostics 2023-07-20 10:51:10 -07:00
Andrea Frigido dccad58f1d Update license field following SPDX 2.1 license expression standard 2023-07-20 18:00:07 +01:00
Jonathan Kelley c954a116eb Fix race condition in use_future 2023-07-19 14:23:34 -07:00
Marc Espín 9cbc086aa1 fix: Update use_ref docs (#1201) 2023-07-17 11:02:02 -05:00
Jonathan Kelley 78d383bf1f Merge pull request #1128 from marc2332/feat/improved-docs
feat(docs): Improved shared state, use_effect and use_memo docs
2023-07-14 15:20:40 -07:00
Jonathan Kelley 9d2b44aa0f Merge branch 'master' into feature/use-shared-state-better-diagnostics 2023-07-14 15:07:53 -07:00
Jonathan Kelley 2d8841cf70 Add lazy contexts to signals 2023-07-14 12:52:49 -07:00
niedzwiedzw 337697a886 test with forked version of debug-cell 2023-07-13 20:12:28 +02:00
Jonathan Kelley b25501af48 Merge pull request #1139 from Demonthos/add-onunmount-hook
Add on unmount hook
2023-07-12 14:26:56 -07:00
niedzwiedzw 60d6137f39 better display for locations in panic messages 2023-07-12 16:36:17 +02:00
niedzwiedzw 9154b0f8ea pass the information on previous caller on clone 2023-07-12 16:24:39 +02:00
niedzwiedzw af091c5bf8 turns out Result combinators are not marked with #[trace_caller], so it must be written without function nesting in order to work 2023-07-12 16:20:19 +02:00
niedzwiedzw 3fa519563e prevent inlining 2023-07-12 12:27:17 +02:00