web_components_rails 2.3.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/lib/web_components_rails/html_bundle_processor.rb +3 -3
- data/lib/web_components_rails/version.rb +1 -1
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2db958cf87cf1baa4da9ebb6d55e972fd50579b65f861257583938185dee190e
|
4
|
+
data.tar.gz: c4af64df3c8d06eb882d6b1a062ba3d4c54295b5c49c032b21d38ccadb1f4bde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f89768dd9ef1cf744f82b2ad16a852242b7db0ed275737a64b1b2f8ac57bc394fde8f3853205a287444a0ff433a4cb1ccfc35f56ffcd2e56aef9eeeec48687a3
|
7
|
+
data.tar.gz: 9390bd3db168d524d6d6a429ebc5347da18aed2f662079c8b2cbe01ada1128f4e25b8f3dedfb5ab01f338cd669f41de88b153c0f4490e6096ee927922578751c
|
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# web_components_rails
|
2
2
|
Ruby gem for using web components in Rails applications.
|
3
3
|
|
4
|
-
[![Build Status](https://travis-ci.org/uniite/web-components-rails.svg)](https://travis-ci.org/uniite/web-components-rails)
|
5
|
-
|
6
4
|
## Usage
|
7
5
|
1. Include the gem in your Gemfile:
|
8
6
|
```ruby
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'securerandom'
|
2
|
-
require '
|
2
|
+
require 'terser'
|
3
3
|
|
4
4
|
# Compresses HTML bundles
|
5
5
|
class WebComponentsRails::HTMLBundleProcessor
|
@@ -67,8 +67,8 @@ class WebComponentsRails::HTMLBundleProcessor
|
|
67
67
|
def optimized_script_tag(doc, raw_js)
|
68
68
|
combined_script_tag = Nokogiri::XML::Element.new('script', doc)
|
69
69
|
|
70
|
-
# Assume
|
71
|
-
minified_js =
|
70
|
+
# Assume terser is fine with defaults for minification
|
71
|
+
minified_js = Terser.compile(raw_js)
|
72
72
|
|
73
73
|
# Data-URI encode the JS (helps a lot in browsers like IE)
|
74
74
|
inlined_js = 'data:text/javascript;base64,'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: web_components_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Botelho
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-10-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -59,19 +59,25 @@ dependencies:
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '3.2'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
|
-
name:
|
62
|
+
name: terser
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
+
- - "~>"
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '1.1'
|
65
68
|
- - ">="
|
66
69
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
70
|
+
version: 1.1.1
|
68
71
|
type: :runtime
|
69
72
|
prerelease: false
|
70
73
|
version_requirements: !ruby/object:Gem::Requirement
|
71
74
|
requirements:
|
75
|
+
- - "~>"
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '1.1'
|
72
78
|
- - ">="
|
73
79
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
80
|
+
version: 1.1.1
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: rspec
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -124,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
124
130
|
- !ruby/object:Gem::Version
|
125
131
|
version: '0'
|
126
132
|
requirements: []
|
127
|
-
rubygems_version: 3.
|
133
|
+
rubygems_version: 3.4.10
|
128
134
|
signing_key:
|
129
135
|
specification_version: 4
|
130
136
|
summary: Web components utils for rails
|