flimsy
reactively
Our great sponsors
flimsy | reactively | |
---|---|---|
2 | 3 | |
177 | 381 | |
- | - | |
5.9 | 4.5 | |
2 months ago | 6 months ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
flimsy
-
Super Charging Fine-Grained Reactive Performance
An implementation of this might look like the following (code by Fabio Spampinato):
-
Preact Signals
These are difficult to understand concepts imo. I have written an annotated implementation of a simple reactive system (you may want to run it through Prettier if that's your thing): https://github.com/fabiospampinato/flimsy/blob/master/src/fl...
A signal is basically a function that you have to go through to read and write a value. In the case of Preact the function is split into getter and setter assigned to the "value" property. The interesting thing about signals is that they can tell their parent computation to re-execute, automatically, without any manual dependency array.
A computed is a signal generated from a function rather than a primitive. So like the function that generates the value is re-executed automatically whenever any of the signals read inside it change.
reactively
-
Reactive WebGPU
But what if the vertices change? What if the user changes the shape and number of the tiles while the video is playing? In that case, we will need to update the buffer. Reactively can handle that situation automatically. Reactively tracks dependencies and will re-execute the body of the getter if the dependencies change, vertexBuffer will create a new GPUBuffer as required. In this case, shapeVerts might change if the user changes the size and shape of the mosaic tiles in the control panel and then it would be appropriate to rebuild the GPUBuffer for new vertices for the next rendered frame.
-
Super Charging Fine-Grained Reactive Performance
Adding on to Ryan's comment, Reactively actually does have an object oriented syntax using typescript decorators that is built around the core library
Reactivity libraries are at the heart of modern web component frameworks like Solid, Qwik, Vue, and Svelte. And in some cases you can add fine-grained reactive state management to other libraries like Lit and React. Reactively comes with a decorator for adding reactive properties to any class, as well as prototype integration with Lit. Preact Signals comes with a prototype integration with React. Expect more integrations as these reactivity cores mature.
What are some alternatives?
signals - Manage state with style in every framework
solid-docs - Cumulative documentation for SolidJS and related packages.
usignal - A blend of @preact/signals-core and solid-js basic reactivity API
dependable-example-todomvc - TodoMVC example in @dependable/view
thimbleberry - WebGPU utilities
dependable-example-hackernews - Hackernews example using @dependable
cellx - The ultra-fast implementation of reactivity for javascript
dependable-state - Observables and computeds for state management
jotai - 👻 Primitive and flexible state management for React
solid - A declarative, efficient, and flexible JavaScript library for building user interfaces.