[Feature]: Hot Reload Event
What area(s) will this request affect?
Theme
What type of change do you want to see?
New feature
Overview
A custom event should be triggered by the theme-hot-reload.js script after successfully made a replacement on the page. This was already mentioned on #3493 .
The fix needs to be made on @shopify/theme-hot-reload that is not available on github.
Motivation
There are cases when replaced elements, like sections or blocks do not work perfectly after being injected on the page. For example, if there is a section with a fade effect that triggers on page load, when replaced will be invisible (as there is no page load event to trigger the fade).
Can't you use the --live-reload full-page flag when starting the CLI? If this is added, it will force the page to reload after every change.
Yes, I'm using that, but in that case I cannot have CSS hot-reload and I always lose page state.
On the other hand, shoppify already adds some events to make it work on the theme editor, the hot-reload can reuse the same events.
If I didn't understand it wrong, is the expectation here to get shopify:section:unload and shopify:section:load on section hot reloading when using the CLI?
That would be a nice solution, as it would make hot-reload on development work as hot-reload does on the theme-editor. Any workaround required in one place you need in the other. If the same code can be re-used there are more chances that developers would implement those required changes.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
I think that this is quite easy to fix, but as I'm the only one having the issue and there are easy workarounds, may be this is not as important.
I started giving this a little poke last week. No promises on a turnaround time but there might be something soon.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.