glimmer-dsl-web 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +9 -7
- data/VERSION +1 -1
- data/glimmer-dsl-web.gemspec +4 -4
- data/lib/glimmer/web/component.rb +80 -13
- data/lib/glimmer-dsl-web/samples/hello/hello_component.rb +1 -1
- data/lib/glimmer-dsl-web/samples/hello/hello_component_slots.rb +7 -7
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2c800cf33832acb3ab52d13d6ffa1db466d8c1c017bde29ce120c92c8e597e9
|
4
|
+
data.tar.gz: 81e200ca9d1c20c62ed5a5b3e900b9723c08c54933d93e35c7d7ac114cda480f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d86f6012cf574205d499aad0a684e33793ce547740917c186580cc7295da0c7b8e625ae20473e6cd49edb87fc8a7abe4d109ab2f98cbc52e2a7208608a76c3bd
|
7
|
+
data.tar.gz: 9269348151f2ad4007a1dccae80ff9ae2565af008c70285a6e0ffbe6d22faa4878b414d287556621d8ced0b23e3424980af25ec3027f3f8b39633c288ceb4e55
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 0.6.0
|
4
|
+
|
5
|
+
- Support Component Custom Event Listeners (declare inside Component with `event :eventname` or `events :event1, :event2, ...` and then listen inside consumer code by adding `on_customeventname do; ...; end` listener inside content block of a consumed Glimmer Web Component)
|
6
|
+
- Using latest opal-sprockets 1.0.4 will fix an issue with Opal compilation breaking whenever upgrading Opal gems in a Rails project and trying to restart server and render a webpage locally.
|
7
|
+
|
3
8
|
## 0.5.0
|
4
9
|
|
5
|
-
- Support Glimmer Web Component Slots (by adding `slot: :slot_name` to any parent element, like a `div`, inside a `Glimmer::Web::Component` `markup {...}` element)
|
10
|
+
- Support Glimmer Web Component Slots (by adding `slot: :slot_name` to any parent element, like a `div`, inside a `Glimmer::Web::Component` `markup {...}` element, and later having a consumer open a `slot_name {...}` block inside the content block of a consumed component)
|
11
|
+
- Hello, Component Slots! Sample: `require 'glimmer-dsl-web/samples/hello/hello_component_slots'`
|
6
12
|
|
7
13
|
## 0.4.4
|
8
14
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Web 0.
|
1
|
+
# [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Web 0.6.0 (Beta)
|
2
2
|
## Ruby-in-the-Browser Web Frontend Framework
|
3
3
|
### Finally, Ruby Developer Productivity, Happiness, and Fun in the Frontend!!!
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/glimmer-dsl-web.svg)](http://badge.fury.io/rb/glimmer-dsl-web)
|
@@ -12,7 +12,7 @@
|
|
12
12
|
|
13
13
|
You can finally have Ruby developer happiness and productivity in the Frontend! No more wasting time splitting your resources across multiple languages, using badly engineered, over-engineered, or premature-optimization-obsessed JavaScript libraries, fighting JavaScript build issues (e.g. webpack), or rewriting Ruby Backend code in Frontend JavaScript. With [Ruby in the Browser](https://www.youtube.com/watch?v=4AdcfbI6A4c), you can have an exponential jump in development productivity (2x or higher), time-to-release (1/2 or less time), cost (1/2 or cheaper), and maintainability (~50% the code that is simpler and more readable) over JavaScript libraries like React, Angular, Ember, Vue, and Svelte, while being able to reuse Backend Ruby code as is in the Frontend for faster interactions when needed. Also, with Frontend Ruby, companies can cut their hiring budget in half by having Backend Ruby Software Engineers do Frontend Development in Ruby! [Ruby in the Browser](https://www.youtube.com/watch?v=4AdcfbI6A4c) finally fulfills every smart highly-productive Rubyist's dream by bringing Ruby productivity fun to Frontend Development, the same productivity fun you had for years and decades in Backend Development.
|
14
14
|
|
15
|
-
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for Web enables building Web Frontends using [Ruby in the Browser](https://www.youtube.com/watch?v=4AdcfbI6A4c), as per [Matz's recommendation in his RubyConf 2022 keynote speech to replace JavaScript with Ruby](https://youtu.be/knutsgHTrfQ?t=789). It supports Rails' principle of the One Person Framework by not requiring any extra developers with JavaScript expertise, yet enabling Ruby (Backend) Software Engineers to develop the Frontend with Ruby code that is better than any JavaScript code produced by JS developers. It aims at providing the simplest, most intuitive, most straight-forward, and most productive frontend framework in existence. The framework follows the Ruby way (with [DSLs](https://martinfowler.com/books/dsl.html) and [TIMTOWTDI](https://en.wiktionary.org/wiki/TMTOWTDI#English)) and the Rails way ([Convention over Configuration](https://rubyonrails.org/doctrine)) in building Isomorphic Ruby on Rails Applications. It provides a Ruby [HTML DSL](#usage) (including full support for [SVG](#hello-svg)), which uniquely enables writing both structure code and logic code in one language. It supports both Unidirectional (One-Way) [Data-Binding](#hello-data-binding) (using `<=`) and Bidirectional (Two-Way) [Data-Binding](#hello-data-binding) (using `<=>`). Dynamic rendering (and re-rendering) of HTML content is also supported via [Content Data-Binding](#hello-content-data-binding). Modular design is supported with [Glimmer Web Components](#hello-component)
|
15
|
+
[Glimmer](https://github.com/AndyObtiva/glimmer) DSL for Web enables building Web Frontends using [Ruby in the Browser](https://www.youtube.com/watch?v=4AdcfbI6A4c), as per [Matz's recommendation in his RubyConf 2022 keynote speech to replace JavaScript with Ruby](https://youtu.be/knutsgHTrfQ?t=789). It supports Rails' principle of the One Person Framework by not requiring any extra developers with JavaScript expertise, yet enabling Ruby (Backend) Software Engineers to develop the Frontend with Ruby code that is better than any JavaScript code produced by JS developers. It aims at providing the simplest, most intuitive, most straight-forward, and most productive frontend framework in existence. The framework follows the Ruby way (with [DSLs](https://martinfowler.com/books/dsl.html) and [TIMTOWTDI](https://en.wiktionary.org/wiki/TMTOWTDI#English)) and the Rails way ([Convention over Configuration](https://rubyonrails.org/doctrine)) in building Isomorphic Ruby on Rails Applications. It provides a Ruby [HTML DSL](#usage) (including full support for [SVG](#hello-svg)), which uniquely enables writing both structure code and logic code in one language. It supports both Unidirectional (One-Way) [Data-Binding](#hello-data-binding) (using `<=`) and Bidirectional (Two-Way) [Data-Binding](#hello-data-binding) (using `<=>`). Dynamic rendering (and re-rendering) of HTML content is also supported via [Content Data-Binding](#hello-content-data-binding). Modular design is supported with [Glimmer Web Components](#hello-component), [Component Slots](#hello-component-slots), and Component Custom Event Listeners. And, a Ruby CSS DSL is supported with the included [Glimmer DSL for CSS](https://github.com/AndyObtiva/glimmer-dsl-css). To automatically convert legacy HTML & CSS code to Glimmer DSL Ruby code, Software Engineers could use the included [`html_to_glimmer`](https://github.com/AndyObtiva/glimmer-dsl-xml#html-to-glimmer-converter) and [`css_to_glimmer`](https://github.com/AndyObtiva/glimmer-dsl-css#css-to-glimmer-converter) commands. Many [samples](#samples) are demonstrated in the [Rails sample app](https://github.com/AndyObtiva/sample-glimmer-dsl-web-rails7-app) (there is a very minimal [Standalone [No Rails] static site sample app](https://github.com/Largo/glimmer-dsl-web-standalone-demo) too). You can finally live in pure Rubyland on the Web in both the frontend and backend with [Glimmer DSL for Web](https://rubygems.org/gems/glimmer-dsl-web)!
|
16
16
|
|
17
17
|
[Glimmer DSL for Web](https://rubygems.org/gems/glimmer-dsl-web) aims to be a very simple Ruby-based drop-in replacement for your existing JavaScript Frontend library (e.g. React, Angular, Vue, Ember, Svelte) or your JavaScript Frontend layer in general. It does not change how your Frontend interacts with the Backend, meaning you can continue to write Rails Backend API endpoints as needed and make HTTP/Ajax requests or read data embedded in elements, but from [Ruby in the Browser](https://www.youtube.com/watch?v=4AdcfbI6A4c). Whatever is possible in JavaScript is possible when using Glimmer DSL for Web as it integrates with any existing JavaScript library. The [Rails sample app](https://github.com/AndyObtiva/sample-glimmer-dsl-web-rails7-app) demonstrates how to [make HTTP calls](https://github.com/AndyObtiva/sample-glimmer-dsl-web-rails7-app/blob/master/app/assets/opal/sample_selector/models/sample_api.rb) and how to [integrate with a JavaScript library](https://github.com/AndyObtiva/sample-glimmer-dsl-web-rails7-app/blob/master/app/views/layouts/application.html.erb) (highlightjs) that performs [code syntax highlighting](https://github.com/AndyObtiva/sample-glimmer-dsl-web-rails7-app/blob/master/app/assets/opal/sample_selector.rb).
|
18
18
|
|
@@ -1400,7 +1400,7 @@ rails new glimmer_app_server
|
|
1400
1400
|
Add the following to `Gemfile`:
|
1401
1401
|
|
1402
1402
|
```
|
1403
|
-
gem 'glimmer-dsl-web', '~> 0.
|
1403
|
+
gem 'glimmer-dsl-web', '~> 0.6.0'
|
1404
1404
|
```
|
1405
1405
|
|
1406
1406
|
Run:
|
@@ -1629,7 +1629,7 @@ Disable the `webpacker` gem line in `Gemfile`:
|
|
1629
1629
|
Add the following to `Gemfile`:
|
1630
1630
|
|
1631
1631
|
```ruby
|
1632
|
-
gem 'glimmer-dsl-web', '~> 0.
|
1632
|
+
gem 'glimmer-dsl-web', '~> 0.6.0'
|
1633
1633
|
```
|
1634
1634
|
|
1635
1635
|
Run:
|
@@ -3059,7 +3059,7 @@ class HelloComponentSlots
|
|
3059
3059
|
h1('Shipping Address')
|
3060
3060
|
legend('This is the address that is used for shipping your purchase.', style: {margin_bottom: 10})
|
3061
3061
|
}
|
3062
|
-
address_footer { # contribute elements to the
|
3062
|
+
address_footer { # contribute elements to the address_footer component slot
|
3063
3063
|
p(sub("#{strong('Note:')} #{em('Purchase will be returned if the Shipping Address does not accept it in one week.')}"))
|
3064
3064
|
}
|
3065
3065
|
}
|
@@ -3069,7 +3069,7 @@ class HelloComponentSlots
|
|
3069
3069
|
h1('Billing Address')
|
3070
3070
|
legend('This is the address that is used for your billing method (e.g. credit card).', style: {margin_bottom: 10})
|
3071
3071
|
}
|
3072
|
-
address_footer { # contribute elements to the
|
3072
|
+
address_footer { # contribute elements to the address_footer component slot
|
3073
3073
|
p(sub("#{strong('Note:')} #{em('Payment will fail if payment method does not match the Billing Address.')}"))
|
3074
3074
|
}
|
3075
3075
|
}
|
@@ -3389,7 +3389,9 @@ Screenshot:
|
|
3389
3389
|
|
3390
3390
|
Every Glimmer Web Component can have a `style {}` block that contains CSS styles common to all instances of that element. That block is evaluated against the component class as such.
|
3391
3391
|
|
3392
|
-
Also, within every element, you can add `style(:
|
3392
|
+
Also, within every element, you can add `style(:some_property) <= [model, attribute]` element inline-style data-binding statements to dynamically alter a CSS style property based on some changes to a model attribute.
|
3393
|
+
|
3394
|
+
And, within every element, you can add `class_name(:some_css_class) <= [model, attribute]` element class-inclusion data-binding statements to dynamically alter the inclusion of a CSS class based on some changes to a model attribute.
|
3393
3395
|
|
3394
3396
|
[lib/glimmer-dsl-web/samples/hello/hello_style.rb](/lib/glimmer-dsl-web/samples/hello/hello_style.rb)
|
3395
3397
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/glimmer-dsl-web.gemspec
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: glimmer-dsl-web 0.
|
5
|
+
# stub: glimmer-dsl-web 0.6.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "glimmer-dsl-web".freeze
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.6.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Andy Maleh".freeze]
|
14
|
-
s.date = "2024-08-
|
15
|
-
s.description = "Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework) enables building Web Frontends using Ruby in the Browser, as per Matz's recommendation in his RubyConf 2022 keynote speech to replace JavaScript with Ruby. It aims at providing the simplest, most intuitive, most straight-forward, and most productive frontend framework in existence. The framework follows the Ruby way (with DSLs and TIMTOWTDI) and the Rails way (Convention over Configuration) in building Isomorphic Ruby on Rails Applications. It provides a Ruby HTML DSL, which uniquely enables writing both structure code and logic code in one language. It supports both Unidirectional (One-Way) Data-Binding (using <=) and Bidirectional (Two-Way) Data-Binding (using <=>). Dynamic rendering (and re-rendering) of HTML content is also supported via Content Data-Binding. Modular design is supported with Glimmer Web Components and
|
14
|
+
s.date = "2024-08-24"
|
15
|
+
s.description = "Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework) enables building Web Frontends using Ruby in the Browser, as per Matz's recommendation in his RubyConf 2022 keynote speech to replace JavaScript with Ruby. It aims at providing the simplest, most intuitive, most straight-forward, and most productive frontend framework in existence. The framework follows the Ruby way (with DSLs and TIMTOWTDI) and the Rails way (Convention over Configuration) in building Isomorphic Ruby on Rails Applications. It provides a Ruby HTML DSL, which uniquely enables writing both structure code and logic code in one language. It supports both Unidirectional (One-Way) Data-Binding (using <=) and Bidirectional (Two-Way) Data-Binding (using <=>). Dynamic rendering (and re-rendering) of HTML content is also supported via Content Data-Binding. Modular design is supported with Glimmer Web Components, Component Slots, and Component Custom Event Listeners. And, a Ruby CSS DSL is supported with the included Glimmer DSL for CSS. Many samples are demonstrated in the Rails sample app (there is a very minimal Standalone [No Rails] sample app too). You can finally live in pure Rubyland on the Web in both the frontend and backend with Glimmer DSL for Web! This gem relies on Opal Ruby.".freeze
|
16
16
|
s.email = "andy.am@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
18
18
|
"CHANGELOG.md",
|
@@ -89,6 +89,20 @@ module Glimmer
|
|
89
89
|
@after_render = block
|
90
90
|
end
|
91
91
|
|
92
|
+
def event(event)
|
93
|
+
@events ||= []
|
94
|
+
event = event.to_sym
|
95
|
+
@events << event unless @events.include?(event)
|
96
|
+
end
|
97
|
+
|
98
|
+
def events(*events)
|
99
|
+
if events.empty?
|
100
|
+
@events
|
101
|
+
else
|
102
|
+
events.each { |event| event(event) }
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
92
106
|
def keyword
|
93
107
|
self.name.underscore.gsub('::', '__')
|
94
108
|
end
|
@@ -255,7 +269,7 @@ module Glimmer
|
|
255
269
|
end
|
256
270
|
# <- end of class methods
|
257
271
|
|
258
|
-
attr_reader :markup_root, :parent, :args, :options, :style_block, :component_style, :slot_elements
|
272
|
+
attr_reader :markup_root, :parent, :args, :options, :style_block, :component_style, :slot_elements, :events
|
259
273
|
alias parent_proxy parent
|
260
274
|
|
261
275
|
def initialize(parent, args, options, &content)
|
@@ -272,6 +286,7 @@ module Glimmer
|
|
272
286
|
@args = args
|
273
287
|
options ||= {}
|
274
288
|
@options = self.class.options.merge(options)
|
289
|
+
@events = self.class.instance_variable_get("@events")
|
275
290
|
@content = Util::ProcTracker.new(content) if content
|
276
291
|
# @style_blocks = {} # TODO enable when doing bulk head rendering in the future
|
277
292
|
execute_hooks('before_render')
|
@@ -317,32 +332,84 @@ module Glimmer
|
|
317
332
|
def can_handle_observation_request?(observation_request)
|
318
333
|
observation_request = observation_request.to_s
|
319
334
|
result = false
|
320
|
-
if observation_request.start_with?('
|
321
|
-
property = observation_request.sub(/^
|
335
|
+
if observation_request.start_with?('on_update_') # TODO change to on_someprop_update & document this feature
|
336
|
+
property = observation_request.sub(/^on_update_/, '')
|
322
337
|
result = can_add_observer?(property)
|
338
|
+
elsif observation_request.start_with?('on_')
|
339
|
+
event = observation_request.sub(/^on_/, '')
|
340
|
+
result = can_add_observer?(event)
|
323
341
|
end
|
324
|
-
result || markup_root&.can_handle_observation_request?(observation_request)
|
342
|
+
result || @markup_root&.can_handle_observation_request?(observation_request)
|
325
343
|
end
|
326
344
|
|
327
345
|
def handle_observation_request(observation_request, block)
|
328
346
|
observation_request = observation_request.to_s
|
329
|
-
if observation_request.start_with?('
|
330
|
-
property = observation_request.sub(/^
|
347
|
+
if observation_request.start_with?('on_update_')
|
348
|
+
property = observation_request.sub(/^on_update_/, '') # TODO look into eliminating duplication from above
|
331
349
|
add_observer(DataBinding::Observer.proc(&block), property) if can_add_observer?(property)
|
350
|
+
elsif observation_request.start_with?('on_')
|
351
|
+
event = observation_request.sub(/^on_/, '') # TODO look into eliminating duplication from above
|
352
|
+
add_observer(DataBinding::Observer.proc(&block), event) if can_add_observer?(event)
|
332
353
|
else
|
333
|
-
markup_root.handle_observation_request(observation_request, block)
|
354
|
+
@markup_root.handle_observation_request(observation_request, block)
|
334
355
|
end
|
335
356
|
end
|
336
357
|
|
337
|
-
def can_add_observer?(
|
338
|
-
|
358
|
+
def can_add_observer?(attribute_or_event)
|
359
|
+
can_add_attribute_observer?(attribute_or_event) ||
|
360
|
+
can_add_custom_event_listener?(attribute_or_event)
|
339
361
|
end
|
340
362
|
|
341
|
-
def
|
342
|
-
|
343
|
-
|
363
|
+
def can_add_attribute_observer?(attribute_name)
|
364
|
+
has_instance_method?(attribute_name) || has_instance_method?("#{attribute_name}?")
|
365
|
+
end
|
366
|
+
|
367
|
+
def can_add_custom_event_listener?(event)
|
368
|
+
events.include?(event.to_sym)
|
369
|
+
end
|
370
|
+
|
371
|
+
def add_observer(observer, attribute_or_event)
|
372
|
+
if can_add_attribute_observer?(attribute_or_event)
|
373
|
+
super(observer, attribute_or_event)
|
374
|
+
elsif can_add_custom_event_listener?(attribute_or_event)
|
375
|
+
add_custom_event_listener(observer, attribute_or_event)
|
376
|
+
end
|
377
|
+
end
|
378
|
+
|
379
|
+
def custom_event_listeners_for(event)
|
380
|
+
event = event.to_sym
|
381
|
+
@custom_event_listeners ||= {}
|
382
|
+
@custom_event_listeners[event] ||= []
|
383
|
+
end
|
384
|
+
|
385
|
+
def add_custom_event_listener(observer, event)
|
386
|
+
custom_event_listeners_for(event) << observer
|
387
|
+
end
|
388
|
+
|
389
|
+
def remove_observer(observer, attribute_or_event, options = {})
|
390
|
+
if can_add_attribute_observer?(attribute_or_event)
|
391
|
+
super(observer, attribute_or_event)
|
392
|
+
elsif can_add_custom_event_listener?(attribute_or_event)
|
393
|
+
remove_custom_event_listener(observer, attribute_or_event)
|
394
|
+
end
|
395
|
+
end
|
396
|
+
|
397
|
+
def remove_custom_event_listener(observer, event)
|
398
|
+
event = event.to_sym
|
399
|
+
custom_event_listeners_for(event).delete(observer) if custom_event_listeners_for(event).include?(observer)
|
400
|
+
end
|
401
|
+
|
402
|
+
def notify_listeners(event, *args)
|
403
|
+
if can_add_custom_event_listener?(event)
|
404
|
+
notify_custom_event_listeners(event, *args)
|
344
405
|
else
|
345
|
-
@markup_root
|
406
|
+
@markup_root&.notify_listeners(event)
|
407
|
+
end
|
408
|
+
end
|
409
|
+
|
410
|
+
def notify_custom_event_listeners(event, *args)
|
411
|
+
custom_event_listeners_for(event).each do |listener|
|
412
|
+
listener.call(*args)
|
346
413
|
end
|
347
414
|
end
|
348
415
|
|
@@ -97,9 +97,9 @@ end
|
|
97
97
|
#
|
98
98
|
# Including Glimmer::Web::Component makes this class a View component and automatically
|
99
99
|
# generates a new Glimmer HTML DSL keyword that matches the lowercase underscored version
|
100
|
-
# of the name of the class. AddressForm generates
|
100
|
+
# of the name of the class. AddressForm generates address_form_with_slots keyword, which can be used
|
101
101
|
# elsewhere in Glimmer HTML DSL code as done inside HelloComponentSlots below.
|
102
|
-
class
|
102
|
+
class AddressFormWithSlots
|
103
103
|
include Glimmer::Web::Component
|
104
104
|
|
105
105
|
option :address
|
@@ -149,7 +149,7 @@ class AddressForm
|
|
149
149
|
}
|
150
150
|
}
|
151
151
|
|
152
|
-
div(style:
|
152
|
+
div(style: {margin: 5}) {
|
153
153
|
inner_text <= [address, :summary,
|
154
154
|
computed_by: address.members + ['state_code'],
|
155
155
|
]
|
@@ -199,22 +199,22 @@ class HelloComponentSlots
|
|
199
199
|
|
200
200
|
markup {
|
201
201
|
div {
|
202
|
-
|
202
|
+
address_form_with_slots(address: @shipping_address) {
|
203
203
|
address_header { # contribute elements to the address_header component slot
|
204
204
|
h1('Shipping Address')
|
205
205
|
legend('This is the address that is used for shipping your purchase.', style: {margin_bottom: 10})
|
206
206
|
}
|
207
|
-
address_footer { # contribute elements to the
|
207
|
+
address_footer { # contribute elements to the address_footer component slot
|
208
208
|
p(sub("#{strong('Note:')} #{em('Purchase will be returned if the Shipping Address does not accept it in one week.')}"))
|
209
209
|
}
|
210
210
|
}
|
211
211
|
|
212
|
-
|
212
|
+
address_form_with_slots(address: @billing_address) {
|
213
213
|
address_header { # contribute elements to the address_header component slot
|
214
214
|
h1('Billing Address')
|
215
215
|
legend('This is the address that is used for your billing method (e.g. credit card).', style: {margin_bottom: 10})
|
216
216
|
}
|
217
|
-
address_footer { # contribute elements to the
|
217
|
+
address_footer { # contribute elements to the address_footer component slot
|
218
218
|
p(sub("#{strong('Note:')} #{em('Payment will fail if payment method does not match the Billing Address.')}"))
|
219
219
|
}
|
220
220
|
}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: glimmer-dsl-web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Maleh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: glimmer
|
@@ -240,12 +240,12 @@ description: Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework) en
|
|
240
240
|
both structure code and logic code in one language. It supports both Unidirectional
|
241
241
|
(One-Way) Data-Binding (using <=) and Bidirectional (Two-Way) Data-Binding (using
|
242
242
|
<=>). Dynamic rendering (and re-rendering) of HTML content is also supported via
|
243
|
-
Content Data-Binding. Modular design is supported with Glimmer Web Components
|
244
|
-
Slots. And, a Ruby CSS DSL is supported with
|
245
|
-
samples are demonstrated in the Rails sample
|
246
|
-
[No Rails] sample app too). You can finally
|
247
|
-
both the frontend and backend with Glimmer DSL
|
248
|
-
Ruby.
|
243
|
+
Content Data-Binding. Modular design is supported with Glimmer Web Components, Component
|
244
|
+
Slots, and Component Custom Event Listeners. And, a Ruby CSS DSL is supported with
|
245
|
+
the included Glimmer DSL for CSS. Many samples are demonstrated in the Rails sample
|
246
|
+
app (there is a very minimal Standalone [No Rails] sample app too). You can finally
|
247
|
+
live in pure Rubyland on the Web in both the frontend and backend with Glimmer DSL
|
248
|
+
for Web! This gem relies on Opal Ruby.
|
249
249
|
email: andy.am@gmail.com
|
250
250
|
executables: []
|
251
251
|
extensions: []
|