appdev-projects / rails-7-template

7 stars 45 forks source link

Live Reload Gem #21

Closed aldoportillo closed 2 months ago

aldoportillo commented 11 months ago

Hello, I think it would be nice to have a live reloader for erb, js and css files in the template. Here is the live reloader I use. Let me know if I can submit a pull request!

bpurinton commented 3 months ago

Thanks for the suggestion! (And sorry for the late response.) We will consider adding the gem, and I'll leave this issue open, but, for now, we prefer that our beginner students (for whom this template is geared towards) need to reload the page manually after changes to the code.

My main concern with the live reloader gem in this case is that it will only reload the changes for views, and not for changes to e.g. routes and controller actions. Therefore, sometimes the page will auto reload for a student and everything will be working, and sometimes that won't be the case and a manual refresh will be required. I think it is less confusing for a beginner to have consistent behavior behind any code changes, i.e. a manual reload is always required.

Do correct me though if I misunderstand the gem's README and in fact other code changes besides just views (and JS + CSS) cause an auto-reload!

(cc @raghubetina; interesting suggestion here, check my reasoning for why we may not want this gem)

aldoportillo commented 3 months ago

Hey Ben! Thank you for your detailed response. I appreciate the clarity regarding the concern for consistent learning experiences for beginners.

You are right in noting that the live reloader gem primarily targets changes in views and doesn't necessarily cover changes to routes and controllers. Initially, I thought explaining this behavior could enhance students' understanding of modern web architectures, particularly those involving decoupled backends and frontend frameworks. However, I realize that it might introduce confusion and obscure the understanding of how a Rails application is compiled and delivered.

P.S. Great blog post on running a dockerized GEE Map.

bpurinton commented 2 months ago

Closing as we decided not to implement this per the discussion here.