Editor is bogged down and laggy when live-updating my app

I’ve got a React app that’s working beautifully but in order for the editor to keep up with my typing I have to either close the tab with the live auto-redeployed app or uncheck the “Refresh App on Changes” checkbox.

Maybe this is a feature request for the editor to somehow detect the delay and ease off on the live refreshing? I’m also not sure if this is specific to the overhead of React or something on my end locally or what. (I’m interested to hear if others have had this problem.)

But the lag at the moment is spoiling some of the exquisite beauty of the Gomix dev experience.

A simpler feature request would be to put the “Refresh App on Changes” checkbox in the header (or the header of the Activity Log section, or the sidebar, or anywhere visible, not behind an additional click). Then it maybe wouldn’t be a big deal to toggle that on and off as I’m editing. Right now it’s easiest to leave it unchecked and manually hit refresh in the app’s browser tab.

UPDATE: It occurs to me there’s already the “Show” button with spectacles icon and a green “Live” indicator. Maybe that’s a logical place for a checkbox? I guess it’s a little confusing because there are two senses of “live” – auto-deploying the app as you type and auto-refreshing the app’s browser tab. It’s only the latter that’s causing problems in my project.

Anyway, ignore all my spitballing. The real feedback is that I can’t type comfortably in the editor without turning off “Refresh App on Changes”.

UPDATE: It’s not just the React project. Even fresh dummy projects have the problem, though less severely.

I’m afraid I can’t help, but this is just to say that I am experiencing the same thing. Is there perhaps some way to increase the length of the intervals at which the page is refreshed? Otherwise, I am loving my experience with Gomix.

1 Like

If you paste the URL from the Show Live page into a new tab, it won’t be auto-refreshed. Then the editor is disconnected from that tab, and won’t wait for it anymore, and you will have to refresh manually.

True. That’s actually the same as unchecking the box for “Refresh App on Changes”, I think.

I think it’s slightly different: if you open the preview window, even with “Refresh App on Changes” unchecked, the editor might get stuck in some cases. For example if you set a breakpoint in the preview window using the Webconsole.

1 Like

My latest idea: What if auto-refresh only happened when you were done editing a line? So hitting enter or moving the cursor to a new line with the arrow keys or mouse. That would also minimize various pathologies around partially typed code that happens to do something awful. Or just the fact that your app is almost always broken until you finish typing the line you’re on.

Of course it’s pretty delightful to see changes to the app magically appear as you type. But maybe users would get used to doing a quick uparrow-downarrow or something to see the changes in essentially real time without the various downsides.

PS: I’m again conflating auto-browser-tab-refresh and auto-deploy. But maybe these arguments apply to both.

I agree with the above, this is a problem with using glitch as a live editor.

A fix should be as simple as setting a timeout that resets whenever you type, and then when you stop typing the timeout can elapse and the live page can refresh. Kind of a lazy update mechanism. Could even make the timeout user configurable on a slider.

It’s actually a lot better if you use firefox nightly rather than chromium

1 Like

This resetting timeout behavior is often called a “debounce”