reactionview 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -39
- data/app/assets/javascripts/reactionview-dev-tools.esm.js +59495 -2633
- data/app/assets/javascripts/reactionview-dev-tools.esm.js.map +1 -1
- data/app/assets/javascripts/reactionview-dev-tools.umd.js +59476 -2617
- data/app/assets/javascripts/reactionview-dev-tools.umd.js.map +1 -1
- data/app/assets/javascripts/reactionview.esm.js +26 -0
- data/app/assets/javascripts/reactionview.esm.js.map +1 -0
- data/lib/generators/reactionview/install_generator.rb +39 -4
- data/lib/reactionview/asset_manifest.rb +1 -1
- data/lib/reactionview/config.rb +99 -4
- data/lib/reactionview/importmap.rb +3 -0
- data/lib/reactionview/instrumentation.rb +143 -0
- data/lib/reactionview/railtie.rb +117 -5
- data/lib/reactionview/slots/dev_compiler.rb +25 -0
- data/lib/reactionview/slots/rendering.rb +157 -0
- data/lib/reactionview/slots/resolver.rb +27 -0
- data/lib/reactionview/slots/state_overrides.rb +68 -0
- data/lib/reactionview/slots.rb +38 -0
- data/lib/reactionview/template/dependencies.rb +90 -0
- data/lib/reactionview/template/handlers/erb.rb +25 -1
- data/lib/reactionview/template/handlers/herb/herb.rb +69 -57
- data/lib/reactionview/template/handlers/herb.rb +188 -13
- data/lib/reactionview/template/local_template.rb +37 -6
- data/lib/reactionview/template/partial_resolver.rb +90 -0
- data/lib/reactionview/version.rb +1 -1
- data/lib/reactionview.rb +13 -0
- data/reactionview.gemspec +3 -2
- metadata +30 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d00bf236b1d0595c0fc499c4a2d86c66db69b7843eb6eb7bc4333186f995a658
|
|
4
|
+
data.tar.gz: f9daac5ed2c13e3d3aebc8a11ce2dab4f3cc5e14e33bf23cb69d8bf067981a1b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 595376e89cfc374ac49b284c8a3e3de8669b02e3e021afbde54653ddde9e75f1a61aecb4716f10e77711534ffb4df20fb92f889d73c4af8d6734a4f503e6c847
|
|
7
|
+
data.tar.gz: 47b1fdec634ef1baddbfdf1e40dfdd92e8719964155985ce586a7ed61a5c66b5d3cd6b88bf93cb7923e44f5ee6747b3d2c945c59b6633fc4a9e0b4cc79714c3e
|
data/README.md
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img alt="ReActionView
|
|
2
|
+
<img alt="ReActionView" style="height: 256px" height="256px" src="https://github.com/marcoroth/reactionview/blob/main/assets/reactionview.png?raw=true">
|
|
3
3
|
</div>
|
|
4
4
|
|
|
5
5
|
<h2 align="center">ReActionView</h2>
|
|
6
6
|
|
|
7
|
-
<h4 align="center">
|
|
7
|
+
<h4 align="center">Reactive views for the HTML+ERB you already have.</h4>
|
|
8
8
|
|
|
9
|
-
<div align="center">
|
|
10
|
-
|
|
9
|
+
<div align="center">You get what a client-side framework gives you, without adopting one.</div><br/>
|
|
10
|
+
|
|
11
|
+
<div align="center">No new syntax · No client framework · No API layer · No build step</div><br/>
|
|
11
12
|
|
|
12
13
|
<p align="center">
|
|
13
14
|
<a href="https://rubygems.org/gems/reactionview"><img alt="Gem Version" src="https://img.shields.io/gem/v/reactionview"></a>
|
|
@@ -16,61 +17,43 @@ HTML validation, better error feedback, a developer-friendly debug mode, and mor
|
|
|
16
17
|
<a href="https://github.com/marcoroth/reactionview/issues"><img alt="Issues" src="https://img.shields.io/github/issues/marcoroth/reactionview"></a>
|
|
17
18
|
</p>
|
|
18
19
|
|
|
19
|
-
<br
|
|
20
|
-
|
|
21
|
-
## Installation
|
|
22
|
-
|
|
23
|
-
Add to your Rails application:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
bundle add reactionview
|
|
27
|
-
rails generate reactionview:install
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Usage
|
|
20
|
+
<br/>
|
|
31
21
|
|
|
32
|
-
ReActionView
|
|
22
|
+
**ReActionView makes your existing HTML+ERB templates reactive.**
|
|
33
23
|
|
|
34
|
-
|
|
35
|
-
2. **Intercept `.html.erb` templates** - Enable in config to process all HTML+ERB templates with Herb.
|
|
24
|
+
Rails 8.2 already renders HTML templates with `Herb::Engine`, which reads the HTML and the Ruby in a template together. ReActionView builds on that. A template declares state the browser owns, changes it with an HTML attribute, and has your controller answer when the server is needed. There is no second copy of the page to keep in sync.
|
|
36
25
|
|
|
37
|
-
|
|
26
|
+
It also brings Herb's error overlays, the dev tools and per-tag instrumentation to the page, so a mismatched tag or a `<div>` inside a `<p>` shows up in the browser with the file and the line while you work. On Rails 8.1 and earlier, it brings the engine itself.
|
|
38
27
|
|
|
39
|
-
|
|
40
|
-
# config/initializers/reactionview.rb
|
|
28
|
+
### Documentation
|
|
41
29
|
|
|
42
|
-
|
|
43
|
-
# Intercept .html.erb templates to use Herb::Engine
|
|
44
|
-
# config.intercept_erb = true
|
|
30
|
+
[reactionview.dev](https://reactionview.dev/overview)
|
|
45
31
|
|
|
46
|
-
|
|
47
|
-
config.debug_mode = Rails.env.development?
|
|
32
|
+
### Installation
|
|
48
33
|
|
|
49
|
-
|
|
50
|
-
|
|
34
|
+
```bash
|
|
35
|
+
bundle add reactionview
|
|
36
|
+
bin/rails generate reactionview:install
|
|
37
|
+
```
|
|
51
38
|
|
|
52
|
-
|
|
53
|
-
# config.validation_mode = :overlay
|
|
39
|
+
The generator creates `config/initializers/reactionview.rb` and imports the client from `app/javascript/application.js`. On importmap-rails the gem pins the client for you. With a bundler, install the `reactionview` npm package as well.
|
|
54
40
|
|
|
55
|
-
|
|
56
|
-
# config.external_template_mode = :skip
|
|
57
|
-
end
|
|
58
|
-
```
|
|
41
|
+
ReActionView needs Ruby 3.2 or newer and Rails 7.0 or newer. [Setup](https://reactionview.dev/installation) covers turning on reactive templates and checking that it works, and the [Quick Start](https://reactionview.dev/quick-start) builds a first reactive page.
|
|
59
42
|
|
|
60
|
-
|
|
43
|
+
### Development
|
|
61
44
|
|
|
62
45
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
63
46
|
|
|
64
47
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
65
48
|
|
|
66
|
-
|
|
49
|
+
### Contributing
|
|
67
50
|
|
|
68
51
|
Bug reports and pull requests are welcome on GitHub at https://github.com/marcoroth/reactionview. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/marcoroth/reactionview/blob/main/CODE_OF_CONDUCT.md).
|
|
69
52
|
|
|
70
|
-
|
|
53
|
+
### Code of Conduct
|
|
71
54
|
|
|
72
55
|
Everyone interacting in the ReActionView project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/marcoroth/reactionview/blob/main/CODE_OF_CONDUCT.md).
|
|
73
56
|
|
|
74
|
-
|
|
57
|
+
### License
|
|
75
58
|
|
|
76
59
|
This project is available as open source under the terms of the [MIT License](https://github.com/marcoroth/reactionview/blob/main/LICENSE.txt).
|