-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from basecamp/initial-spike
Initial version
- Loading branch information
Showing
75 changed files
with
6,202 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,5 @@ | |
/test/dummy/log/*.log | ||
/test/dummy/storage/ | ||
/test/dummy/tmp/ | ||
/node_modules/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
source "https://rubygems.org" | ||
|
||
# Specify your gem's dependencies in pulse_wire.gemspec. | ||
# Specify your gem's dependencies in hotwire_spark.gemspec. | ||
gemspec | ||
|
||
gem "puma" | ||
|
||
gem "sqlite3" | ||
|
||
gem "propshaft" | ||
|
||
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/] | ||
gem "rubocop-rails-omakase", require: false | ||
|
||
# Start debugger with binding.b [https://github.com/ruby/debug] | ||
# gem "debug", ">= 1.0.0" | ||
|
||
gem "propshaft" | ||
gem "importmap-rails" | ||
gem "stimulus-rails" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,49 @@ | ||
# PulseWire | ||
Short description and motivation. | ||
# Hotwire Spark | ||
|
||
## Usage | ||
How to use my plugin. | ||
**Hotwire Spark** is a live-reloading system for Hotwire applications. It enhances your development feedback loop by detecting source code changes and updating the page *smoothly* without requiring a manual reload. | ||
|
||
## Installation | ||
Add this line to your application's Gemfile: | ||
|
||
Add the gem to the group `development`: | ||
|
||
```ruby | ||
gem "pulse_wire" | ||
group :development do | ||
gem "hotwire_spark" | ||
end | ||
``` | ||
|
||
And then execute: | ||
|
||
```bash | ||
$ bundle | ||
``` | ||
|
||
Or install it yourself as: | ||
```bash | ||
$ gem install pulse_wire | ||
That's it! | ||
|
||
## Hot it works | ||
|
||
The system will listen for three kinds of changes and will take action depending on each: | ||
|
||
* **HTML change:** it fetches the new document body and updates the current body with morphing. It uses [`idiomorph`](https://github.com/bigskysoftware/idiomorph) under the hood. | ||
* **CSS change:** it fetches and reloads the stylesheet that changed. | ||
* **Stimulus controller change:** it fetches the Stimulus controller that changed and reloads all the controllers in the page. | ||
|
||
## Configuration | ||
|
||
You can set configuration options on your `development.rb`. For example: | ||
|
||
```ruby | ||
config.hotwire.spark.html_paths += %w[ lib ] | ||
``` | ||
|
||
## Contributing | ||
Contribution directions go here. | ||
| Name | Description | | ||
|------------------|------------------------------------------------------------------------------------------------------------------------------| | ||
| `html_paths` | Paths where file changes trigger a content refresh. By default: `app/controllers`, `app/helpers`, `app/models`, `app/views`. | | ||
| `css_paths` | Paths where file changes trigger a CSS refresh. By default: `app/assets/stylesheets`. | | ||
| `stimulus_paths` | Paths where file changes trigger a Stimulus controller refresh. By default: `app/javascript/controllers`. | | ||
| `enabled` | Enable or disable live reloading. By default, it's only enabled in `development`. | | ||
| `logging` | Show logs in the browser console when reloading happens. It's false by default. | | ||
|
||
## License | ||
|
||
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). |
File renamed without changes.
Oops, something went wrong.