Comments (8)
Here are some links to the implementation Ember has (pretty over complicated, but includes all the key stuff):
- ember-metal/lib/computed.js
- ember-metal/lib/run_loop.js
- ember-metal/lib/observer.js
- ember-metal/lib/events.js
- ember-metal/lib/watching.js
Specifically, observer.js#L63-L72 shows how property changes are batched up.
from reactive.
you're free to implement whatever you want really with components, I think if everything was coupled to it that would be the wrong abstraction though. I wouldn't try to cheat browsers too much, they have all sorts of tricks to avoid unnecessary painting etc, plus we can profile these sorts of things for individual components
from reactive.
This is a problem with most/all frameworks that have tried to implement binding, just seems like there should be a standard component/solution to the issue. This is one area where the browsers don't have the appropriate tricks, though they're starting to with the shadow dom and built-in observers.
from reactive.
still, a component is just an arbitrary chunk of js, so we can implement things without coupling everything else to it. Just like Emitter happens to be what I use for lots of things, it's not the canonical component solution or anything like that, but that's the great thing about component, you're only opting in to smaller chunks of logic vs a massive framework. For right now I'd favour a nice api over a mess like ember, if anyone hits perf issues we can look into it. So far our app is a lot more responsive than ember stuff like travis etc, anything else would be a premature optimization IMO
from reactive.
Essentially all you need in order to make everything optionally run-loop compatible is a way to opt into do-nothing-until-I-call-flush mode. Then call flush in your run loop as often or infrequently as you like.
So, any chance for that mode in reactive?
from reactive.
that should be pretty easy with the adapters, just queue up changes and remove dups etc
https://github.com/component/reactive/blob/master/test/adapters.js#L18
we have a lotttt of moving parts in our app and have yet to see any slow downs from rendering that aren't related to image decoding, that's about the only problem we have right now
from reactive.
decided with the upcoming changes it would be good to get these in, but we definitely can do it in ~30 or less lines of code, we don't need all that crazyness, however I still think we should do some thorough profiling. Re-rendering attributes or text multiple times in a tick may be less expensive on average than managing duplicates, or it might be completely negligible, I have an example with 1500 dom reactive templates and it barely registers on the profiler
from reactive.
I think dom stuff already handles waiting on painting until it has to tho request animation frame might be good to throw in the bindings. A runloop is out of scope for now tho.
from reactive.
Related Issues (20)
- Is this a normal behavior ? HOT 1
- 3rd parameter in custom bindings HOT 3
- 2.x HOT 8
- data-{visible|hidden} not reacting to changes HOT 3
- `null` wrapped in a `reactive.get` HOT 5
- Access the parent model/view from `each`'s subView HOT 2
- Question: model.emit('change prop') stable? HOT 1
- on-select support for <select />s HOT 1
- destroy() doesn't work when multiple elements created
- question: any complex examples with reactive?
- propagation doesn't work with set() and nested object
- FIY: touch plugin HOT 1
- Child binding HOT 3
- Global functions HOT 5
- Reactive should interpolate functions HOT 4
- Getting weird behavior with duo and v1.2.0? HOT 11
- Array length
- multiple levels of (nested) properties HOT 2
- model change doesn't update the view with data-text HOT 1
- emit in defaults.html not working HOT 1
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 reactive.