cli icon indicating copy to clipboard operation
cli copied to clipboard

[Feature]: Hot Reload Event

Open eloyesp opened this issue 7 months ago • 9 comments

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).

eloyesp avatar May 09 '25 12:05 eloyesp

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.

nbskubix avatar May 12 '25 09:05 nbskubix

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.

eloyesp avatar May 12 '25 12:05 eloyesp

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?

frandiox avatar May 14 '25 02:05 frandiox

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.

eloyesp avatar May 16 '25 10:05 eloyesp

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.

github-actions[bot] avatar Jun 28 '25 03:06 github-actions[bot]

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.

eloyesp avatar Jun 30 '25 13:06 eloyesp

I started giving this a little poke last week. No promises on a turnaround time but there might be something soon.

graygilmore avatar Jun 30 '25 15:06 graygilmore

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.

github-actions[bot] avatar Aug 13 '25 03:08 github-actions[bot]

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.

github-actions[bot] avatar Oct 30 '25 03:10 github-actions[bot]