Skip to content

Commit 56797a4

Browse files
authored
docs: add more information to the reactivity overview (#10522)
1 parent 6ecbcf6 commit 56797a4

4 files changed

Lines changed: 36 additions & 5 deletions

File tree

docs-viewer/docs.warp-drive.io/.vitepress/theme/custom.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ html:not(.dark) .dark-only {
66
display: none !important;
77
}
88

9+
.vp-doc figure {
10+
margin: 1.5rem 0;
11+
text-align: center;
12+
}
13+
14+
.vp-doc figure img {
15+
display: inline-block;
16+
}
17+
18+
.vp-doc figcaption {
19+
margin-top: 0.5rem;
20+
font-size: 0.8rem;
21+
color: var(--vp-c-text-2);
22+
font-style: italic;
23+
line-height: 1.4;
24+
}
25+
926
.VPSidebarItem .level-1 > .item > p.text {
1027
font-weight: 600;
1128
color: var(--vp-c-text-1);

guides/images/signals-diagram-dark.svg

Lines changed: 4 additions & 0 deletions
Loading

guides/images/signals-diagram-light.svg

Lines changed: 4 additions & 0 deletions
Loading

guides/the-manual/reactivity/index.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ title: Overview
66

77
<img src="../../images/signals.png" style="height: 150px; float: right; margin: 1em; padding: 2em 0 2em 4em; border-left: .05em solid #999999;" title="" alt="">
88

9-
WarpDrive relies on [signals](https://github.com/tc39/proposal-signals#readme) to enable universal fine-grained reactivity, but where most projects choose a specific signals implementation for consumers to use, WarpDrive allows you to bring your own or use your framework's.
9+
***Warp*Drive** relies on [signals](https://github.com/tc39/proposal-signals#readme) to enable universal fine-grained reactivity, but where most projects choose a specific signals implementation for consumers to use, ***Warp*Drive** allows you to **bring your own or use your framework's**.
1010

11-
The concept is simple: instead of relying on specifics of signal implementations that may differ, we use signals purely as just that - a signal. The signal itself is never responsible for managing state, storage, or value comparisons.
11+
The concept is simple: instead of relying on specifics of signal implementations that may differ, **we use signals purely as just that - a signal**. The signal itself is never responsible for managing state, storage, or value comparisons.
1212

13-
Lightweight hooks translate the basic create/consume/notify signal operations into implementation specifics for one (or more) signal libraries.
13+
Lightweight hooks translate the basic *create/consume/notify* signal operations into implementation specifics for one (or more) signal libraries.
1414

15-
This enables us to be compatible with even the most lightweight and performant signals implementations. The simplicity of this approach keeps WarpDrive relatively future-proof should the spec significantly change or fail to advance. Of course, we hope it becomes a first-class language feature!
15+
This enables us to be compatible with even the most lightweight and performant signals implementations. The simplicity of this approach keeps ***Warp*Drive** relatively future-proof should the spec significantly change or fail to advance. Of course, we hope it becomes a first-class feature of both the language and web APIs!
1616

1717
Signals are used to alert the reactive consumers to changes in the underlying cache. E.g. a signal is associated to a value, but does
1818
not serve as the cache for that value directly. We refer to this as
1919
a "gate", though the pattern has also been referred to as "side-signals".
2020

21-
We find this approach naturally solves many of the concerns and limitations given around various signals implementations, and fits WarpDrive's specific use cases exceedingly well. WarpDrive manages
21+
<figure>
22+
<img class="dark-only" src="../../images/signals-diagram-dark.svg" alt="management of signals in WarpDrive" width="100%">
23+
<img class="light-only" src="../../images/signals-diagram-light.svg" alt="management of signals in WarpDrive" width="100%">
24+
<figcaption>WarpDrive uses Side Signals</figcaption>
25+
</figure>
26+
27+
We find this approach naturally solves many of the concerns and limitations given around various signals implementations, and fits ***Warp*Drive**'s specific use cases exceedingly well. ***Warp*Drive** manages
2228
normalized caches of raw data - usually json - that are typically asynchronously retrieved from latent sources. By separating signal from storage, we can safely perform cache updates even when multiple asynchronous steps are involved to do so, while only notifying consumers when updates are complete.

0 commit comments

Comments
 (0)