Comments (4)
It does not technically need to be serializable, but it does need to be easy to proxy and generally not use any methods for access. Maps/Sets, for example do not work because they would require that we extend the proxy surface area to all their methods. If you had a custom class that used simple property access myInstance.foo = 123
and myInstance.foo
then it should work fine. POJOs are the "safest" bet at the moment.
Of course arrow is experimental, so we could decide to make this more comprehensive, but I’d like to really stick to a tight byte budget here.
from arrow-js.
It might be worth a few bytes to special case Map
, In my experience it that's a pretty foundational type.
I respect your byte budget goal, though. It is possible to use objects, but the ergonomics of Map
really are a lot better.
Maybe it would be possible to provide a way for users to extend the proxying mechanism, so that it would
be possible for users to add support for types without needing to include that in the main library?
I think keeping the core simple is a worthy goal in and of itself though.
from arrow-js.
+1 to the idea of letting users extend reactivity support. It seems friendly enough to let someone provide a third party "make more types work with reactivity" library.
from arrow-js.
I love the idea of providing a reactivity plugin mechanism. I will definitely work that into the next refactor.
from arrow-js.
Related Issues (20)
- Component from the DOM HOT 7
- TypeScript type for nested, optional reactive objects is broken HOT 1
- FYI: textarea behavior is very funky if you try to put HTML inside it rather than using the 'value' attribute HOT 2
- [Question] Are there ways to integrate with hyperscript interfaces? HOT 4
- Script throwing "Illegal Invocation" when adding an object to a reactive array HOT 2
- How does watch function work? HOT 2
- Cross-Site Scripting Vectors (XSS) HOT 5
- Dark mode flashbang 🫣 HOT 1
- Rewrite a reactive property which has $on event throw error
- [bug] Docs navigation indicator is bugged scrolling past "Getting Started" HOT 1
- Element property syntax not working HOT 1
- Map, Set, WeakMap, WeakSet can't be wrapped successfully HOT 4
- Nested template being called unexpectedly HOT 2
- Array of text boxes without a good key? HOT 2
- Poor performance? HOT 1
- Binding reactively to array length HOT 2
- How to unwatch HOT 2
- Component that changes a sub-property of its own state object by async method re-renders the whole component in an infinite loop HOT 6
- Can it support the CommonJS
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arrow-js.