BerndWessels / preact-redux-isomorphic

preact-redux-isomorphic PWA SPA SSR best practices and libraries in under 80kB page size (for live demo click the link below)

Home Page:https://berndwessels.github.io/preact-redux-isomorphic/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HMR?

kurtextrem opened this issue · comments

Very cool project, thank you!

Any plans for hot module reloading (using webpack)? Or maybe: https://github.com/porsager/Wright

@kurtextrem It already supports webpack's HMR:

    /**
     * Enable hot module reloading in development mode.
     */
    if (process.env.NODE_ENV === 'development') {
      if (module.hot) {
        // Handle updates to the components.
        module.hot.accept('./component', () => {
          console.log('Updated components');
          renderRoot();
        });
        // Handle updates to the reducers.
        module.hot.accept('./reducer', () => {
          console.log('Updated reducers');
          let rootReducer = require('./reducer').default;
          store.replaceReducer(rootReducer);
        });
        // Handle updates to the epics.
        module.hot.accept('./epic', () => {
          console.log('Updated epics');
          let rootEpic = require('./epic').default;
          epicMiddleware.replaceEpic(rootEpic);
        });
      }
    }

I also tried react-hot-loader v3 already but its not good enough yet.

I will definitely look into Wright - haven't heard about it before, but looks extremely interesting.

Thanks