Live coding hacks

In this section, we will get to see some very intriguing stuff that will leave an expert feeling like a superhero, should he or she ever get into hot water or simply wish to show off. We will discuss loaders that work well with HMR, such as monkey-hot-loader and react-hot-loader, as well as the various uses of eval and __Eval

To begin with, you should note that there is a side effect with HMR. It always evaluates the entire module again when it updates. This includes the dependency chain, which updates to point to new modules. However, we may just want the original module to evaluate the new code, not the entire module. Thankfully, there is a hack around this: using monkey-hot-loader!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.35.77