Hot Module Reloading

Originator:ash
Number:rdar://34875826 Date Originated:8/10/2017
Status:Closed as dupe (34884313) Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:
 
Okay, listen up friends! I've been to the web developer community and it has changed me. I got used to saving a file and having the changes reflected within my software instantly through a technology JavaScript developers call Hot Module Reloading, or HMR. 

When I returned from the far away lands of JavaScript, I became sad and frustrated by how long it took to see my changes reflected in running software. Here's my dream scenario:

I hit save, Xcode recompiles my file (just my file so its really fast) and sends the compiled code over to the simulator. There, it's patched into the runtime. Visible view controllers and the app delegate get a message that the app has been reloaded, so they refresh their contents. I see my changes in under a second.

Sure, it isn't always gonna work. Some files do stuff with the runtime that wouldn't be HMRable. But that's not the point. It's okay if HMR only works nine out of ten times, because I can always do a recompile if something isn't working. HMR doesn't work 100% of the time in JS either, but it still drastically improves the developer experience and drastically decreases the amount of time I spend waiting. I really don't like waiting.

This isn't just fantasy, it already exists: https://github.com/johnno1962/injectionforxcode But it's a bit clumsy. I want first-party support because no one else but Apple has the opportunity to look at all the layers of software involved in this process. No one but you can pull this off.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!