GithubHelp home page GithubHelp logo

gaearon / react-hot-api Goto Github PK

View Code? Open in Web Editor NEW
88.0 7.0 23.0 458 KB

(Deprecated) A generic library implementing hot reload for React components without unmounting or losing their state

JavaScript 99.86% Shell 0.14%

react-hot-api's Introduction

Deprecation Notice

Don’t use this for new projects.
React Proxy is much more advanced, has a better API, and is covered by tests.

React Hot API

You can read the README before deprecation if you want to.

react-hot-api's People

Contributors

benoitzugmeyer avatar dmnd avatar gaearon avatar knpwrs avatar slorber avatar syranide avatar themouette avatar wchargin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-hot-api's Issues

Add tests

It would be much easier now due to cleaner separation.

Here's what tests should do:

  • Have “versions” of classes, like ComponentBeforeUpdate, ComponentAfterUpdate
  • Test that certain behavior changes after applying update:
    • render returns a different tree;
    • methods previously put into setTimeout also execute new code after update.
  • Verify that component doesn't lose state and doesn't unmount

Basically verify that patching works correctly. Edge cases to consider:

  • All component styles (createClass, extends React.Component in 0.13+, plain object in 0.13+)
  • Components with shouldComponentUpdate returning false

ES6 class constructor not hot-updated?

Sorry if this has been answered elsewhere (or if there's a good technical reason), but it seems that constructors in ES6 classes aren't hot-updated like the rest of the class is?

add new beta 0.14 to peerDependencies

As far as I understand, NPM messes up when trying to depend both 0.14.0-beta1 and on libraries that has declared React as a peerDependency.

For example

    "react": "0.14.0-beta1",
    "react-date-picker": "2.0.15",

Does not work well because react-date-picker has peerDependency >= 0.13.0

I've seen this commit which seems to be your solution to this problem (that I could validate on my computer for react-date-picker), so I simply add 0.14.0-beta1 to the list.
c11de6c

By the way, isn't there any better solution? Should I contact every lib author to make the change so that I'm able to use that beta? :'(

peerDependencies break npm install [email protected]

Should we change 0.14.0-beta1 to 0.14.0-beta3?

"peerDependencies": {
    "react": ">=0.11.0 || 0.13.0-beta.1 || 0.13.0-rc1 || 0.13.0-rc2 || 0.14.0-beta1"
 },

Also 0.13.0-beta.1 || 0.13.0-rc1 || 0.13.0-rc2 can be safely removed now?

Hot-replace statics

Currently statics are not being hot-replaced. We want to support that—both for traditional createClass style and for ES6 classes.

Crashes when factory is exported

If I export a factory obtained with React.createFactory(), hot loader currently crashes:

makePatchReactClass.js: Cannot read property 'render' of undefined

While exporting factories is a discouraged pattern, we should still avoid throwing.
(And ideally, support hot reloading for exported factories.)

React 15 for peerDependencies

Hi @gaearon,
I understand that react-hot-api is deprecated, but could you update the peerDependencies? Seems like everything works with React 15.0.0-rc.1, but I'm getting the peer invalid error when I shrinkwrap my packages.

Calling makeHot twice results in stack overflow

Calling makeHot twice on the same component will cause a stack overflow.

For example:

App = makeHot(App, 'App');
App = makeHot(App, 'App');

This happens because we treat patched prototype as source of truth, but it has already been processed.

Uncaught TypeError: Cannot set property updatePosition

I meet a strange question and I can't find out the reason. This problem appear after I updated a npm package. Can someone give me some promote?

makeAssimilatePrototype.js:21 Uncaught TypeError: Cannot set property updatePosition of #<t> which has only a getter
    at patchProperty (webpack:///./~/react-hot-api/modules/makeAssimilatePrototype.js?:21:16)
    at eval (webpack:///./~/react-hot-api/modules/makeAssimilatePrototype.js?:52:9)
    at Array.forEach (native)
    at eval (webpack:///./~/react-hot-api/modules/makeAssimilatePrototype.js?:51:51)
    at Array.forEach (native)
    at reconcileWithStoredPrototypes (webpack:///./~/react-hot-api/modules/makeAssimilatePrototype.js?:50:21)
    at assimilatePrototype (webpack:///./~/react-hot-api/modules/makeAssimilatePrototype.js?:63:5)
    at patchReactClass (webpack:///./~/react-hot-api/modules/makePatchReactClass.js?:40:5)
    at Object.makeHot (webpack:///./~/react-hot-api/modules/makeMakeHot.js?:33:12)
    at makeExportsHot (webpack:///./~/react-hot-loader/makeExportsHot.js?:44:26)

My ENV

  • node v7.7.3
  • npm 4.1.2

Fall back to ReactUpdateQueue on 0.13 components

Thoughts on fallback to ReactUpdateQueue.enqueueForceUpdate on react-0.13 components not created using React.createClass and that don't extend React.Component?
Here is an example using a patched loader and api that uses the fallback

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.