vite_rails 3.0.15 → 3.0.17
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/CHANGELOG.md +18 -0
- data/lib/vite_rails/tag_helpers.rb +21 -3
- 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: '09ffd4b097008530d82fda12a78c5c8004f022a65e789eac969698d00110b06a'
|
4
|
+
data.tar.gz: 7310a8678f4772e3b9eab6186033705e1c871e44873e62de2de68a6aa26f2bb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7257343e6a237462b31552ef89a72cc77ade0cc639b99ec6d9689fc38ae568e1289882a9e34a092b90d86bfaa0cea03584ee8446f969a32561c62e283533e911
|
7
|
+
data.tar.gz: 9edaaf096099ef3ccf762661c4cea9de82ccc2b6a5d02b5abb47c32cc1321f7dd973ca9c0d63b6ce54090507f1a9144cf6855dae2b76300062707cb8523a62e5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,21 @@
|
|
1
|
+
## [3.0.17](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.16...vite_rails@3.0.17) (2023-10-05)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* add vite_picture_tag for Rails 7.1 ([#409](https://github.com/ElMassimo/vite_ruby/issues/409)) ([4e3762a](https://github.com/ElMassimo/vite_ruby/commit/4e3762a978b7879206dbc48137ba525d0d0ad971))
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
## [3.0.16](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.15...vite_rails@3.0.16) (2023-09-22)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* 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))
|
16
|
+
|
17
|
+
|
18
|
+
|
1
19
|
## [3.0.15](https://github.com/ElMassimo/vite_ruby/compare/vite_rails@3.0.14...vite_rails@3.0.15) (2023-06-19)
|
2
20
|
|
3
21
|
|
@@ -79,6 +79,19 @@ module ViteRails::TagHelpers
|
|
79
79
|
image_tag(vite_asset_path(name), options)
|
80
80
|
end
|
81
81
|
|
82
|
+
# Public: Renders a <picture> tag with one or more Vite asset sources.
|
83
|
+
def vite_picture_tag(*sources, &block)
|
84
|
+
unless Rails.gem_version >= Gem::Version.new('7.1.0')
|
85
|
+
raise NotImplementedError, '`vite_picture_tag` is only available for Rails 7.1 or above.'
|
86
|
+
end
|
87
|
+
|
88
|
+
sources.flatten!
|
89
|
+
options = sources.extract_options!
|
90
|
+
|
91
|
+
vite_sources = sources.map { |src| vite_asset_path(src) }
|
92
|
+
picture_tag(*vite_sources, options, &block)
|
93
|
+
end
|
94
|
+
|
82
95
|
private
|
83
96
|
|
84
97
|
# Internal: Returns the current manifest loaded by Vite Ruby.
|
@@ -88,9 +101,14 @@ private
|
|
88
101
|
|
89
102
|
# Internal: Renders a modulepreload link tag.
|
90
103
|
def vite_preload_tag(*sources, crossorigin:, **options)
|
91
|
-
sources.map { |source|
|
92
|
-
|
93
|
-
|
104
|
+
asset_paths = sources.map { |source| path_to_asset(source) }
|
105
|
+
try(:request).try(
|
106
|
+
:send_early_hints,
|
107
|
+
'Link' => asset_paths.map { |href|
|
108
|
+
%(<#{ href }>; rel=modulepreload; as=script; crossorigin=#{ crossorigin })
|
109
|
+
}.join("\n"),
|
110
|
+
)
|
111
|
+
asset_paths.map { |href|
|
94
112
|
tag.link(rel: 'modulepreload', href: href, as: 'script', crossorigin: crossorigin, **options)
|
95
113
|
}.join("\n").html_safe
|
96
114
|
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.17
|
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-10-05 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.17/vite_rails
|
92
|
+
changelog_uri: https://github.com/ElMassimo/vite_ruby/blob/vite_rails@3.0.17/vite_rails/CHANGELOG.md
|
93
93
|
post_install_message:
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|