You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would be an identity function in production, and RHL patcher in development. RHL would emit additional code to keep track of current module so withHotReload knows which module to attach to.
Finally, with ES7 decorators (next version of Babel will support them), we can write this as
Now that we talk about Babel, there's another, much more fun option. If Babel had a transform that wraps each class declaration into a specified function, we would not need this trickery at all. What do you think @sebmck?
The text was updated successfully, but these errors were encountered:
Currently RHL only knows about the exported classes.
If you export a function, you need to use
module.makeHot
API provided by the hot loader:This API is overly verbose and I don't like it.
Instead, we can do some magic to make this work:
This would be an identity function in production, and RHL patcher in development. RHL would emit additional code to keep track of current
module
sowithHotReload
knows which module to attach to.Finally, with ES7 decorators (next version of Babel will support them), we can write this as
Now that we talk about Babel, there's another, much more fun option. If Babel had a transform that wraps each class declaration into a specified function, we would not need this trickery at all. What do you think @sebmck?
The text was updated successfully, but these errors were encountered: