Skip to content
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

React Hot Loader 3 #240

Merged
merged 183 commits into from
Feb 28, 2017
Merged

React Hot Loader 3 #240

merged 183 commits into from
Feb 28, 2017

Conversation

gaearon
Copy link
Owner

@gaearon gaearon commented Apr 17, 2016

Work in progress.
(We are skipping 2 because the approach is way too different from 2 alpha which went nowhere).

Some info here: gaearon/react-hot-boilerplate#61

This removes a few of the error messages that are only applicable in
development, which saves a few bytes in production builds.
@ntucker
Copy link

ntucker commented Jan 6, 2017

Whenever I change a module, the console logs say it's updated, but nothing changes. I did some tracking on module updates:

  • Changed module is being executed
  • Component render function is being run
  • However, the module code is still old (changing the console.log message doesn't get reflected).

Is webpack somehow not actually updating the code, but just re-executing the existing modules? (I'm using webpack 1.14.0)

@dobryanskyy
Copy link

@ntucker were you able to solve the issue? I'm experiencing quite similar one

@ntucker
Copy link

ntucker commented Feb 1, 2017

@dobryanskyy nope, still broken.

@rolandfung
Copy link

I have multiple applications in the same repo, so I use a wrapper function that takes in the root element, store and controller as the parameters (I'm using Cerebral.js). Changes in application files are being detected but I get full reload each time in the browser. Is my usage of this wrapper causing the problem? I am on RHL3 beta 6 and webpack 1.13.2.

let getAppWrapper = (App, controller, store) => {
    @root(store)
    class AppWrapper extends React.Component {
        render() {
            return (
                <Container controller={controller}>
                    <MuiThemeProvider>
                        <App {...this.props}>
                            {this.props.children}
                        </App>
                    </MuiThemeProvider>
                </Container>
            );
        }
    }
    return AppWrapper;
};

@ismay
Copy link

ismay commented Feb 23, 2017

@rolandfung I'm experiencing the same problem (full reload on changes), with hot-loader beta6 and webpack 2.2.0:

// abstract render for hot reloading
const renderWithHotReload = AppComponent => {
  render(
    <AppContainer>
      <AppComponent store={store} />
    </AppContainer>,
    document.getElementById('app')
  )
}

// initial render
renderWithHotReload(App)

// enable hot reloading, will be stripped in production
if (process.env.NODE_ENV !== 'production' && module.hot) {
  module.hot.accept('./components/app', () => {
    const NextApp = require('./components/app').App
    renderWithHotReload(NextApp)
  })
  module.hot.accept('./rootReducer', () => {
    const nextRootReducer = require('./rootReducer').default
    store.replaceReducer(nextRootReducer)
  })
}

Code here. Apologies if this isn't the place to post this (but thought it would be valuable in case it's a bug).

@wkwiatek wkwiatek merged commit 9146001 into master Feb 28, 2017
@SimenB
Copy link

SimenB commented Feb 28, 2017

Woo! 🎉

@wkwiatek
Copy link
Collaborator

Just to keep you up-to-date.

We're now finalizing docs, and have 3 more bugs to solve that are blockers for final release. All of these are on the behalf of react-proxy.

We agreed to merge next to the master as some people had problem with starting with React Hot Loader, and v1 is now stale.

@wkwiatek wkwiatek deleted the next branch February 28, 2017 09:04
@SimenB
Copy link

SimenB commented Feb 28, 2017

React-proxy hasn't seen a commit in 11 months, will it be getting some love?
And could you link to the outstanding issues?

@wkwiatek
Copy link
Collaborator

Here are all of them: https://github.com/gaearon/react-hot-loader/milestone/2

I'm going to focus on the react-proxy right after RHL v3 docs are done.

@wkwiatek wkwiatek restored the next branch March 20, 2017 19:21
sbvhev added a commit to sbvhev/formbuilder that referenced this pull request May 27, 2018
The project is now deprecated, see https://github.com/gaearon/react-transform-catch-errors. This commit just removes the feature, while waiting for react hot loader 3 to be ready (gaearon/react-hot-loader#240)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet