Skip to content

Releases: gaearon/react-hot-api

v0.5.0

02 Sep 12:20
Compare
Choose a tag to compare

React Hot API is deprecated!

This is the final release that delegates all processing to React Proxy. See 0.5.0-alpha release notes for migration instructions.

Generally, it's recommended that, instead of migrating to React Hot API 0.5.0, you just use React Proxy because React Hot API is now a thin wrapper around it, and won't be developed further.

v0.4.7

28 Sep 11:35
Compare
Choose a tag to compare
  • Adds React 0.14 compatibility to the legacy 0.4.x branch

v0.5.0-alpha-3

27 Aug 21:43
Compare
Choose a tag to compare
v0.5.0-alpha-3 Pre-release
Pre-release

v0.5.0-alpha-2

24 Aug 10:20
Compare
Choose a tag to compare
v0.5.0-alpha-2 Pre-release
Pre-release
  • Fixes instance leak and rAF being undefined in server environment

v0.5.0-alpha

22 Aug 15:11
Compare
Choose a tag to compare
v0.5.0-alpha Pre-release
Pre-release

React Hot API is superseded by React Proxy. This is meant to be the last release of React Hot API, with the new source code just delegating to React Proxy API.

It is recommended you do not use React Hot API anymore, and migrate projects to use React Proxy directly. There may be some breakage, so please make sure to report it. Unlike React Hot API, React Proxy is fully covered tests. React Hot Loader will also migrate to use React Proxy soon.

Breaking Changes

  • React 0.13 or later is now required.
  • The signature changes from (getRootInstances[, React]) => makeHot to ([getRootInstances,] React) => makeHot. Note: getRootInstances is only there to keep the old calls working, but we no longer need it, and you can safely stop passing it. Conversely, React is now a required argument. Since we expect React 0.13, we expect React.Component to be available.
  • We no longer check whether the passed class has a prototype and a render function. It is up to you now to guarantee that whatever's passed is a valid React component class. When React supports pure functions as components (in 0.14), we'll add support for them to React Proxy.
  • We no longer overwrite or even touch the original class. Every time makeHot is invoked, it will return a special proxy class. This means a caveat: for example, with React Hot Loader, static methods will only be hot-reloaded if you refer to them as this.constructor.doSomething() instead of FooBar.doSomething(). This is because React Hot Loader calls makeHot right before exporting, so FooBar still refers to the original class. Similarly, this.constructor === App will be false inside App unless you call App = makeHot(App) manually, which you can't do with React Hot Loader. I'm not sure how much of a problem this will be, so let me know if it pains you. In the longer term, we will deprecate React Hot Loader in favor of a Babel plugin which will be able to rewrite class definitions correctly, so it shouldn't be a problem for a long time. If there is demand, we can introduce a mode that rewrites passed classes, too.

API Changes

  • The goal of this release is to provide the new features of React Proxy to React Hot API consumers, so, apart from making React a required argument, and ignoring getRootInstances if it is passed, the API stays the same.
  • Nevertheless, if you depend on React Hot API, we suggest you to migrate to React Proxy.

Improvements and Bugfixes

  • There is no requirement to pass getRootInstances() anymore, so React Hot Loader doesn't need react/lib/ReactMount or walk the tree, which was somewhat fragile and changing between versions
  • Static methods and properties are now hot-reloaded
  • Instance getters and setters are now hot reloaded
  • Static getters and setters are now hot reloaded
  • Deleted instance methods are now deleted during hot reloading
  • Single method form of autobind-decorator is now supported

Things that Aren't There

These things didn't make the cut:

  • Error reporting (it is available in #23 but I don't want to support this project without tests so I'll move it)
  • Preserving DOM and state of classes decorated with HOCs. (This will be solved later with Babel plugin.)
  • Hot-reloading ES7 property syntax. (This will probably too be solved later with Babel plugin.)

Help Me Test This!

A React Hot Loader beta using this version will come out soon. Please help me test it! I'm sure there are many cases React Proxy doesn't handle yet, but at least we can write tests for them now.

v0.4.6

21 Aug 18:33
Compare
Choose a tag to compare
  • Allow any 0.14 beta as peer dependency (#26)

v0.4.5

08 Jul 11:01
Compare
Choose a tag to compare
  • Add React 0.14.0-beta1 as a valid peer dependency

v0.4.4

01 May 23:34
Compare
Choose a tag to compare

v0.4.3

10 Mar 04:08
Compare
Choose a tag to compare

Fix bad NPM release

v0.4.2

10 Mar 04:07
Compare
Choose a tag to compare
  • Revert change introduced in 0.4.1: it broke super calls. Instead of trying to flatten the component's prototype, React Hot API will expect you to opt base classes into hot reloading just like you do with regular components.