-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
458 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
target | ||
target | ||
yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
react-dom - hot-loader edition | ||
===== | ||
This is normal `react-dom` with some patches applied to be more | ||
[React-Hot-Loader](https://github.com/gaearon/react-hot-loader) friendly. | ||
|
||
Use it to obtain more 🔥 dev experience. | ||
|
||
# Differences from react | ||
There are just 4 lines changed, see `patch.js` for details | ||
|
||
# Using this module | ||
|
||
## Install | ||
```text | ||
yarn add @hot-loader/react-dom@YOUR_REACT_VERSION | ||
``` | ||
> Right now only 16.7.0-alpha.2 version is available | ||
## Rewire | ||
To use this version of React-dom you have to rewire your application | ||
|
||
### Webpack | ||
just configure your webpack to alias this package, instead of a real react-dom. | ||
See https://webpack.js.org/configuration/resolve/#resolve-alias | ||
```js | ||
// webpack.conf | ||
... | ||
resolve: { | ||
alias: { | ||
'react-dom': '@hot-loader/react-dom' | ||
} | ||
} | ||
... | ||
``` | ||
You may set configuration to only use react-🔥-dom only in dev mode. | ||
### Parcel | ||
Use `alias` field in `package.json` to rewire your project. This will affect dev and production modes. | ||
See https://github.com/parcel-bundler/parcel/pull/850 | ||
```js | ||
{ | ||
"alias": { | ||
"react-dom": "@hot-loader/react-dom" | ||
} | ||
} | ||
``` | ||
|
||
### (Yarn) Any other system | ||
For any other build system, which may not support aliasing - use yarn name resolution. | ||
See https://twitter.com/sebmck/status/873958247304232961?lang=en for details. | ||
```text | ||
yarn add @hot-loader/react-dom@npm:react-dom | ||
``` | ||
|
||
# Using webpack-loader | ||
React-hot-loader's webpack-loader could land necessary patches on | ||
build time. If you can use it instead of this package, if you can. | ||
|
||
# Production ready | ||
production bundle, exported by this package is __identical to the original | ||
react-dom.production.min.js__. It is safe to keep rewiring in production. | ||
|
||
|
||
# License | ||
React is MIT licensed. This library is still react |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.