It's trying to compare the file that changed — "app/views/posts/index_view.rb" — with the file that was rendered, which for Phlex is "Posts::IndexView".
I know Phlex is a relatively new project, so I understand if you don't want to fix this, but I wasn't sure what else to do with this knowledge, so dropping it here. :)
I was playing with phlex-rails today and wanted to see if I could get it working with a live reload plugin and landed on this one.
I edited
rails_live_reload
's default watched file patterns to watch Phlex views:That made it watch the Phlex view paths, but it wasn't live reloading. The problem is that
rails_live_reload
uses thepayload[:identifier]
from theActiveSupport::Notifications::Event
to track which views were rendered for the current page, and compares that to the watched file paths to trigger a reload for just the pages that need it. For other template systems,payload[:identifier]
is the template file path, but in Phlex it's the name of the Ruby class:It's trying to compare the file that changed — "app/views/posts/index_view.rb" — with the file that was rendered, which for Phlex is "Posts::IndexView".
I know Phlex is a relatively new project, so I understand if you don't want to fix this, but I wasn't sure what else to do with this knowledge, so dropping it here. :)
cc @joeldrapper @igorkasyanchuk