All Projects → kirillplatonov → hotwire-livereload

kirillplatonov / hotwire-livereload

Licence: MIT license
Live reload for Hotwire Rails apps.

Programming Languages

javascript
184084 projects - #8 most used programming language
ruby
36898 projects - #4 most used programming language
shell
77523 projects
HTML
75241 projects

Projects that are alternatives of or similar to hotwire-livereload

Tychus
Command line utility to live-reload your application.
Stars: ✭ 124 (-46.32%)
Mutual labels:  livereload
express-hotwire
Express tooling for working with Hotwire (HTML over the wire) https://hotwire.dev
Stars: ✭ 39 (-83.12%)
Mutual labels:  hotwire
biu
⚡ a simple front-end code livereload tool
Stars: ✭ 26 (-88.74%)
Mutual labels:  livereload
Blazorlivereload
BlazorLiveReload
Stars: ✭ 143 (-38.1%)
Mutual labels:  livereload
Vscode Live Server
Launch a development local Server with live reload feature for static & dynamic pages.
Stars: ✭ 3,275 (+1317.75%)
Mutual labels:  livereload
pribambase
Paint pixelart textures in real time in Blender with Aseprite.
Stars: ✭ 129 (-44.16%)
Mutual labels:  livereload
Flexlib
FlexLib是一个基于flexbox模型,使用xml文件进行界面布局的框架,融合了web快速布局的能力,让iOS界面开发像写网页一样简单快速
Stars: ✭ 1,569 (+579.22%)
Mutual labels:  livereload
3dub
www dev server with livereload, file watching, http2, https, self signed cert generation
Stars: ✭ 28 (-87.88%)
Mutual labels:  livereload
P5 Manager
A p5js template builder & sketches manager. Built for p5js enthusiasts.
Stars: ✭ 251 (+8.66%)
Mutual labels:  livereload
live-reload-vanilla-website-template
Template to build a website without a front-end framework, including transpilation of ES6+ JavaScript and Sass support
Stars: ✭ 47 (-79.65%)
Mutual labels:  livereload
Kirby Webpack
💪 A Kirby CMS starter-kit with modern frontend tools
Stars: ✭ 150 (-35.06%)
Mutual labels:  livereload
Webpack Livereload Plugin
LiveReload during webpack --watch
Stars: ✭ 183 (-20.78%)
Mutual labels:  livereload
django-turbo-response
Hotwired/Turbo Django response helpers
Stars: ✭ 66 (-71.43%)
Mutual labels:  hotwire
Gosora
Gosora is an ultra-fast and secure forum software written in Go that balances usability with functionality.
Stars: ✭ 131 (-43.29%)
Mutual labels:  livereload
gaper
Builds and restarts a Go project when it crashes or some watched file changes
Stars: ✭ 62 (-73.16%)
Mutual labels:  livereload
Apiproject
[https://www.sofineday.com], golang项目开发脚手架,集成最佳实践(gin+gorm+go-redis+mongo+cors+jwt+json日志库zap(支持日志收集到kafka或mongo)+消息队列kafka+微信支付宝支付gopay+api加密+api反向代理+go modules依赖管理+headless爬虫chromedp+makefile+二进制压缩+livereload热加载)
Stars: ✭ 124 (-46.32%)
Mutual labels:  livereload
magento-2-gulp
Gulp for Magento 2. It works with core Magento styles (less) and structure. Uses default theme configs from dev/tools/grunt/configs/local-themes.js.
Stars: ✭ 37 (-83.98%)
Mutual labels:  livereload
hot-reload
Hot reload development for Go
Stars: ✭ 72 (-68.83%)
Mutual labels:  livereload
elm-factory
Dev and build on Elm applications
Stars: ✭ 22 (-90.48%)
Mutual labels:  livereload
universal-hot-reload
Hot reload client and server webpack bundles for the ultimate development experience
Stars: ✭ 79 (-65.8%)
Mutual labels:  livereload

Hotwire::Livereload

Automatically reload Hotwire Turbo when app files are modified.

demo.mp4

Dependencies

Getting started

Add hotwire-livereload to your Gemfile:

bundle add hotwire-livereload

Run installer:

rails livereload:install

Folders listened by default:

  • app/views
  • app/helpers
  • app/javascript
  • app/assets/stylesheets
  • app/assets/javascripts
  • app/assets/images
  • app/components
  • config/locales

Configuration

You can watch for changes in additional folders by adding them to listen_paths:

# config/environments/development.rb

Rails.application.configure do
  # ...
  config.hotwire_livereload.listen_paths << Rails.root.join("app/custom_folder")
end

You can disable default listen paths and fully override them:

# config/environments/development.rb

Rails.application.configure do
  # ...
  config.hotwire_livereload.disable_default_listeners = true
  config.hotwire_livereload.listen_paths = [
    Rails.root.join("app/assets/stylesheets"),
    Rails.root.join("app/javascript")
  ]
end

If you don't have data-turbo-track="reload" attribute on your JS and CSS bundles you might need to setup force reloading. This will trigger full browser reloading for JS and CSS files only:

# config/environments/development.rb

Rails.application.configure do
  # ...
  config.hotwire_livereload.force_reload_paths << Rails.root.join("app/assets/stylesheets")
  config.hotwire_livereload.force_reload_paths << Rails.root.join("app/javascript")
end

Instead of a direct ActionCable websocket connection, you can reuse the existing TurboStream websocket connection and send updates using standard turbo-streams:

# config/environments/development.rb

Rails.application.configure do
  # ...
  config.hotwire_livereload.reload_method = :turbo_stream
end

In that case you need to place hotwire_livereload_tags helper in your layout after the <%= action_cable_meta_tag %>.

<head>
  ...
  <%= action_cable_meta_tag %>
+ <%= hotwire_livereload_tags if Rails.env.development? %>
  ...
</head>

Disable livereload

To temporarily disable livereload use:

bin/rails livereload:disable

To re-enable:

bin/rails livereload:enable

No server restart is required. Disabling is managed by tmp/livereload-disabled.txt file.

Development

To get started:

  1. Run npm install
  2. Run npm run watch

License

Hotwire::Livereload is released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].