vite_rails 3.0.14 → 3.0.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +19 -0
- data/lib/vite_rails/tag_helpers.rb +14 -5
- data/lib/vite_rails/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bb3f141b086aee8a0b40651b824fc6760d47af516037bca0ae91ef8aa3481c47
|
4
|
+
data.tar.gz: c19d6cbb3a4062421691501853f26b4b6c344b0ab9a6502be6ed4504a2b0c33d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d26931a1bbe46f2c11ab59d098a1f59efdacbb0b74999812d2e13858f557d04621d5bb2903f8894ecfea601d281d35e90559254bb10e834f3edfed2c3f41dbcc
|
7
|
+
data.tar.gz: a6335c2c8d1aab0b9e5eb06eb19c47c7c5f332321319ac8310177a1e0ccbfd319286d89ba02d92568d5ad083ada51ac28711f048b53f113fa870a9c2e207b2d3
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
## [3.0.16](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.15...vite_rails@3.0.16) (2023-09-22)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* emit a single early hint per entrypoint in `vite_preload_tag` ([#402](https://github.com/ElMassimo/vite_ruby/issues/402)) ([3f9a60b](https://github.com/ElMassimo/vite_ruby/commit/3f9a60b4bb28858b8460b5fc302ad352a03ba002))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [3.0.15](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.14...vite_rails@3.0.15) (2023-06-19)
|
11
|
+
|
12
|
+
|
13
|
+
### Features
|
14
|
+
|
15
|
+
* add nonce by default to react refresh tag (close [#249](https://github.com/ElMassimo/vite_ruby/issues/249)) ([a31f0a9](https://github.com/ElMassimo/vite_ruby/commit/a31f0a97588568a964b52005beee63217c7bcfa9))
|
16
|
+
* Use javascript_tag helper for vite_react_refresh_tag ([#372](https://github.com/ElMassimo/vite_ruby/issues/372)) ([238c6bd](https://github.com/ElMassimo/vite_ruby/commit/238c6bd211c0fafaa6170f0bdd631a0f6e41d992)), closes [#249](https://github.com/ElMassimo/vite_ruby/issues/249)
|
17
|
+
|
18
|
+
|
19
|
+
|
1
20
|
## [3.0.14](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.13...vite_rails@3.0.14) (2023-02-08)
|
2
21
|
|
3
22
|
|
@@ -10,8 +10,12 @@ module ViteRails::TagHelpers
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# Public: Renders a script tag to enable HMR with React Refresh.
|
13
|
-
def vite_react_refresh_tag
|
14
|
-
vite_manifest.
|
13
|
+
def vite_react_refresh_tag(**options)
|
14
|
+
return unless react_preamble_code = vite_manifest.react_preamble_code
|
15
|
+
|
16
|
+
options[:nonce] = true if Rails::VERSION::MAJOR >= 6 && !options.key?(:nonce)
|
17
|
+
|
18
|
+
javascript_tag(react_preamble_code.html_safe, type: :module, **options)
|
15
19
|
end
|
16
20
|
|
17
21
|
# Public: Resolves the path for the specified Vite asset.
|
@@ -84,9 +88,14 @@ private
|
|
84
88
|
|
85
89
|
# Internal: Renders a modulepreload link tag.
|
86
90
|
def vite_preload_tag(*sources, crossorigin:, **options)
|
87
|
-
sources.map { |source|
|
88
|
-
|
89
|
-
|
91
|
+
asset_paths = sources.map { |source| path_to_asset(source) }
|
92
|
+
try(:request).try(
|
93
|
+
:send_early_hints,
|
94
|
+
'Link' => asset_paths.map { |href|
|
95
|
+
%(<#{ href }>; rel=modulepreload; as=script; crossorigin=#{ crossorigin })
|
96
|
+
}.join("\n"),
|
97
|
+
)
|
98
|
+
asset_paths.map { |href|
|
90
99
|
tag.link(rel: 'modulepreload', href: href, as: 'script', crossorigin: crossorigin, **options)
|
91
100
|
}.join("\n").html_safe
|
92
101
|
end
|
data/lib/vite_rails/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vite_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Máximo Mussini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -88,8 +88,8 @@ homepage: https://github.com/ElMassimo/vite_ruby
|
|
88
88
|
licenses:
|
89
89
|
- MIT
|
90
90
|
metadata:
|
91
|
-
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.
|
92
|
-
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.
|
91
|
+
source_code_uri: https://github.com/ElMassimo/vite_ruby/tree/vite_rails@3.0.16/vite_rails
|
92
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.16/vite_rails/CHANGELOG.md
|
93
93
|
post_install_message:
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|