proscenium 0.19.0.beta11-aarch64-linux → 0.19.0.beta13-aarch64-linux

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: b57f4a58abaff1dbb21b7e48f1e62acb8764e4e1637a79c7860309402df41949
4
- data.tar.gz: 3bf4c9ae575526f1ca68f0bb55bf00e60494265779f565dda3d6a66e435bfa9b
3
+ metadata.gz: 4d396805518d9fd08dbcac8dc263d5040dd8459769ed5a0b731534985ad1365c
4
+ data.tar.gz: f64264c46fb92059f7ebb7d34b767f41c9756dc3cceb273e4eb3d058513632dc
5
5
  SHA512:
6
- metadata.gz: a465553f8b25b37d91e0faf6dbb0b4fdf5d582c378a27c6a79fe5c5e03b1d9c62d15f7a2dcc977514694c19fc2667b4dd6888da2d1c159d4528171fb1f1b1525
7
- data.tar.gz: ccfd0d834ddafb11b2e65dc678ece02fe551656989f9cd4b5e1a107551b526e7a9d9d2999c0ad629720f68f85e6142a5c93fdafa1371114e47af4b753a78dd46
6
+ metadata.gz: ff0ed49f4d18159648c5c13c094f681164640f50b50e5e122d2bc010ceff7ca890258107af72a0b9c8d431d25121c54a9a8362e11415bda68a909be3629904bc
7
+ data.tar.gz: c376bb2fec8ddb53e9eded617c90c53e5a5d82ca86e2c27ff6315d74ebdb3f25fb688cc28115abf9a171915e5f217e9d3024d04815c0ba73ae78ff96bed36fbe
data/README.md CHANGED
@@ -49,7 +49,6 @@
49
49
  - [JSX](#jsx)
50
50
  - [JSON](#json)
51
51
  - [Phlex Support](#phlex-support)
52
- - [ViewComponent Support](#viewcomponent-support)
53
52
  - [Cache Busting](#cache-busting)
54
53
  - [rjs is back!](#rjs-is-back)
55
54
  - [Resolution](#resolution)
@@ -769,49 +768,6 @@ end
769
768
  <h1 class="user_name-ABCD1234 title">Joel Moss</h1>
770
769
  ```
771
770
 
772
- ## ViewComponent Support
773
-
774
- [ViewComponent](https://viewcomponent.org/) iA framework for creating reusable, testable & encapsulated view components, built to integrate seamlessly with Ruby on Rails. Proscenium works perfectly with ViewComponent, with support for side-loading, CSS modules, and more. Simply write your ViewComponent classes and inherit from `Proscenium::ViewComponent`.
775
-
776
- ```ruby
777
- class MyView < Proscenium::ViewComponent
778
- def call
779
- tag.h1 'Hello World'
780
- end
781
- end
782
- ```
783
-
784
- ### Side-loading
785
-
786
- Any ViewComponent class that inherits `Proscenium::ViewComponent` will automatically be [side-loaded](#side-loading).
787
-
788
- ### CSS Modules
789
-
790
- [CSS Modules](#css-modules) are fully supported in ViewComponent classes, with access to the [`css_module` helper](#in-your-views) if you need it.
791
-
792
- ```ruby
793
- # /app/components/user_component.rb
794
- class UserComponent < Proscenium::ViewComponent
795
- def view_template
796
- div.h1 @user.name, class: css_module(:user_name)
797
- end
798
- end
799
- ```
800
-
801
- ```css
802
- /* # /app/components/user_component.module.css */
803
- .userName {
804
- color: red;
805
- font-size: 50px;
806
- }
807
- ```
808
-
809
- The view above will be rendered something like this:
810
-
811
- ```html
812
- <h1 class="user_name-ABCD1234">Joel Moss</h1>
813
- ```
814
-
815
771
  ## Cache Busting
816
772
 
817
773
  > _COMING SOON_
@@ -13,7 +13,7 @@ module Proscenium
13
13
  bundle = {}
14
14
  specs.each do |s|
15
15
  bundle[s.name] = if s.name == 'proscenium'
16
- Pathname(s.full_gem_path).join('lib/proscenium').to_s
16
+ Pathname(s.full_gem_path).join('lib/proscenium/ui').to_s
17
17
  else
18
18
  s.full_gem_path
19
19
  end
Binary file
@@ -9,15 +9,8 @@ module Proscenium
9
9
  result = super
10
10
  return result if !view.controller || !Proscenium.config.side_load
11
11
 
12
- renderable = template.instance_variable_get(:@renderable)
13
-
14
- to_sideload = if Object.const_defined?(:ViewComponent) &&
15
- template.is_a?(ActionView::Template::Renderable) &&
16
- renderable.class < ::ViewComponent::Base &&
17
- renderable.class.format == :html
18
- renderable
19
- elsif template.respond_to?(:virtual_path) &&
20
- template.respond_to?(:type) && template.type == :html
12
+ to_sideload = if template.respond_to?(:virtual_path) &&
13
+ template.respond_to?(:type) && template.type == :html
21
14
  template
22
15
  end
23
16
  if to_sideload
@@ -33,6 +33,11 @@ module Proscenium
33
33
  end
34
34
  end
35
35
 
36
+ initializer 'proscenium.debugging' do
37
+ tpl_path = root.join('lib', 'proscenium', 'templates').to_s
38
+ ActionDispatch::DebugView::RESCUES_TEMPLATE_PATHS << tpl_path
39
+ end
40
+
36
41
  initializer 'proscenium.middleware' do |app|
37
42
  app.middleware.insert_after ActionDispatch::Static, Proscenium::Middleware
38
43
  end
@@ -50,5 +55,15 @@ module Proscenium
50
55
  ActionView::PartialRenderer.prepend Monkey::PartialRenderer
51
56
  end
52
57
  end
58
+
59
+ initializer 'proscenium.public_path' do |app|
60
+ if app.config.public_file_server.enabled
61
+ headers = app.config.public_file_server.headers || {}
62
+ index = app.config.public_file_server.index_name || 'index'
63
+
64
+ app.middleware.insert_after(ActionDispatch::Static, ActionDispatch::Static,
65
+ root.join('public').to_s, index:, headers:)
66
+ end
67
+ end
53
68
  end
54
69
  end
@@ -11,7 +11,7 @@ module Proscenium
11
11
  # The HTML tag to use as the wrapping element for the component. You can reassign this in your
12
12
  # component class to use a different tag:
13
13
  #
14
- # class MyComponent < Proscenium::ViewComponent::ReactComponent
14
+ # class MyComponent < Proscenium::Phlex::ReactComponent
15
15
  # self.root_tag = :span
16
16
  # end
17
17
  #
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Proscenium
4
- VERSION = '0.19.0.beta11'
4
+ VERSION = '0.19.0.beta13'
5
5
  end
data/lib/proscenium.rb CHANGED
@@ -4,6 +4,7 @@ require 'zeitwerk'
4
4
  require 'proscenium/railtie'
5
5
 
6
6
  loader = Zeitwerk::Loader.for_gem
7
+ loader.ignore "#{__dir__}/proscenium/core_ext/object/css_module_ivars.rb"
7
8
  loader.setup
8
9
 
9
10
  module Proscenium
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proscenium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.19.0.beta11
4
+ version: 0.19.0.beta13
5
5
  platform: aarch64-linux
6
6
  authors:
7
7
  - Joel Moss
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-04-22 00:00:00.000000000 Z
11
+ date: 2025-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -129,10 +129,6 @@ files:
129
129
  - lib/proscenium/templates/rescues/build_error.html.erb
130
130
  - lib/proscenium/utils.rb
131
131
  - lib/proscenium/version.rb
132
- - lib/proscenium/view_component.rb
133
- - lib/proscenium/view_component/css_modules.rb
134
- - lib/proscenium/view_component/react_component.rb
135
- - lib/proscenium/view_component/sideload.rb
136
132
  homepage: https://github.com/joelmoss/proscenium
137
133
  licenses:
138
134
  - MIT
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Proscenium
4
- module ViewComponent::CssModules
5
- include Proscenium::CssModule
6
-
7
- def self.included(base)
8
- base.extend CssModule::Path
9
- end
10
- end
11
- end
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Proscenium
4
- # Renders a <div> for use with React components, with data attributes specifying the component
5
- # path and props.
6
- #
7
- # If a content block is given, that content will be rendered inside the component, allowing for a
8
- # "loading" UI. If no block is given, then a "loading..." text will be rendered. It is intended
9
- # that the component is mounted to this div, and the loading UI will then be replaced with the
10
- # component's rendered output.
11
- class ViewComponent::ReactComponent < ViewComponent
12
- self.abstract_class = true
13
-
14
- include ReactComponentable
15
-
16
- def call
17
- tag.send root_tag, data: data_attributes do
18
- tag.div content || 'loading...'
19
- end
20
- end
21
- end
22
- end
@@ -1,4 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Proscenium::ViewComponent::Sideload
4
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class Proscenium::ViewComponent < ViewComponent::Base
4
- include Proscenium::SourcePath
5
- include CssModules
6
-
7
- module Sideload
8
- def before_render
9
- Proscenium::SideLoad.sideload_inheritance_chain self, controller.sideload_assets_options
10
-
11
- super
12
- end
13
- end
14
-
15
- class_attribute :sideload_assets_options
16
-
17
- class << self
18
- attr_accessor :abstract_class
19
-
20
- def inherited(child)
21
- child.prepend Sideload
22
-
23
- super
24
- end
25
-
26
- def sideload_assets(value)
27
- self.sideload_assets_options = value
28
- end
29
- end
30
- end