react-hot-loader
Advanced tools
Comparing version 0.1.6 to 0.1.7
16
hot.js
@@ -76,2 +76,16 @@ 'use strict'; | ||
function forceUpdateTree(instance) { | ||
if (instance.forceUpdate) { | ||
instance.forceUpdate(); | ||
} | ||
if (instance._renderedComponent) { | ||
forceUpdateTree(instance._renderedComponent); | ||
} | ||
for (var key in instance._renderedChildren) { | ||
forceUpdateTree(instance._renderedChildren[key]); | ||
} | ||
} | ||
var Component; | ||
@@ -89,3 +103,3 @@ return { | ||
instance._bindAutoBindMethods(); | ||
instance.forceUpdate(); | ||
forceUpdateTree(instance); | ||
}); | ||
@@ -92,0 +106,0 @@ |
{ | ||
"name": "react-hot-loader", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Webpack loader that enables live-editing React components without unmounting or losing their state", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# react-hot-loader | ||
This is a **highly experimental** proof of concept of [React live code editing](http://www.youtube.com/watch?v=pw4fKkyPPg8). | ||
It marries React with Webpack [Hot Module Replacement](http://webpack.github.io/docs/hot-module-replacement.html) by monkeypatching `React.createClass`. | ||
It marries React with Webpack [Hot Module Replacement](http://webpack.github.io/docs/hot-module-replacement.html) by wrapping `React.createClass` calls in a custom function that updates components' prototypes when the changes come in. | ||
Inspired by [react-proxy-loader](https://github.com/webpack/react-proxy-loader). | ||
![](http://f.cl.ly/items/0d0P3u2T0f2O163K3m1B/2014-07-14%2014_09_02.gif) | ||
![](http://f.cl.ly/items/3T3u3N1d2U30380Z2k2D/2014-07-14%2014_05_49.gif) | ||
## Installation | ||
@@ -49,2 +54,3 @@ | ||
Currently, it keeps a list of mounted instances and updates their prototypes when an update comes in. | ||
A better approach may be to make monkeypatch `createClass` to return a proxy object [as suggested by Pete Hunt](https://github.com/webpack/webpack/issues/341#issuecomment-48372300): | ||
@@ -51,0 +57,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8487
195
62