-
Notifications
You must be signed in to change notification settings - Fork 53
chore(docs): make HMR working properly #1370
Conversation
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #1370 +/- ##
=======================================
Coverage 73.47% 73.47%
=======================================
Files 778 778
Lines 5859 5859
Branches 1726 1726
=======================================
Hits 4305 4305
Misses 1548 1548
Partials 6 6 Continue to review full report at Codecov.
|
38bf553
to
cba38b0
Compare
<div style={{ paddingBottom: '10px' }} /> | ||
{({ element, error, markup }) => ( | ||
<> | ||
<Provider.Consumer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need Provider.Consumer
more there
} | ||
}) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This stuff will be done by react-hot-loader
import PopupsPrototype from './prototypes/popups' | ||
import IconViewerPrototype from './prototypes/IconViewer' | ||
import MenuButtonPrototype from './prototypes/MenuButton' | ||
import AlertsPrototype from './prototypes/alerts' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// https://github.com/webpack/webpack/issues/834#issuecomment-76590576 | ||
module.hot.accept(exampleSourcesContext.id, () => { | ||
exampleSourcesContext = require.context('docs/src/exampleSources/', true, /.source.json$/) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Context should be updated separately.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 should we organize a session to test the docs to be sure we didn't break something?
@Bugaa92 at least it doesn't make anything worst 😸 It will affect only local development... I will merge it and will be able to detect and fix more cases, so I am opened for feedback when more people will be able to perform live test |
Related #508.
This PR updates:
react-hot-loader
to use their modenhot()
APIreact-source-render
, I rewrote it to omit React Context (use only render props) and be compatible with HMR (unstable_hot
prop)Works properly
Still broken
Provider
Occurred because there is an issue with lost context: gaearon/react-hot-loader#1207