Adjusting Production React Apps: Life made easy by using Requestlyby Sebastian Kurfürst on 06.07.2017
As you might know, I am one of the developers of the new Neos React UI (btw, which recently has been released as 1.0.0 beta 3). At the beginning, I was developing the UI solely using the Neos Demo Site; as there were so many things missing and not yet implemented that the focus was really on getting the architecture, features, state structure and performance right.
By now, however, most basic features are in place; and I feel that I actually need to use the User Interface to feel the glitches and issues. Until now, this led to quite long cycle, involving:
- Writing some content on a live system
- Seeing some glitch or issue
- Trying to reproduce the issue in the local dev machine
- Fix the issue
- Push the issue to GitHub
- Merge the fix when everything passed through travis
- Update the live system
- Profit from the bugfix
Actually, it would be quite easy to do: I'd just need to run a local development build of the React UI, and replace some JS and CSS URLs from the remote system with URLs from my local machine. Turns out this already exists!
Requestly is a browser extension which allows to manipulate HTTP requests; pretty much by applying "search and replace" on URLs.
So, to use it, I did the following:
- Install the extension.
- Go to www.requestly.in/rules, which is the rule editor for your local browser (no clue why it is on a remote site though...)
- Create a new rule of type Replace Host.
- Configure Requestly like in the screenshot below.
Turns out that this is an extremely cool and flexible way to do smaller and bigger changes to the Neos React UI in a real-world environment; it even works with Live Reload (if you allow mixed-origin content in Chrome when serving your website via HTTPS).
While you try this out, don't forget to push your adjustments to the Neos React UI as Pull Requests to the project.