Browse Source

small changes

main
pvincent 2 months ago
parent
commit
efc4ae7a07
  1. 3
      config/initializers/rails_live_reload.rb
  2. 2
      config/initializers/semantic_logger.rb
  3. 4
      lib/live/definable.rb

3
config/initializers/rails_live_reload.rb

@ -1,6 +1,5 @@
return unless defined?(RailsLiveReload) && Rails.env.development?
return unless defined?(RailsLiveReload)
# RailsLiveReload
RailsLiveReload.configure do |config|
# Tailwind CSS
# First rule prevents reloading from asset files ending with '.tailwind.css'

2
config/initializers/semantic_logger.rb

@ -16,6 +16,6 @@ Rails.configuration.after_initialize do
end
ActiveSupport::Notifications.subscribe('rolling.live_constant') do |event|
SemanticLogger[:live_notifications].warn('new event', event.payload) # FIXME: to be continued...
SemanticLogger[:live_notifications].warn('rolling.live_constant', event.payload) # FIXME: to be continued...
end
end

4
lib/live/definable.rb

@ -44,9 +44,7 @@ module Live
# changes << {kind: :restored, constant: 'ACTION_VIEW', type :boolean, old_value: false, new_value:false}
# ActiveSupport::Notifications.instrument 'rolling.live_constant', this: changes
return unless RailsLiveReload.watcher
FileUtils.touch(MAIN_CSS) # triggering RailsLiveReload
FileUtils.touch(MAIN_CSS) if defined?(RailsLiveReload) # triggering RailsLiveReload
end
private

Loading…
Cancel
Save