concept: integrate signals

This commit is contained in:
Jonathan Kelley committed 2021-06-30 14:08:12 -04:00
1 parent 7665f2c6cf
commit 93900aac44
10 files changed
+203 -91

No files matched your search

+2 -3
View File
@@ -22,9 +22,6 @@ thiserror = "1"
# faster hashmaps
fxhash = "0.2.1"
# even *faster* hashmaps for index-based types
nohash-hasher = "0.2.0"
# Used in diffing
longest-increasing-subsequence = "0.1.0"
@@ -39,6 +36,8 @@ smallvec = "1.6.1"
# Backs scopes and unique keys
slotmap = "1.0.3"
# backs the fiber system for suspended components
# todo: would like to use something smaller or just roll our own futures manually
futures = "0.3.15"
+8 -1
View File
@@ -42,6 +42,7 @@ pros:
cons:
- cost of querying individual nodes (about 7ns per node query for all sizes w/ nohasher)
- 2-3 ns query cost with slotmap
- old IDs need to be manually freed when subtrees are destroyed
- can be collected as garbage after every render
- loss of ids between renders........................
@@ -54,4 +55,10 @@ cons:
## idea: leak raw nodes and then reclaim them on drop
## idea: bind
# Fiber/Concurrency
Dioxus is designed to support partial rendering. Partial rendering means that not _every_ component will be rendered on every tick. If some components were diffed.
Any given component will only be rendered on a single thread, so data inside of components does not need to be send/sync.
To schedule a render outside of the main component, the `suspense` method is exposed. `Suspense` consumes a future (valid for `bump) lifetime
-2
View File
@@ -377,7 +377,6 @@ pub struct Scope {
pub event_channel: Rc<dyn Fn() + 'static>,
// pub event_queue: EventQueue,
pub caller: Weak<OpaqueComponent>,
pub hookidx: Cell<usize>,
@@ -422,7 +421,6 @@ impl Scope {
// Therefore, their lifetimes are connected exclusively to the virtual dom
pub fn new<'creator_node>(
caller: Weak<OpaqueComponent>,
// caller: Weak<OpaqueComponent<'creator_node>>,
arena_idx: ScopeIdx,
parent: Option<ScopeIdx>,
height: u32,