-
Notifications
You must be signed in to change notification settings - Fork 800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drop hot
calls for prod mode
#1081
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1081 +/- ##
==========================================
+ Coverage 86.9% 87.18% +0.28%
==========================================
Files 31 32 +1
Lines 840 874 +34
Branches 194 206 +12
==========================================
+ Hits 730 762 +32
- Misses 91 93 +2
Partials 19 19
Continue to review full report at Codecov.
|
Now supports all import cases:
|
Amazing! Just amazing! |
Are there any comments for this? ) |
Gonna handle this and another pending PRs on weekends. |
Released in 4.3.12 |
Thanks :) |
Hi! I don't see any change in the babel output when using default exports. Is this expected? eg: import React from 'react'
import { hot } from 'react-hot-loader'
const App = () => <div>Hello World!</div>
export default hot(module)(App) |
@edmorley Hi! |
Yup, this is with |
## The devDependency [react-hot-loader](https://github.com/gaearon/react-hot-loader) was updated from `4.3.11` to `4.3.12`. This version is **not covered** by your **current version range**. If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update. --- <details> <summary>Release Notes for v4.3.12</summary> <h3>Bug fixes</h3> <ul> <li>babel plugin will remove calls to <code>hot</code> in production mode to remove side-effect on webpack <a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/pull/1081" data-hovercard-type="pull_request" data-hovercard-url="/gaearon/react-hot-loader/pull/1081/hovercard">#1081</a></li> <li>class methods, deleted on update, will be deleted from proxy <a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/pull/1091" data-hovercard-type="pull_request" data-hovercard-url="/gaearon/react-hot-loader/pull/1091/hovercard">#1091</a></li> </ul> </details> <details> <summary>Commits</summary> <p>The new version differs by 14 commits.</p> <ul> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/8d8763d5d6e2fd477a04d36144744bd8ac19a8b5"><code>8d8763d</code></a> <code>chore(release): 4.3.12</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/a6e97c8f07e173d80e554148dacf84e733de13bd"><code>a6e97c8</code></a> <code>Merge pull request #1081 from smelukov/drop-hot-for-prod</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/847b5cd8d68dd46088d709d4b85a58d08b8bcde9"><code>847b5cd</code></a> <code>Merge pull request #1091 from bradennapier/remove-generational-methods</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/08f7457435af7df46b114a629031b9529025ccae"><code>08f7457</code></a> <code>remove all removed methods from proxy prototype</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/2a6a8bbc21887fb02d8405b532dee957e4ab901b"><code>2a6a8bb</code></a> <code>change to use property check in jest</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/5b5ef8ae4ab1d3d05ce9f1880e65a2fee74e3e49"><code>5b5ef8a</code></a> <code>add test case</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/db489955759bc10eaf80a1efe5a2f0d0e752f83d"><code>db48995</code></a> <code>remove certain members if removed from prototype</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/21cfe37f58e436d0c795d5be7926040d879f7f04"><code>21cfe37</code></a> <code>Merge pull request #1086 from andfelzapata/Fix_Grammar_Mistake_OpenedModules_Console_Warning_Comment</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/00e5aed30567bdea05c21938dd28b1a534ab3c36"><code>00e5aed</code></a> <code>Fix grammar mistake in commment</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/f7b922c2c9136c8c7ab29f373c97f3d9d1e32d67"><code>f7b922c</code></a> <code>support all import cases</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/308f35ea709b5871c073873fa27570059fbe127a"><code>308f35e</code></a> <code>drop <code>hot</code> calls for prod mode</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/696da9baa258d841715a77737b896f2c5d643460"><code>696da9b</code></a> <code>Merge pull request #1065 from PavelGavlik/patch-1</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/972d1eb688b2ecb739453ff9d35c26aae4aaa399"><code>972d1eb</code></a> <code>chore(examples): add example with uglifyjs, #1074</code></li> <li><a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/commit/e08f95b331f6b227cdc97b4db980990906593075"><code>e08f95b</code></a> <code>Remove link that leads to 404</code></li> </ul> <p>See the <a href="https://urls.greenkeeper.io/gaearon/react-hot-loader/compare/28bab4cc92ebf897681e197bec00125314eed86b...8d8763d5d6e2fd477a04d36144744bd8ac19a8b5">full diff</a></p> </details> <details> <summary>FAQ and help</summary> There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new). </details> --- Your [Greenkeeper](https://greenkeeper.io) bot 🌴
`react-hot-loader` internally uses `process.env.NODE_ENV` conditionals to make most of its functionality a no-op when in production. Previously the production Babel plugin was a no-op too, however after gaearon/react-hot-loader#1081 and gaearon/react-hot-loader#1093 it now replaces instances of `hot(module)(App)` with `App`. In addition to removing a few lines of RHL code, this allows webpack to now perform its module concatenation optimization, and avoids Content-Security-Policy script-src `unsafe-eval` false positives. This change is compatible with all versions of RHL 4, however to see the benefit, users will need to upgrade to >=4.4.0 (in beta).
closes #1080