hot_module 1.0.0.alpha6 → 1.0.0.alpha8
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 +9 -0
- data/Gemfile.lock +1 -1
- data/lib/hot_module/component_renderer.rb +6 -1
- data/lib/hot_module/version.rb +1 -1
- data/lib/hot_module.rb +2 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 990a6f28bab40a5307b988d5409362c5f3b5c913306785acc893b30d01a53ca2
|
4
|
+
data.tar.gz: 52cbe7db9a562446c7d4c5c1b8327863aa2128f9fd78cc55945a48441c212d32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff5eb0bcf2c3c1b3902196b394f61ca7c206a5443c15791e716a441375694c82f8f887b90ff218d7e6fa4626e79b67262e0eae82112e46d31d0e4191b1077e29
|
7
|
+
data.tar.gz: ccebd667ca63b6beb81a4a20eb0f1e9d8aeea34b4b7e15d3efc79776bc60656c5b234b8b8cdf253acfc37bb692feac0c4664e7ffb55274f070d2561d5cce96be
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [1.0.0.alpha8] - 2023-03-23
|
4
|
+
|
5
|
+
- Alias `HoTModuLe` to `HotModule` for people who are annoyed :)
|
6
|
+
- Fix bug with view context
|
7
|
+
|
8
|
+
## [1.0.0.alpha7] - 2023-03-23
|
9
|
+
|
10
|
+
- Provide original child nodes through the view context
|
11
|
+
|
3
12
|
## [1.0.0.alpha6] - 2023-03-23
|
4
13
|
|
5
14
|
- Indicate that child content in Bridgetown is HTML safe
|
data/Gemfile.lock
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module HoTModuLe
|
4
|
+
class View < Bridgetown::ERBView
|
5
|
+
attr_accessor :child_nodes
|
6
|
+
end
|
7
|
+
|
4
8
|
class ComponentRenderer < Bridgetown::Builder
|
5
9
|
def build
|
6
10
|
registered_tags = {}
|
@@ -15,7 +19,7 @@ module HoTModuLe
|
|
15
19
|
|
16
20
|
def render_html_modules(registered_tags) # rubocop:todo Metrics
|
17
21
|
inspect_html do |doc, resource| # rubocop:todo Metrics
|
18
|
-
view_context =
|
22
|
+
view_context = HoTModuLe::View.new(resource)
|
19
23
|
|
20
24
|
registered_tags.each do |tag_name, component|
|
21
25
|
doc.xpath("//#{tag_name}").reverse.each do |node|
|
@@ -38,6 +42,7 @@ module HoTModuLe
|
|
38
42
|
attrs.merge!(new_attrs)
|
39
43
|
attrs.transform_keys!(&:to_sym)
|
40
44
|
|
45
|
+
view_context.child_nodes = node.children
|
41
46
|
new_node = node.replace(
|
42
47
|
component.new(**attrs).render_in(view_context) { node.children.to_html.html_safe }
|
43
48
|
)
|
data/lib/hot_module/version.rb
CHANGED
data/lib/hot_module.rb
CHANGED