ember-twiddle icon indicating copy to clipboard operation
ember-twiddle copied to clipboard

Is Live Reload = true the correct default?

Open machty opened this issue 8 years ago • 10 comments

(Standard Disclaimer: I love Ember Twiddle; Thank You for continuing to maintain it <3 )

I am not a fan of Live Reload.

  • The constant flashing on the right pane is distracting and anxiety-inducing
  • The user experience of your app breaking and failing to render anything at all simply because you started typing a <p>... and haven't gotten around to typing the closing </p> (or any JavaScript equivalent) is pretty brutal
  • It's performance-intensive to continually reload the iframe and the entire Ember JS payload and app, so even if the flashing weren't so distracting, I'd still feel the jank as I continue to type while the app is recompiling/reloading from the background.

Possible nicer alternatives:

  • Disable Live Reload by default
  • When Live Reload is disabled, user can press CMD+Enter (or your favorite OS equivalent) to reload the app (JSBin does this to great success)

machty avatar Jan 21 '17 13:01 machty

I'm personally in the same camp as @machty. Generally speaking the first thing I do when "twiddling" is uncheck the live reload checkbox.

I would love the path forward that is described above. Which is (to paraphrase):

  1. Make the default state for the "Live Reload" checkbox be unchecked (aka no live-reload).
  2. Add keyboard shortcut to trigger the "run now" functionality.

rwjblue avatar Jan 21 '17 22:01 rwjblue

I would really prefer existing behavior simply because for new users it is not obvious when they load a twiddle for the first time they would have to click "Run Now".

I think this would be a great use case for a persisted user preference.

Gaurav0 avatar Mar 06 '17 17:03 Gaurav0

@Gaurav0 One possibly nice compromise:

  1. Disable live reload
  2. When first loading ember-twiddle, run the app once (but leave live reload off thereafter)
  3. Highlight or stylize the Reload button when you change code to draw your attention to the fact that you'll need to Reload in order to see your changes
  4. (Just restating from the original request): CMD+Enter as a Reload keyboard shortcut

I think even if the reload process weren't visually distracting / anxiety inducing, it's simply just sluggish/janky/CPU-intensive to constantly be reloading the full Ember app all the time, to the point that it kinda makes the user feel like they're "doing it wrong". The above approach seems to be a reasonably nice compromise for all constraints / user experiences.

machty avatar Mar 06 '17 17:03 machty

I'm building something that has a bunch of embedded twiddles. Maybe a good solution, without potentially breaking embedded twiddles out in the wild (which would expect to have liveReload enabled) is a queryParam option, with the default being "on"?

I would love something similar for "run tests"

mike-north avatar Mar 23 '17 02:03 mike-north

Wouldn't a simple keyboard shortcut do for now? The existing behavior allows the user to uncheck live reload, so keep that as it is and add Ctrl+Enter/Cmd+Enter to trigger manually regardless of checkbox state.

nkgm avatar May 08 '17 12:05 nkgm

I would be happy to accept a PR implementing the keyboard shortcut.

Gaurav0 avatar Jan 31 '18 15:01 Gaurav0

How about Cmd/Ctrl+S to save the gist and reload the app?

gokatz avatar Jun 23 '18 12:06 gokatz

Yes to Ctrl-S saving the gist. No to reloading the app.

Gaurav0 avatar Jun 23 '18 13:06 Gaurav0

Cool. But sites like https://scrimba.com/ has no auto-reload feature but save to reload option. It worked well as we are used to it in almost every development environment 😉

It will be difficult for a user first to save and then again click on reload app button (or relative shortcuts) to see the changes :( provided he disabled the "Live Reload". It will be helpful to reload the app on save and keeping the reload shortcut as a separate option.

  • If a user only wants to reload the app, use Cmd+Enter
  • If a user wants to save, use Cmd+S (It will reload after save)

gokatz avatar Jun 23 '18 15:06 gokatz

Sorry, my understanding of "reloading the app" was that you meant reloading the entire app (ember-twiddle). If you only are talking about rerunning the gist/project ("run now") that is fine.

Gaurav0 avatar Jun 25 '18 12:06 Gaurav0