bullet-train-co/nice_partials

Using `partial.helpers` causes issues with code reloading

Opened this issue · 1 comments

I've been testing out nice_partials and I've noticed that if I use partial.helpers do ... end in a partial, it causes Rails development code reloading to become very unreliable.

Steps to reproduce:

  1. Clone this repo: https://github.com/grncdr/nice_partials_issue, this is just a standard rails new + bundle add nice_partials
  2. Checkout the issue-101 branch.
  3. bundle install && rails server
  4. Open localhost:3000
  5. Change the value returned on this line: https://github.com/grncdr/nice_partials_issue/blob/issue-101/app/views/pages/_test_partial.html.erb#L3
  6. Refresh your browser

Expected outcome: the content changes.
Actual outcome: the content stays the same. Refreshing a second time will show the updated content.


In my actual usage, it seems as though refreshing a second time doesn't always solve it. This gets extra confusing when you have an error, as the rails development error page will show current sources that no longer match the code that caused the error.

Huh, that's strange! I haven't seen this and I'm not sure what's causing it. Unfortunately, I don't really have to investigate further or fix these days. I don't know when that'll happen again.