glimmer-dsl-web 0.7.0 → 0.7.1

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: 1ff3ef1efa40dc4dcc6e202544e7d0fa7be60c80d1f3dc9c465ed27cf62610df
4
- data.tar.gz: da8851cd3e896f236c5cf45b23ff234ceb5854a6814a213e7311bc5f553910f8
3
+ metadata.gz: 7f37d0d4bbc970ce93dc9ded190d19402fae86911c26c6941a45f0da3fa6d2a9
4
+ data.tar.gz: 2a4dd7e2b7a6e5035b513201e0c341c46e4c8604479d161d0bfbe6d2e9a6abbe
5
5
  SHA512:
6
- metadata.gz: 145f156c520f3e25b0f4251fba654fcac9668edf5e03473aa4891fcf970ea92189d8a64be0f93f7fcbd81a9fc28ae541ccf6c99088ce64bbeb9eb9bb97c65450
7
- data.tar.gz: 53ab737627d2cc6fac28e94f6e372a46f9a21af784afb5c4618509a874a684ff574eb85aa6a5a6c469b264c36257c5f66e8469f9d9825442e119341d9e1210ce
6
+ metadata.gz: 067b48f703219cda26d1cbbce6e4b2179216f6b6b9a5354786adfb04e4341a34100b9254d9849f2ad9d742fe1180d083d8f8ebc4a3945fc182f603dbabc9a952
7
+ data.tar.gz: c4b8a62396faa659bc001e854e1d8219f27771d85b561b93d64831c574b42129c0c5c87fec47fae1913b19f2ddeffb4288b54d8ec2e9e009b8377de05406638f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.7.1
4
+
5
+ - Fix issue with not being able to pass arguments containing apostrophe (') to glimmer_component helper (provided by GlimmerHelper)
6
+
3
7
  ## 0.7.0
4
8
 
5
9
  - Rename `element-ID` element CSS classes to `glimmer-element-ID` for a more unique class name that nobody else would be using
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.7.0 (Beta)
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.7.1 (Beta)
2
2
  ## Ruby-in-the-Browser Web Frontend Framework
3
3
  ### The "Rails" of Frontend Frameworks!!! ([Fukuoka Award Winning](https://andymaleh.blogspot.com/2025/01/glimmer-dsl-for-web-wins-in-fukuoka.html))
4
4
  #### Finally, Ruby Developer Productivity, Happiness, and Fun in the Frontend!!!
@@ -7,7 +7,7 @@
7
7
 
8
8
  **(Based on Original [Glimmer](https://github.com/AndyObtiva/glimmer) Library Handling World’s Ruby GUI Needs Since 2007. Beware of Imitators!)**
9
9
 
10
- **([Fukuoka Prefecture Future IT Initiative 2025 Money Forward Award Winner](https://andymaleh.blogspot.com/2025/01/glimmer-dsl-for-web-wins-in-fukuoka.html))**
10
+ **([Fukuoka Prefecture Future IT Initiative 2025 Money Forward Award Winner](https://andymaleh.blogspot.com/2025/01/glimmer-dsl-for-web-wins-in-fukuoka.html)) [(Award Announcement)](https://digitalfukuoka.jp/news/info/528/)**
11
11
 
12
12
  **(Talk Videos: [Intro to Ruby in the Browser](https://youtu.be/4AdcfbI6A4c?si=MmxOrkhIXTDHQoYi) / [Frontend Ruby with Glimmer DSL for Web \[Montreal.rb\]](https://youtu.be/rIZ-ILUv9ME?si=raygUXVPd_7ypWuE) / [Frontend Ruby with Glimmer DSL for Web \[/dev/mtl 2024\]](https://www.youtube.com/watch?v=J2VIY9DMJo4))**
13
13
 
@@ -17,7 +17,7 @@
17
17
 
18
18
  **Endorsement:** *"I'd like to endorse Andy Maleh’s work (Glimmer DSL for Web). I got introduced to it at RubyConf 2024 and have been playing around with it pretty successfully. What I have found most interesting is that I have been writing inside of a rails app, where I have been running the same code for models and presenters inside of MRI rspec. That way I can write tests that verify behavior of the presenters and models and still see them run successfully in the browser. That allows me to have a very nice cycle of refactoring and being confident in my changes without even running it in browser. I just assume that the binding will work and it usually works perfectly."* - Steve Tuckner on January 9, 2024
19
19
 
20
- 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)! [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for Web enables building Web Frontends (aka SPA: Single Page Applications) 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), Component Attribute Listeners, and [Component Custom Event Listeners](#hello-component-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).
20
+ 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)! [Glimmer](https://github.com/AndyObtiva/glimmer) DSL for Web enables building Web Frontends (aka SPA: Single Page Applications) 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) (including a standalone general components gem called [glimmer-web-components](https://github.com/AndyObtiva/glimmer-web-components)), [Component Slots](#hello-component-slots), Component Attribute Listeners, and [Component Custom Event Listeners](#hello-component-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).
21
21
 
22
22
  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 SPA (Single Page Applications), 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.
23
23
 
@@ -31,7 +31,7 @@ Anyone not considering this kind of technology in 2024 is like someone stuck in
31
31
 
32
32
  **Hello, World! Sample**
33
33
 
34
- (Note: in real app development, we build [Glimmer Web Components](#hello-component), but this sample is just introducing basic building blocks towards building [components](#hello-component))
34
+ (Note: in real app development, we build [Glimmer Web Components](#hello-component) and we rely on the [glimmer_component Rails Helper](#hello-glimmer_component-rails-helper) to embed components in ERB Views without needing `Document.ready?`, but this sample is just introducing basic building blocks towards building [components](#hello-component))
35
35
 
36
36
  [lib/glimmer-dsl-web/samples/hello/hello_world.rb](/lib/glimmer-dsl-web/samples/hello/hello_world.rb)
37
37
 
@@ -63,7 +63,7 @@ You can also mount the `div` elsewhere by passing the `parent: parent_css_select
63
63
 
64
64
  **Hello, Button!**
65
65
 
66
- (Note: in real app development, we build [Glimmer Web Components](#hello-component), but this sample is just introducing basic building blocks towards building [components](#hello-component))
66
+ (Note: in real app development, we build [Glimmer Web Components](#hello-component) and we rely on the [glimmer_component Rails Helper](#hello-glimmer_component-rails-helper) to embed components in ERB Views without needing `Document.ready?`, but this sample is just introducing basic building blocks towards building [components](#hello-component))
67
67
 
68
68
  Event listeners can be setup on any element using the same event names used in HTML (e.g. `onclick`) while passing in a standard Ruby block to handle behavior. `$$` gives access to JS global scope from Ruby to invoke functions like `alert`.
69
69
 
@@ -101,7 +101,7 @@ Screenshot:
101
101
 
102
102
  **Hello, Form!**
103
103
 
104
- (Note: in real app development, we build [Glimmer Web Components](#hello-component), but this sample is just introducing basic building blocks towards building [components](#hello-component))
104
+ (Note: in real app development, we build [Glimmer Web Components](#hello-component) and we rely on the [glimmer_component Rails Helper](#hello-glimmer_component-rails-helper) to embed components in ERB Views without needing `Document.ready?`, but this sample is just introducing basic building blocks towards building [components](#hello-component))
105
105
 
106
106
  [Glimmer DSL for Web](https://rubygems.org/gems/glimmer-dsl-web) gives access to all Web Browser built-in features like HTML form validations, input focus, events, and element functions from a very terse and productive Ruby HTML DSL. Also, you can apply CSS styles by including directly in Ruby code as a string, using [Glimmer DSL for CSS](https://github.com/AndyObtiva/glimmer-dsl-css), or managing CSS completely separately using something like [SCSS](https://sass-lang.com/). The CSS techniques could be combined as well, like by managing common reusable CSS styles separately in SCSS, but adding component specific CSS styles in Ruby when it is more convenient.
107
107
 
@@ -261,7 +261,7 @@ Screenshot:
261
261
 
262
262
  **Hello, Data-Binding!**
263
263
 
264
- (Note: in real app development, we build [Glimmer Web Components](#hello-component), but this sample is just introducing basic building blocks towards building [components](#hello-component))
264
+ (Note: in real app development, we build [Glimmer Web Components](#hello-component) and we rely on the [glimmer_component Rails Helper](#hello-glimmer_component-rails-helper) to embed components in ERB Views without needing `Document.ready?`, but this sample is just introducing basic building blocks towards building [components](#hello-component))
265
265
 
266
266
  [Glimmer DSL for Web](https://rubygems.org/gems/glimmer-dsl-web) intuitively supports both Unidirectional (One-Way) Data-Binding via the `<=` operator and Bidirectional (Two-Way) Data-Binding via the `<=>` operator, incredibly simplifying how to sync View properties with Model attributes with the simplest code to reason about.
267
267
 
@@ -438,7 +438,7 @@ Screenshot:
438
438
 
439
439
  **Hello, Content Data-Binding!**
440
440
 
441
- (Note: in real app development, we build [Glimmer Web Components](#hello-component), but this sample is just introducing basic building blocks towards building [components](#hello-component))
441
+ (Note: in real app development, we build [Glimmer Web Components](#hello-component) and we rely on the [glimmer_component Rails Helper](#hello-glimmer_component-rails-helper) to embed components in ERB Views without needing `Document.ready?`, but this sample is just introducing basic building blocks towards building [components](#hello-component))
442
442
 
443
443
  If you need to regenerate HTML element content dynamically, you can use Content Data-Binding to effortlessly
444
444
  rebuild HTML elements based on changes in a Model attribute that provides the source data.
@@ -1387,6 +1387,14 @@ Once done, read [Usage](#usage) instructions. Note that for serious app usage, i
1387
1387
 
1388
1388
  (NOTE: Keep in mind this is a Beta. If you run into issues, read the [FAQ](#faq) in case they are addressed there (e.g. [I sometimes get an Opal error that makes no sense in relation to my code. How do I fix it?](https://github.com/AndyObtiva/glimmer-dsl-web/blob/master/README.md#i-sometimes-get-an-opal-error-that-makes-no-sense-in-relation-to-my-code-how-do-i-fix-it)) and try to go back to a [previous revision](https://rubygems.org/gems/glimmer-dsl-web/versions). Also, there is a slight chance any issues you encounter are fixed in master or some other branch that you could check out instead)
1389
1389
 
1390
+ ### Rails 8
1391
+
1392
+ Rails 8 instructions are not ready yet though they would rely on the `opal --watch` command in the Development environment to generate JavaScript files in the directory that propshaft is setup with, and Rails 8 would rely on the `opal` command to generate JavaScript files for the Production environment.
1393
+
1394
+ Instructions will be added in the future.
1395
+
1396
+ If you want to help contribute Rails 8 instructions, please look at the Rails 7 instructions and see what needs to be adjusted in light of the first statement above about using `opal --watch` in Development and `opal` in Production.
1397
+
1390
1398
  ### Rails 7
1391
1399
 
1392
1400
  (NOTE: In the future, we plan to automate the setup steps below. If you would like to help contribute that to the project, please do so and open a Pull Request.)
@@ -1408,7 +1416,7 @@ rails new glimmer_app_server
1408
1416
  Add the following to `Gemfile`:
1409
1417
 
1410
1418
  ```
1411
- gem 'glimmer-dsl-web', '~> 0.7.0'
1419
+ gem 'glimmer-dsl-web', '~> 0.7.1'
1412
1420
  ```
1413
1421
 
1414
1422
  Run:
@@ -4599,6 +4607,11 @@ Here is a list of notable 3rd party gems used by Glimmer DSL for Web:
4599
4607
  - [opal-async](https://github.com/AndyObtiva/opal-async): Non-blocking tasks and enumerators for Web.
4600
4608
  - [to_collection](https://github.com/AndyObtiva/to_collection): Treat an array of objects and a singular object uniformly as a collection of objects.
4601
4609
 
4610
+ Here is a list of 3rd party gems that compliment Glimmer DSL for Web:
4611
+ - [glimmer-web-components](https://github.com/AndyObtiva/glimmer-web-components)
4612
+
4613
+ ![glimmer-web-components](https://github.com/AndyObtiva/glimmer-web-components/raw/master/screenshots/glimmer-web-components-multi-checkbox-dropdown.gif)
4614
+
4602
4615
  ## Influences and Inspiration
4603
4616
 
4604
4617
  - https://github.com/inesita-rb/inesita
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -2,16 +2,16 @@
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.7.0 ruby lib
5
+ # stub: glimmer-dsl-web 0.7.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "glimmer-dsl-web".freeze
9
- s.version = "0.7.0"
9
+ s.version = "0.7.1".freeze
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 = "2025-03-01"
14
+ s.date = "1980-01-02"
15
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 = [
@@ -98,24 +98,24 @@ Gem::Specification.new do |s|
98
98
  ]
99
99
  s.homepage = "http://github.com/AndyObtiva/glimmer-dsl-web".freeze
100
100
  s.licenses = ["MIT".freeze]
101
- s.rubygems_version = "3.4.10".freeze
101
+ s.rubygems_version = "3.6.7".freeze
102
102
  s.summary = "Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework)".freeze
103
103
 
104
104
  s.specification_version = 4
105
105
 
106
- s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 2.8.0"])
107
- s.add_runtime_dependency(%q<glimmer-dsl-xml>.freeze, ["~> 1.4.0"])
108
- s.add_runtime_dependency(%q<glimmer-dsl-css>.freeze, ["~> 1.5.2"])
109
- s.add_runtime_dependency(%q<opal>.freeze, ["= 1.8.2"])
110
- s.add_runtime_dependency(%q<opal-rails>.freeze, ["~> 2.0.4"])
111
- s.add_runtime_dependency(%q<opal-async>.freeze, ["~> 1.4.1"])
112
- s.add_runtime_dependency(%q<opal-jquery>.freeze, ["~> 0.5.2"])
113
- s.add_runtime_dependency(%q<to_collection>.freeze, [">= 2.0.1", "< 3.0.0"])
114
- s.add_development_dependency(%q<puts_debuggerer>.freeze, [">= 1.0.1"])
115
- s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0", "< 14.0.0"])
116
- s.add_development_dependency(%q<rake-tui>.freeze, [">= 0"])
117
- s.add_development_dependency(%q<jeweler>.freeze, [">= 2.3.9", "< 3.0.0"])
118
- s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1", "< 7.0.0"])
119
- s.add_development_dependency(%q<opal-rspec>.freeze, ["~> 0.8.0.alpha2"])
106
+ s.add_runtime_dependency(%q<glimmer>.freeze, ["~> 2.8.0".freeze])
107
+ s.add_runtime_dependency(%q<glimmer-dsl-xml>.freeze, ["~> 1.4.0".freeze])
108
+ s.add_runtime_dependency(%q<glimmer-dsl-css>.freeze, ["~> 1.5.2".freeze])
109
+ s.add_runtime_dependency(%q<opal>.freeze, ["= 1.8.2".freeze])
110
+ s.add_runtime_dependency(%q<opal-rails>.freeze, ["~> 2.0.4".freeze])
111
+ s.add_runtime_dependency(%q<opal-async>.freeze, ["~> 1.4.1".freeze])
112
+ s.add_runtime_dependency(%q<opal-jquery>.freeze, ["~> 0.5.2".freeze])
113
+ s.add_runtime_dependency(%q<to_collection>.freeze, [">= 2.0.1".freeze, "< 3.0.0".freeze])
114
+ s.add_development_dependency(%q<puts_debuggerer>.freeze, [">= 1.0.1".freeze])
115
+ s.add_development_dependency(%q<rake>.freeze, [">= 10.1.0".freeze, "< 14.0.0".freeze])
116
+ s.add_development_dependency(%q<rake-tui>.freeze, [">= 0".freeze])
117
+ s.add_development_dependency(%q<jeweler>.freeze, [">= 2.3.9".freeze, "< 3.0.0".freeze])
118
+ s.add_development_dependency(%q<rdoc>.freeze, [">= 6.2.1".freeze, "< 7.0.0".freeze])
119
+ s.add_development_dependency(%q<opal-rspec>.freeze, ["~> 0.8.0.alpha2".freeze])
120
120
  end
121
121
 
@@ -12,10 +12,11 @@ module GlimmerHelper
12
12
  next_id_number = GlimmerHelper.next_id_number
13
13
  component_id = "glimmer_component_#{next_id_number}"
14
14
  component_script_container_id = "glimmer_component_script_container_#{next_id_number}"
15
+ component_script_tag_id = "glimmer_component_script_#{next_id_number}"
15
16
  component_args_json = JSON.dump(component_args)
16
17
  opal_script = <<~OPAL
17
18
  require 'glimmer-dsl-web'
18
- component_args_json = '#{component_args_json}'
19
+ component_args_json = $$.document.getElementById("#{component_script_tag_id}").dataset.componentArgs
19
20
  component_args = JSON.parse(component_args_json)
20
21
  component_args << {} if !component_args.last.is_a?(Hash)
21
22
  component_args.last[:parent] = "##{component_id}"
@@ -27,7 +28,7 @@ module GlimmerHelper
27
28
  content_tag(:div, id: component_script_container_id, class: ['glimmer_component_script_container', "#{component_file}_script_container"], 'data-turbo': 'false') do
28
29
  content_tag(:div, '', id: component_id, class: ['glimmer_component', component_file]) +
29
30
  javascript_include_tag(component_asset_path, "data-turbolinks-track": "reload") +
30
- content_tag(:script, raw(js_script), type: 'application/javascript', "data-turbo-eval": "false")
31
+ content_tag(:script, raw(js_script), id: component_script_tag_id, type: 'application/javascript', "data-turbo-eval": "false", "data-component-args": component_args_json)
31
32
  end
32
33
  end
33
34
  end
@@ -476,6 +476,8 @@ module Glimmer
476
476
  end
477
477
  end
478
478
 
479
+ alias to_s dom
480
+
479
481
  def children_dom_content
480
482
  children.map(&:dom).join
481
483
  end
@@ -21,10 +21,10 @@
21
21
 
22
22
  require 'opal'
23
23
 
24
- GLIMMER_DSL_OPAL_ROOT = File.expand_path('../..', __FILE__)
25
- GLIMMER_DSL_OPAL_LIB = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib')
24
+ GLIMMER_DSL_WEB_ROOT = File.expand_path('../..', __FILE__)
25
+ GLIMMER_DSL_WEB_LIB = File.join(GLIMMER_DSL_WEB_ROOT, 'lib')
26
26
 
27
- $LOAD_PATH.unshift(GLIMMER_DSL_OPAL_LIB)
27
+ $LOAD_PATH.unshift(GLIMMER_DSL_WEB_LIB)
28
28
 
29
29
  if RUBY_ENGINE != 'opal'
30
30
  require 'opal-rails'
@@ -32,12 +32,12 @@ if RUBY_ENGINE != 'opal'
32
32
  require 'opal-jquery'
33
33
  require 'glimmer/helpers/glimmer_helper'
34
34
  else
35
- # GLIMMER_DSL_OPAL_MISSING = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib', 'glimmer-dsl-opal', 'missing')
35
+ # GLIMMER_DSL_WEB_MISSING = File.join(GLIMMER_DSL_WEB_ROOT, 'lib', 'glimmer-dsl-opal', 'missing')
36
36
 
37
- # $LOAD_PATH.unshift(GLIMMER_DSL_OPAL_MISSING) # missing Ruby classes/methods
37
+ # $LOAD_PATH.unshift(GLIMMER_DSL_WEB_MISSING) # missing Ruby classes/methods
38
38
  # TODO look into making append_path work (causing some trouble right now)
39
39
  # Opal.append_path File.expand_path('../glimmer-dsl-opal/missing', __FILE__)
40
- # Opal.append_path GLIMMER_DSL_OPAL_MISSING
40
+ # Opal.append_path GLIMMER_DSL_WEB_MISSING
41
41
  module Kernel
42
42
  def include_package(package)
43
43
  # No Op (just a shim)
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Maleh
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2025-03-01 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: glimmer
@@ -333,7 +332,6 @@ homepage: http://github.com/AndyObtiva/glimmer-dsl-web
333
332
  licenses:
334
333
  - MIT
335
334
  metadata: {}
336
- post_install_message:
337
335
  rdoc_options: []
338
336
  require_paths:
339
337
  - lib
@@ -348,8 +346,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
348
346
  - !ruby/object:Gem::Version
349
347
  version: '0'
350
348
  requirements: []
351
- rubygems_version: 3.4.10
352
- signing_key:
349
+ rubygems_version: 3.6.7
353
350
  specification_version: 4
354
351
  summary: Glimmer DSL for Web (Ruby in the Browser Web Frontend Framework)
355
352
  test_files: []