All Projects → NoamELB → React Hot Loader Loader

NoamELB / React Hot Loader Loader

Licence: mit
A Webpack Loader that automatically inserts react-hot-loader to your App 👨‍🔬

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Hot Loader Loader

Sass Vars Loader
Use Sass variables defined in Webpack config or in external Javascript or JSON files
Stars: ✭ 112 (-36.36%)
Mutual labels:  webpack, hmr, loader
Node Hot Loader
Hot module replacement (hot reload) for Node.js applications. Develop without server restarting.
Stars: ✭ 111 (-36.93%)
Mutual labels:  webpack, hmr, loader
Angular Hmr
🔥 Angular Hot Module Replacement for Hot Module Reloading
Stars: ✭ 490 (+178.41%)
Mutual labels:  webpack, hmr, loader
Bad Ass Salesforce Stack
B.A.S.S. Starter: react / redux / typescript / antd / ts-force / sfdx / webpack / salesforce
Stars: ✭ 126 (-28.41%)
Mutual labels:  webpack, hmr
Style Loader
Style Loader
Stars: ✭ 1,572 (+793.18%)
Mutual labels:  webpack, loader
Todolist Frontend Vuejs
Front-end application for Todolist Web application built with Laravel and Vue.js
Stars: ✭ 120 (-31.82%)
Mutual labels:  webpack, hmr
Workflow
一个工作流平台
Stars: ✭ 1,888 (+972.73%)
Mutual labels:  webpack, loader
Create Elm App
🍃 Create Elm apps with zero configuration
Stars: ✭ 1,650 (+837.5%)
Mutual labels:  webpack, hmr
Kirby Webpack
💪 A Kirby CMS starter-kit with modern frontend tools
Stars: ✭ 150 (-14.77%)
Mutual labels:  webpack, hmr
Img Loader
Image minimizing loader for webpack
Stars: ✭ 161 (-8.52%)
Mutual labels:  webpack, loader
Webpack Fast Refresh
React Fast Refresh plugin and loader for webpack
Stars: ✭ 155 (-11.93%)
Mutual labels:  webpack, loader
Ts Tools
TypeScript Tools for Node.js
Stars: ✭ 162 (-7.95%)
Mutual labels:  webpack, loader
Reeakt
A modern React boilerplate to awesome web applications
Stars: ✭ 116 (-34.09%)
Mutual labels:  webpack, hmr
Webpack Hot Client
webpack HMR Client
Stars: ✭ 116 (-34.09%)
Mutual labels:  webpack, hmr
Aot Loader
⚠️ [Deprecated] Ahead-of-Time Compiler for Webpack.
Stars: ✭ 121 (-31.25%)
Mutual labels:  webpack, loader
Meteor Webpack
https://medium.com/@ardatan/meteor-with-webpack-in-2018-faster-compilation-better-source-handling-benefit-from-bc5ccc5735ef
Stars: ✭ 116 (-34.09%)
Mutual labels:  webpack, hmr
Omil
📝Webpack loader for Omi.js React.js and Rax.js components 基于 Omi.js,React.js 和 Rax.js 单文件组件的webpack模块加载器
Stars: ✭ 140 (-20.45%)
Mutual labels:  webpack, loader
Vue Svg Inline Loader
Webpack loader used for inline replacement of SVG images with actual content of SVG files in Vue projects.
Stars: ✭ 105 (-40.34%)
Mutual labels:  webpack, loader
Webpack Config Handbook
Minimum Webpack config handbook & examples
Stars: ✭ 165 (-6.25%)
Mutual labels:  webpack, loader
Vue Webpack Config
Koa2、Webpack、Vue、React、Node
Stars: ✭ 151 (-14.2%)
Mutual labels:  webpack, loader

react-hot-loader-loader

A Webpack Loader that automatically inserts react-hot-loader to your app, without any changes in your app code.

All it takes is a simple regex to indicate where your "App" Components are. This module does nothing if NODE_ENV is set to production.

Example:

react-hot-loader-loader example

This example code (A very informative webpack example)

Usage

  1. Install
npm i react-hot-loader-loader
  1. In your Webpack configuration, add this loader:
{
    test: /\/App\.js$/, // regex to match files to receive react-hot-loader functionality
    loader: require.resolve('react-hot-loader-loader'),
}

This loader must be placed after any ES6 transpiling loader (Babel), to make sure it transforms the code before it.

  1. Add react-hot-loader to your Babel plugins:
{
  "plugins": ["react-hot-loader/babel"]
}

Working project example with HMR, react-hot-loader and error recovery.

The loader is dependent on react-hot-loader v4+, and won't work with earlier versions.

How it works?

react-hot-loader is amazing! It exposes an HOC that does all the heavy lifting. It can wrap any component and will add real time components tweaking functionality while using HMR.

This Webpack loader just make things cleaner and easier, wrapping components with this HOC for you. All that from a Webpack configuration and not from inside Components.

This component:

import React from 'react';

export default class App extends React.Component {
    render() {
        return 'something';
    }
}

Will transform to this (before ES6 transpilation):

import {hot} from 'react-hot-loader';
import React from 'react';

class App extends React.Component {
    render() {
        return 'something';
    }
}
export default hot(module)(App);

See the test for many more examples.

Pros

  • Easier to control through configuration, just decide a convention and then there is no need for any additional code in an app.
  • No need to refactor old code.
  • Allows dynamic control, for example by using a command flag.
  • You can remove the loader on certain Webpack configurations.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].