evc_rails 0.1.3 → 0.1.4
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 +20 -20
- data/lib/evc_rails/version.rb +1 -1
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e15aa81852a8394bcc2a904cff923f3d5a5f588c618a2c0c6112f33203b0bd2c
|
4
|
+
data.tar.gz: cdd1c962213f4c2a6593a522ac2aee9cc793858f4759c218242169a26fd40ace
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91a5a791151b6e2290dc3a20a8e95980a0821bf2526314a3b07724e85dda06f11a6149bfd9d808eb4af9e67da90d80616ddb9fa799d2c61ebc0e908e4cb627ce
|
7
|
+
data.tar.gz: 0bc11c9d4026d5357b5d86089884eff7d30bf82a66823ec164aa3600cbf2ca6774c835c18175a132225acd9204cd95879f76a5698fbc80e355a46ba1ac771e85
|
data/README.md
CHANGED
@@ -28,9 +28,9 @@ class ButtonComponent < ViewComponent::Base
|
|
28
28
|
end
|
29
29
|
```
|
30
30
|
|
31
|
-
```
|
31
|
+
```erb
|
32
32
|
<!-- Now you can use it with EVC syntax -->
|
33
|
-
<
|
33
|
+
<Button variant="primary" size="lg">Click me</Button>
|
34
34
|
```
|
35
35
|
|
36
36
|
No component modifications required - just install and enjoy easier syntax!
|
@@ -69,11 +69,11 @@ The template handler will be automatically registered for `.evc` files.
|
|
69
69
|
|
70
70
|
Create `.evc` files in your `app/views` directory:
|
71
71
|
|
72
|
-
```
|
72
|
+
```erb
|
73
73
|
<!-- app/views/pages/home.evc -->
|
74
74
|
<h1>Welcome to our app</h1>
|
75
75
|
|
76
|
-
<
|
76
|
+
<Button size="lg" variant="primary">Get Started</Button>
|
77
77
|
|
78
78
|
<Card>
|
79
79
|
<h2>Featured Content</h2>
|
@@ -98,10 +98,10 @@ This becomes:
|
|
98
98
|
|
99
99
|
### Self-Closing Components
|
100
100
|
|
101
|
-
```
|
102
|
-
<
|
101
|
+
```erb
|
102
|
+
<Button />
|
103
103
|
<Icon name="star" />
|
104
|
-
<
|
104
|
+
<Spacer height="20" />
|
105
105
|
```
|
106
106
|
|
107
107
|
Becomes:
|
@@ -116,20 +116,20 @@ Becomes:
|
|
116
116
|
|
117
117
|
#### String Attributes
|
118
118
|
|
119
|
-
```
|
120
|
-
<
|
119
|
+
```erb
|
120
|
+
<Button size="lg" variant="primary" />
|
121
121
|
```
|
122
122
|
|
123
123
|
#### Ruby Expressions
|
124
124
|
|
125
|
-
```
|
126
|
-
<
|
125
|
+
```erb
|
126
|
+
<Button user={@current_user} count={@items.count} />
|
127
127
|
```
|
128
128
|
|
129
129
|
#### Multiple Attributes
|
130
130
|
|
131
|
-
```
|
132
|
-
<Card class="shadow-lg" data-testid="featured-card" user=
|
131
|
+
```erb
|
132
|
+
<Card class="shadow-lg" data-testid="featured-card" user={@user}>
|
133
133
|
Content here
|
134
134
|
</Card>
|
135
135
|
```
|
@@ -138,9 +138,9 @@ Becomes:
|
|
138
138
|
|
139
139
|
Organize your components in subdirectories:
|
140
140
|
|
141
|
-
```
|
141
|
+
```erb
|
142
142
|
<UI::Button size="lg" />
|
143
|
-
<Forms::Fields::TextField value=
|
143
|
+
<Forms::Fields::TextField value={@email} />
|
144
144
|
<Layout::Container class="max-w-4xl">
|
145
145
|
<UI::Card>Content</UI::Card>
|
146
146
|
</Layout::Container>
|
@@ -164,7 +164,7 @@ class CardComponent < ViewComponent::Base
|
|
164
164
|
end
|
165
165
|
```
|
166
166
|
|
167
|
-
```
|
167
|
+
```erb
|
168
168
|
<Card>
|
169
169
|
<Card::Header>
|
170
170
|
<h1>Welcome</h1>
|
@@ -197,7 +197,7 @@ class ListComponent < ViewComponent::Base
|
|
197
197
|
end
|
198
198
|
```
|
199
199
|
|
200
|
-
```
|
200
|
+
```erb
|
201
201
|
<List>
|
202
202
|
<List::Item>Item 1</List::Item>
|
203
203
|
<List::Item>Item 2</List::Item>
|
@@ -217,7 +217,7 @@ Becomes:
|
|
217
217
|
|
218
218
|
### Complex Nesting
|
219
219
|
|
220
|
-
```
|
220
|
+
```erb
|
221
221
|
<UI::Card>
|
222
222
|
<h2 class="text-2xl font-semibold">Dashboard</h2>
|
223
223
|
|
@@ -239,7 +239,7 @@ Becomes:
|
|
239
239
|
|
240
240
|
You can mix regular HTML, ERB, and component tags:
|
241
241
|
|
242
|
-
```
|
242
|
+
```erb
|
243
243
|
<div class="container">
|
244
244
|
<h1><%= @page.title %></h1>
|
245
245
|
|
@@ -249,7 +249,7 @@ You can mix regular HTML, ERB, and component tags:
|
|
249
249
|
|
250
250
|
<div class="grid">
|
251
251
|
<% @posts.each do |post| %>
|
252
|
-
<PostCard post=
|
252
|
+
<PostCard post={post} />
|
253
253
|
<% end %>
|
254
254
|
</div>
|
255
255
|
</div>
|
data/lib/evc_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evc_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- scttymn
|
@@ -65,9 +65,11 @@ dependencies:
|
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '2.0'
|
68
|
-
description:
|
69
|
-
allowing
|
70
|
-
|
68
|
+
description: Embedded ViewComponents (EVC) is a Rails template handler that brings
|
69
|
+
JSX-like syntax to ViewComponent, allowing you to write custom component tags directly
|
70
|
+
in your .evc templates. It's a drop-in replacement for .erb files that works seamlessly
|
71
|
+
with existing ViewComponents, supporting self-closing tags, attributes, namespaced
|
72
|
+
components, slots, and complex nesting while maintaining full ERB compatibility.
|
71
73
|
email:
|
72
74
|
- scotty@hey.com
|
73
75
|
executables: []
|
@@ -90,6 +92,7 @@ metadata:
|
|
90
92
|
allowed_push_host: https://rubygems.org
|
91
93
|
homepage_uri: https://github.com/scttymn/evc_rails
|
92
94
|
source_code_uri: https://github.com/scttymn/evc_rails
|
95
|
+
changelog_uri: https://github.com/scttymn/evc_rails/blob/main/CHANGELOG.md
|
93
96
|
rdoc_options: []
|
94
97
|
require_paths:
|
95
98
|
- lib
|
@@ -106,5 +109,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
106
109
|
requirements: []
|
107
110
|
rubygems_version: 3.6.9
|
108
111
|
specification_version: 4
|
109
|
-
summary:
|
112
|
+
summary: JSX-like syntax for Rails ViewComponent
|
110
113
|
test_files: []
|