- Components can be created at runtime via
createClass
- Stringified and parsed
- Existing DOM can be parsed via a "mount" algorithm.
- React is event based and not "frame" based. It's not using a timer. DOM changes are cached until all events are done and flushed at once.
setState
triggers DOM changes explicitly
- Objects have
injection
property that holds setters for injecting dependencies - DOM is abstracted. Modules like
performanceNow
are usingDate.now()
fallback in case DOM (or performance.now) is not available
Holds a task. A task that can be cached, pooled, queued and allows other transactions to wait until previous tasks are resolved.
var transaction = perform(function() { doSth(); }); release(transaction);
There are hints that they tried but failed using WebWorkers (internally called "ReactWorker") so far. Apparently preventDefault
was one of the problems they ran in to while running a Component within a separate thread. Maybe a future use case could be performing "Transactions" within a worker.
- License: http://www.apache.org/licenses/LICENSE-2.0
- Commonjs by default / supports amd too
- Coding guidelines completely reasonable. Nothing fancy.
- Compiler hinting, logging and assertions (including best practice suggestions) all over the place
if (__DEV__)
,if ("production" !== "development") {
invariant(true, 'Must be true')
;
- Some functions are "measured" at runtime. E.g. Time spend to mount a Component. Results are reported somehow. I guess mostely via console.
- Function naming known from Cocoa
componentWillMount
componentDidMount
release
- object pooling
- services (performance.now())