proscenium-phlex 0.7.0 → 0.8.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b267d116ceeaf9f4071282643eee5ebe0766a2270142fb5e7ca040a0c8e76310
4
- data.tar.gz: b4ecb93107a91582578a675caaa50c4792103d36f5dbb8aeb4f7a1da2b20e683
3
+ metadata.gz: df6115d20026dc696f5920cb6abd477395b67fd4e75aa2865c689b2da0d8f04c
4
+ data.tar.gz: 1d6e22163c6821e5c4da3004e4ad1d8e798ebe17bd6a8e407e760c4ef4c3a026
5
5
  SHA512:
6
- metadata.gz: 62a890ca568637912cef3a1c41471fcb008bfb5d571b31cd4b1317d9a6b6f9eb7360d4a9b495bebe6122cc38a2b0cdac6c1c69c2208aec27448e7a792077e642
7
- data.tar.gz: 478f8742e53235499451a9cbe9bb338c36660fb6004d62b8b90e494bfc1f5cd40c72f3386121a35292d147d8138ff6bca0aecbe8c55d938a754855aa591b32cb
6
+ metadata.gz: b255e3d2a1d88f06e952b98a83bc2c414f6af365c54262b8171a704db5a3ed4d292eb13af2a9b793510bcc91d5f9da4fbb22ac80dbf2cb403829bcaaf25929a3
7
+ data.tar.gz: 163ac3ed9355884df2c02cc90904725e19689b6119e5cf7d5382e7d868547706653fb0950225b809bd36fef44bf320a7ec612b05727f949106badd1bc89c6f65
data/README.md CHANGED
@@ -6,9 +6,15 @@
6
6
 
7
7
  - Ruby >= 3.4
8
8
  - [Proscenium](https://github.com/joelmoss/proscenium) ~> 0.26
9
- - Rails >= 7.1 and < 9.0
9
+ - Rails >= 7.2 and < 9.0
10
10
  - Phlex Rails >= 1.2 and < 3.0
11
11
 
12
+ ## Upgrading to 0.7
13
+
14
+ - Ruby 3.3 is no longer supported. Upgrade to Ruby 3.4 or later.
15
+ - Proscenium 0.26 or later is required. Outside production, CSS module class names now end with the module's path (see [CSS Modules](#css-modules)), so tests that match exact class names need updating.
16
+ - `Proscenium::Phlex::React` has been removed. Remove any `include Proscenium::Phlex::React` from your components.
17
+
12
18
  ## Usage
13
19
 
14
20
  [Phlex](https://www.phlex.fun/) is a framework for building fast, reusable, testable views in pure Ruby. [Proscenium](https://proscenium.rocks/) works perfectly with [Phlex](https://www.phlex.fun), with support for side-loading, CSS modules, and more.
@@ -34,7 +40,7 @@ class ApplicationLayout < Phlex::HTML
34
40
  end
35
41
  ```
36
42
 
37
- You can specifically include CCS and JS assets using the `include_stylesheets` and `include_javascripts` helpers, allowing you to control where they are included in the HTML.
43
+ You can specifically include CSS and JS assets using the `include_stylesheets` and `include_javascripts` helpers, allowing you to control where they are included in the HTML.
38
44
 
39
45
  ### Side-loading
40
46
 
@@ -50,9 +56,11 @@ class MyComponent < Phlex::HTML
50
56
  end
51
57
  ```
52
58
 
59
+ Components are not side loaded when `Proscenium.config.side_load` is `false`. Otherwise, a controller's [`sideload_assets`](https://github.com/joelmoss/proscenium?tab=readme-ov-file#side-loading) options apply to the components it renders, just as they do to its views. A Proc given to the controller's `sideload_assets` is evaluated against the controller. A component can also call `sideload_assets` itself, and a Proc given there is evaluated against the component.
60
+
53
61
  ### CSS Modules
54
62
 
55
- [CSS Modules](https://github.com/joelmoss/proscenium?tab=readme-ov-file#css-modules) are fully supported in Phlex classes, with access to the [`css_module` helper](https://github.com/joelmoss/proscenium?tab=readme-ov-file#in-your-views) if you need it. However, there is a better and more seemless way to reference CSS module classes in your Phlex classes.
63
+ [CSS Modules](https://github.com/joelmoss/proscenium?tab=readme-ov-file#css-modules) are fully supported in Phlex classes, with access to the [`css_module` helper](https://github.com/joelmoss/proscenium?tab=readme-ov-file#in-your-views) if you need it. However, there is a better and more seamless way to reference CSS module classes in your Phlex classes.
56
64
 
57
65
  Within your Phlex classes, any class names that begin with `@` will be treated as a CSS module class.
58
66
 
@@ -71,42 +79,46 @@ end
71
79
 
72
80
  ```css
73
81
  /* /app/views/users/show_view.module.css */
74
- .userName {
82
+ .user_name {
75
83
  color: red;
76
84
  font-size: 50px;
77
85
  }
78
86
  ```
79
87
 
80
- In the above `Users::ShowView` Phlex class, the `@user_name` class will be resolved to the `userName` class in the `users/show_view.module.css` file.
88
+ In the above `Users::ShowView` Phlex class, the `@user_name` class will be resolved to the `user_name` class in the `users/show_view.module.css` file. Class names are used as written: `@user_name` does not match a `.userName` class.
81
89
 
82
- The view above will be rendered something like this:
90
+ In production, the view above will be rendered something like this:
83
91
 
84
92
  ```html
85
- <h1 class="user_name-ABCD1234"></h1>
93
+ <h1 class="user_name_abcd1234"></h1>
86
94
  ```
87
95
 
96
+ In development and test, or when `Proscenium.config.debug` is set, the module's path is appended, so you can see where a class comes from: `user_name_abcd1234_app-views-users-show_view-module`.
97
+
88
98
  You can of course continue to reference regular class names in your view, and they will be passed through as is. This will allow you to mix and match CSS modules and regular CSS classes in your views.
89
99
 
90
100
  ```ruby
91
101
  # /app/views/users/show_view.rb
92
102
  class Users::ShowView < Phlex::HTML
93
- include Proscenium::Phlex::Sideload
103
+ include Proscenium::Phlex::CssModules
94
104
 
95
105
  def view_template
96
- h1 class: :[@user_name, :title] do
106
+ h1 class: [:@user_name, :title] do
97
107
  @user.name
98
108
  end
99
109
  end
100
110
  end
101
111
  ```
102
112
 
113
+ In production, this renders:
114
+
103
115
  ```html
104
- <h1 class="user_name-ABCD1234 title">Joel Moss</h1>
116
+ <h1 class="user_name_abcd1234 title">Joel Moss</h1>
105
117
  ```
106
118
 
107
119
  ## Development
108
120
 
109
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rails test` to run the tests, or `bundle exec appraisal rails test` to run them against every supported Phlex and Rails combination. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
121
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/rails test` to run the tests, or `bundle exec appraisal rails test` to run them against Rails 7.2, 8.0 and 8.1, each with Phlex 1 and Phlex 2. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
110
122
 
111
123
  To install this gem onto your local machine, run `bundle exec rake install`.
112
124
 
@@ -115,11 +127,11 @@ To install this gem onto your local machine, run `bundle exec rake install`.
115
127
  Releases are published to [rubygems.org](https://rubygems.org) by the `release` GitHub Actions workflow, using trusted publishing, so no API key or one-time code is needed.
116
128
 
117
129
  1. Update the version number in `lib/proscenium/phlex/version.rb`, run `bundle install && bundle exec appraisal install` to update every lockfile, and commit. CI installs gems in frozen mode, so a lockfile left on the old version fails the build.
118
- 2. Push a tag matching the new version:
130
+ 2. Push a tag matching the new version, replacing `X.Y.Z`:
119
131
 
120
132
  ```sh
121
- git tag v0.7.0
122
- git push origin master v0.7.0
133
+ git tag vX.Y.Z
134
+ git push origin master vX.Y.Z
123
135
  ```
124
136
 
125
137
  The workflow checks that the tag matches the version, runs the tests, builds the gem and pushes it. If a run fails partway, re-run it: a version already on RubyGems is skipped.
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -486,7 +486,7 @@ CHECKSUMS
486
486
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
487
487
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
488
488
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
489
- proscenium-phlex (0.7.0)
489
+ proscenium-phlex (0.8.0)
490
490
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
491
491
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
492
492
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -483,7 +483,7 @@ CHECKSUMS
483
483
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
484
484
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
485
485
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
486
- proscenium-phlex (0.7.0)
486
+ proscenium-phlex (0.8.0)
487
487
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
488
488
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
489
489
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -485,7 +485,7 @@ CHECKSUMS
485
485
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
486
486
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
487
487
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
488
- proscenium-phlex (0.7.0)
488
+ proscenium-phlex (0.8.0)
489
489
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
490
490
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
491
491
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -492,7 +492,7 @@ CHECKSUMS
492
492
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
493
493
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
494
494
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
495
- proscenium-phlex (0.7.0)
495
+ proscenium-phlex (0.8.0)
496
496
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
497
497
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
498
498
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -489,7 +489,7 @@ CHECKSUMS
489
489
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
490
490
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
491
491
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
492
- proscenium-phlex (0.7.0)
492
+ proscenium-phlex (0.8.0)
493
493
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
494
494
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
495
495
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -1,12 +1,12 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- proscenium-phlex (0.7.0)
4
+ proscenium-phlex (0.8.0)
5
5
  phlex-rails (>= 1.2, < 3.0)
6
6
  phlexible (>= 3.1.0)
7
7
  prism
8
8
  proscenium (~> 0.26)
9
- rails (>= 7.1.0, < 9.0)
9
+ rails (>= 7.2.0, < 9.0)
10
10
  require-hooks (~> 0.2)
11
11
 
12
12
  GEM
@@ -491,7 +491,7 @@ CHECKSUMS
491
491
  proscenium (0.26.0-arm64-darwin) sha256=b90a28de850786f159878e0cddfef1fe9b535853b98fdcfcedf93f8a9924e59b
492
492
  proscenium (0.26.0-x86_64-darwin) sha256=b3babcc617d3360360c38b9a368509dfe4b3f05f9e053b5f152b0eccd0c2b136
493
493
  proscenium (0.26.0-x86_64-linux-gnu) sha256=30a6f3750fb28b8a608e1263fafc64b42371ca535bce1f47f34400b1262d28b7
494
- proscenium-phlex (0.7.0)
494
+ proscenium-phlex (0.8.0)
495
495
  public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623
496
496
  puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb
497
497
  racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Proscenium
4
4
  module Phlex
5
- VERSION = '0.7.0'
5
+ VERSION = '0.8.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium-phlex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Moss
@@ -77,7 +77,7 @@ dependencies:
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 7.1.0
80
+ version: 7.2.0
81
81
  - - "<"
82
82
  - !ruby/object:Gem::Version
83
83
  version: '9.0'
@@ -87,7 +87,7 @@ dependencies:
87
87
  requirements:
88
88
  - - ">="
89
89
  - !ruby/object:Gem::Version
90
- version: 7.1.0
90
+ version: 7.2.0
91
91
  - - "<"
92
92
  - !ruby/object:Gem::Version
93
93
  version: '9.0'