-
Notifications
You must be signed in to change notification settings - Fork 120
Hack Week: introduction of "hot reload" using Inject #7085
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
Conversation
…ing in debug mode
…ease and release-alpha targets. Now is used only in `Debug`.
You can test the changes from this Pull Request by:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @pmusolino for taking the initiative to integrate Inject into our project 🥇 💯 This will help a lot with our team's productivity!
This works well for me in general - here are a few things that I noticed:
- Should we also add a link to the hot reload doc from the main project README file for visibility?
- I tried setting up Inject for another file while running Woo on the simulator (with HubMenu already set up). This crashed the app when navigating to the view of that new file. Should we add a warning in the documentation that the setup for Inject should be handled before running the app?
- I tested Inject with
AddEditCouponand found that I could not make any changes toListHeaderViewreflected on the simulator. I even tried setting up Inject forListHeaderViewbut it didn't work either. My take is that this tool is not perfect 😅
InjectCoupon.mov
|
Thank you @itsmeichigo for the review and for experimenting with it!
This is a good idea. Added c739375
Added here 👍 dacb3d7
This is because the |
This works perfectly! Thanks for the suggestion |
Description
As part of the Hack Week, I started integrating the Hot Reload in our project using the Inject open-source library (MIT license). With hot reload, we can speed up our development process at 1000% 🚀 Stop the distractions of compiling the project. During my tests, I literally saved hours during the development phase, and this is confirmed by other developers who take advantage of the hot reload.
See the changes live in the app, in an instant, exactly like developing for the web. It is as if compilation times no longer exist, and it is as if Swift became an interpreted language. 🤯
I'd like to merge this PR before the end of the Hack Week, in this way the whole team can test it, and eventually, if some issues come up, I can remove it. However, the library will only work in Debug, so there should be no problems during the release phases.
Testing instructions
For enabling the hot reload, there is a small individual developer setup that you should follow on your machine.
Download the newest version of Xcode Injection app from its GitHub page or from the Mac App Store and install it.
Unpack it and place it under
/Applications.Make sure that the Xcode version you are using to compile our projects is under the default location:
/Applications/Xcode.app. This is super important, unfortunately, Xcode Injection doesn't work if your Xcode is not under this path or it's called with a different name.Run the injection application.
From the injection application in the menu bar, select "open project" from its menu and pick the right workspace file you are using.
Launch the WCiOS app from Xcode. If everything works properly, you should see in the console log something similar:
HubMenuwhich is ready to use Inject. Read the documentation I pushed in this PR for applying hot reload to other views.Demo
Hot.Reload.using.Inject.mp4
RELEASE-NOTES.txtif necessary.