Commit graph

170 commits

Author SHA1 Message Date
Evan Almloff
58f7efafea
Make EventHandler copy (#2112)
* implement Copy for EventHandler
* implement from closure for event handler and remove special on prefix
* fix props implementation of EventHandler
2024-03-19 19:48:53 -07:00
Jonathan Kelley
9c64fc4769
Fix #1938, allow explicit props 2024-03-18 15:34:46 -07:00
Evan Almloff
bbc81b8f9c fix memos in children; introduce isomorphic spawn 2024-03-08 16:40:31 -06:00
Jeremy Arnold
9ae3d14e67
Add tracing to virtual_dom (#1949)
Address #1161; Add tracing to virtual dom:

- Added a dependency on [tracing-fluent-assertions](https://github.com/tobz/tracing-fluent-assertions) for test cases
- Added a test case showing tracing


example log
```
2024-02-28T21:52:25.266474Z TRACE dioxus_core::scope_context: providing context alloc::rc::Rc<dioxus_core::error_boundary::ErrorBoundary> (TypeId { t: 86211292795840746005296084033382154959 }) in app
    at packages/core/src/scope_context.rs:189
    in dioxus_core::virtual_dom::VirtualDom::new

  2024-02-28T21:52:25.266651Z TRACE dioxus_core::scope_context: looking for context generational_box::Owner<generational_box::sync::SyncStorage> (TypeId { t: 16187079142358387300491255137481079601 }) in app
    at packages/core/src/scope_context.rs:106
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266662Z TRACE dioxus_core::scope_context: context generational_box::Owner<generational_box::sync::SyncStorage> (TypeId { t: 16187079142358387300491255137481079601 }) not found
    at packages/core/src/scope_context.rs:140
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266671Z TRACE dioxus_core::scope_context: providing context generational_box::Owner<generational_box::sync::SyncStorage> (TypeId { t: 16187079142358387300491255137481079601 }) in app
    at packages/core/src/scope_context.rs:189
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266713Z TRACE dioxus_core::scope_context: providing context dioxus_signals::reactive_context::ReactiveContext (TypeId { t: 86476382904980360086558195405008306005 }) in app
    at packages/core/src/scope_context.rs:189
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266723Z TRACE dioxus_core::scope_context: looking for context generational_box::Owner (TypeId { t: 87785542931436862771411509553978749471 }) in app
    at packages/core/src/scope_context.rs:106
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266730Z TRACE dioxus_core::scope_context: context generational_box::Owner (TypeId { t: 87785542931436862771411509553978749471 }) not found
    at packages/core/src/scope_context.rs:140
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266769Z TRACE dioxus_core::scope_context: providing context generational_box::Owner (TypeId { t: 87785542931436862771411509553978749471 }) in app
    at packages/core/src/scope_context.rs:189
    in dioxus_core::scope_arena::render with scope: app
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266828Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:60:5:1728", roots: [Element { tag: "div", namespace: None, attrs: [], children: [Element { tag: "button", namespace: None, attrs: [Dynamic { id: 0 }], children: [Text { text: "+" }] }, Element { tag: "button", namespace: None, attrs: [Dynamic { id: 1 }], children: [Text { text: "-" }] }, Element { tag: "ul", namespace: None, attrs: [], children: [Dynamic { id: 0 }] }] }], node_paths: [[0, 2, 0]], attr_paths: [[0, 0], [0, 1]] } }, dynamic_nodes: [Placeholder(VPlaceholder)], dynamic_attrs: [[Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }], [Attribute { name: "onclick", value: Listener, namespace: None, volatile: false }]] }, mount: Cell { value: MountId(0) } }, mount: MountId(0)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::rebuild

  2024-02-28T21:52:25.266896Z TRACE dioxus_core::virtual_dom: Calling 1 listeners
    at packages/core/src/virtual_dom.rs:695
    in dioxus_core::virtual_dom::VirtualDom::handle_bubbling_event with parent: Some(ElementRef { path: ElementPath { path: [0, 0] }, mount: MountId(0) }), name: "click"
    in dioxus_core::virtual_dom::VirtualDom::handle_event with name: "click", data: Any { .. }, element: ElementId(2), bubbles: true

  2024-02-28T21:52:25.266934Z TRACE dioxus_core::virtual_dom: Marking scope ScopeId(0) (app) as dirty
    at packages/core/src/virtual_dom.rs:379
    in dioxus_core::virtual_dom::VirtualDom::process_events

  2024-02-28T21:52:25.266997Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:71:37:2059", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "ChildExample" })], dynamic_attrs: [] }, mount: Cell { value: MountId(1) } }, mount: MountId(1)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate

  2024-02-28T21:52:25.267026Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:81:5:2238", roots: [Element { tag: "li", namespace: None, attrs: [Dynamic { id: 0 }], children: [DynamicText { id: 0 }] }], node_paths: [[0, 0]], attr_paths: [[0]] } }, dynamic_nodes: [Text(VText { value: "0" })], dynamic_attrs: [[Attribute { name: "onmouseover", value: Listener, namespace: None, volatile: false }]] }, mount: Cell { value: MountId(2) } }, mount: MountId(2)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate

  2024-02-28T21:52:25.267061Z TRACE dioxus_core::virtual_dom: Calling 1 listeners
    at packages/core/src/virtual_dom.rs:695
    in dioxus_core::virtual_dom::VirtualDom::handle_bubbling_event with parent: Some(ElementRef { path: ElementPath { path: [0, 0] }, mount: MountId(0) }), name: "click"
    in dioxus_core::virtual_dom::VirtualDom::handle_event with name: "click", data: Any { .. }, element: ElementId(2), bubbles: true

  2024-02-28T21:52:25.267084Z TRACE dioxus_core::virtual_dom: Marking scope ScopeId(0) (app) as dirty
    at packages/core/src/virtual_dom.rs:379
    in dioxus_core::virtual_dom::VirtualDom::process_events

  2024-02-28T21:52:25.267131Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:71:37:2059", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "ChildExample" })], dynamic_attrs: [] }, mount: Cell { value: MountId(3) } }, mount: MountId(3)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate

  2024-02-28T21:52:25.267157Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:81:5:2238", roots: [Element { tag: "li", namespace: None, attrs: [Dynamic { id: 0 }], children: [DynamicText { id: 0 }] }], node_paths: [[0, 0]], attr_paths: [[0]] } }, dynamic_nodes: [Text(VText { value: "1" })], dynamic_attrs: [[Attribute { name: "onmouseover", value: Listener, namespace: None, volatile: false }]] }, mount: Cell { value: MountId(4) } }, mount: MountId(4)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate

  2024-02-28T21:52:25.267206Z TRACE dioxus_core::virtual_dom: Calling 1 listeners
    at packages/core/src/virtual_dom.rs:695
    in dioxus_core::virtual_dom::VirtualDom::handle_bubbling_event with parent: Some(ElementRef { path: ElementPath { path: [0, 0] }, mount: MountId(0) }), name: "click"
    in dioxus_core::virtual_dom::VirtualDom::handle_event with name: "click", data: Any { .. }, element: ElementId(2), bubbles: true

  2024-02-28T21:52:25.267229Z TRACE dioxus_core::virtual_dom: Marking scope ScopeId(0) (app) as dirty
    at packages/core/src/virtual_dom.rs:379
    in dioxus_core::virtual_dom::VirtualDom::process_events

  2024-02-28T21:52:25.267274Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:71:37:2059", roots: [Dynamic { id: 0 }], node_paths: [[0]], attr_paths: [] } }, dynamic_nodes: [Component(VComponent { name: "ChildExample" })], dynamic_attrs: [] }, mount: Cell { value: MountId(5) } }, mount: MountId(5)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate

  2024-02-28T21:52:25.267297Z  INFO dioxus_core::diff::node: creating template, self: VNode { vnode: VNodeInner { key: None, template: Cell { value: Template { name: "packages/core/tests/tracing.rs:81:5:2238", roots: [Element { tag: "li", namespace: None, attrs: [Dynamic { id: 0 }], children: [DynamicText { id: 0 }] }], node_paths: [[0, 0]], attr_paths: [[0]] } }, dynamic_nodes: [Text(VText { value: "2" })], dynamic_attrs: [[Attribute { name: "onmouseover", value: Listener, namespace: None, volatile: false }]] }, mount: Cell { value: MountId(6) } }, mount: MountId(6)
    at packages/core/src/diff/node.rs:547
    in dioxus_core::virtual_dom::VirtualDom::render_immediate
```
2024-02-29 17:49:35 -06:00
Jonathan Kelley
8f70a84c70
Use futures_util mutex instead of flume for sending flush lock wakeups 2024-02-02 13:09:26 -08:00
Jonathan Kelley
968f24a7b3
wip: reactive context instead of effect 2024-02-01 13:21:52 -08:00
Jonathan Kelley
09e14f1936
Implement some clippy fixes 2024-01-30 18:17:45 -08:00
Jonathan Kelley
7b0dcb3206
Add flush_sync and pre_render methods to core 2024-01-28 01:30:33 -08:00
Jonathan Kelley
6ed3aafb2f
Get cargo check --all working 2024-01-18 19:27:55 -08:00
Jonathan Kelley
66ba220265
Remove smallbox 2024-01-16 17:54:13 -08:00
Evan Almloff
7fe6e05da3 remove trybuild now that core is more safe 2024-01-11 15:21:13 -06:00
Evan Almloff
404c864246 make the root component take no arguments 2024-01-11 10:48:04 -06:00
Evan Almloff
55f76fede6 work on fixing some core tests 2024-01-10 19:21:15 -06:00
Evan Almloff
f4af297777 merge upstream 2024-01-06 16:14:22 -06:00
Evan Almloff
3ad16ddd37 rip out more lifetimes 2024-01-04 18:33:01 -06:00
Evan Almloff
219c068283 Merge branch 'master' into events-2 2023-09-17 20:01:21 -05:00
Evan Almloff
c55c17cb81 switch to tracing for logging 2023-09-06 17:47:33 -05:00
Evan Almloff
bd38cddc9f fix dioxus core event tests 2023-09-04 19:17:43 -05:00
Evan Almloff
f91eeccca7 add compile test for unsound case 2023-08-09 10:49:47 -07:00
Jonathan Kelley
39e89c1fac
Bump crate versions, fix any publish errors 2023-07-31 18:49:54 -07:00
Jonathan Kelley
f80c3c9ffb
Bump core and interpreter 2023-07-31 18:02:23 -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
4240f8428c
Fix: dont use bumpslab anymore, just box scopestates 2023-07-19 18:40:43 -07:00
Jonathan Kelley
f0128a3150
implement suspense using simpler approach 2023-07-14 17:12:07 -07:00
Jonathan Kelley
17f2de81d6 Remove indexmap from core 2023-07-12 14:22:47 -07:00
Marc Espín
32d4472bfd
fix: Remove duplicated doc links and improved some descriptions (#1167) 2023-07-08 11:04:27 -05:00
Evan Almloff
5f873511c5 use workspace dependancies 2023-06-19 14:29:11 -05:00
Jonathan Kelley
b6463e4b27 bump core 2023-05-04 12:04:21 -07:00
Jonathan Kelley
33397b290d bump core 2023-02-16 12:13:27 -08:00
Jonathan Kelley
6fde323112 bump core version 2023-01-27 23:27:28 -08:00
Jonathan Kelley
b5c7d5cfd9 chore: use 0.2 of bumpslab 2023-01-23 11:45:18 -08:00
Evan Almloff
a0441f686c use main bumpslab branch 2023-01-23 12:48:00 -06:00
Evan Almloff
bdb63d18f3 try a different branch 2023-01-23 08:25:08 -06:00
Evan Almloff
c5f003e41e use git version of bump slab 2023-01-22 21:07:54 -06:00
Evan Almloff
ae028d82f8 use bump slab 2023-01-22 17:16:34 -06:00
Evan Almloff
75932a43e0 Merge branch 'upstream' into add-fuzzing-to-core 2023-01-12 15:17:20 -06:00
Evan Almloff
52d5c8d4e7 update READMEs and tags for the 0.3 release 2023-01-10 10:16:11 -06:00
Evan Almloff
42baadf65d add fuzzing test to dioxus-core 2023-01-05 10:28:07 -06:00
Jonathan Kelley
7f01f61138 feat: publish 0.3 versions of many crates 2023-01-04 14:31:07 -05:00
Evan Almloff
51dba50c04 use BumpBox<Any> and FromAnyValue instead of sync bounds 2023-01-02 14:40:25 -06:00
Evan Almloff
5b1d9c5c8d Merge branch 'upstream' into fix-non-str-attributes 2022-12-30 11:52:55 -06:00
Jonathan Kelley
bd720e2268 fix: use futuresunordered instead of bespoke waker system 2022-12-29 19:53:43 -05:00
Evan Almloff
afd024bcb6 Merge branch 'upstream' into fix-non-str-attributes 2022-12-23 15:53:39 -06:00
Jonathan Kelley
d3be971f4e chore: rollback to option instead of anyhow 2022-12-19 18:06:13 -08:00
Jonathan Kelley
7a4b0d7c2d fix: use stack optimization for replacer 2022-12-19 11:14:01 -08:00
Jonathan Kelley
cc7736302a Merge branch 'master' into fix-non-str-attributes 2022-12-17 01:51:13 -08:00
Jonathan Kelley
5c20e651da fix: get rollover working 2022-12-13 14:44:47 -08:00
=
53b436c684 remove AnyValueBounds and add some docs 2022-12-11 21:40:40 -06:00
=
73ec4abfdf Merge remote-tracking branch 'upstream/master' into fix-non-str-attributes 2022-12-11 21:26:38 -06:00
=
74e9d5977a add sync behind a feature flag 2022-12-11 17:31:15 -06:00