barefoot_js 0.35.8 → 0.37.0
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/lib/barefoot_js.rb +24 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 02bbf6eeb947d4092a320ec5b8c347bc606bd244ad031d3ecda78be7015aae41
|
|
4
|
+
data.tar.gz: e180021f0bf597e2af30271b2e939894ee292448dba0b42e429421123908511d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed1b1b01f79e4f8a74c9c3574523abb2053359f14a71db80f7342dba6ecd32c24b13c8b218f339af167f994f2c2bdc43ef158293ceb6d8a66c5ce14c1b41d824
|
|
7
|
+
data.tar.gz: fc76a6dc65b3bd6362ec80146cb2bc916df3aef14e9148e3c56319bd577c08d73eb5ff914092a04fde609fda8ba3db7c70ddf7b260d12e9c250dcd097f5ff133
|
data/lib/barefoot_js.rb
CHANGED
|
@@ -876,6 +876,30 @@ module BarefootJS
|
|
|
876
876
|
end
|
|
877
877
|
end
|
|
878
878
|
|
|
879
|
+
# `isValidElement(x)` -- the framework "is this a renderable element (not
|
|
880
|
+
# plain text)?" predicate `Slot`'s `asChild` pattern uses (#2266, #3012).
|
|
881
|
+
# Mirrors JS's `'tag' in x && 'props' in x`: true only for a Hash
|
|
882
|
+
# carrying both keys (case-insensitively, matching the case-tolerant key
|
|
883
|
+
# lookups elsewhere in this module -- `get`'s Hash branch above, the Go
|
|
884
|
+
# adapter's `IsValidElement` (bf.go), and the Perl runtime's
|
|
885
|
+
# `is_element` this ports). A passed-through JSX child is represented as
|
|
886
|
+
# pre-rendered markup (a plain String) on this SSR model, so a
|
|
887
|
+
# non-empty STRING child is NOT a valid element -- routing
|
|
888
|
+
# `isValidElement` through bare truthiness here would wrongly take the
|
|
889
|
+
# element-merge branch.
|
|
890
|
+
def is_element(v)
|
|
891
|
+
return false unless v.is_a?(Hash)
|
|
892
|
+
|
|
893
|
+
has_tag = false
|
|
894
|
+
has_props = false
|
|
895
|
+
v.each_key do |k|
|
|
896
|
+
key = k.to_s.downcase
|
|
897
|
+
has_tag = true if key == 'tag'
|
|
898
|
+
has_props = true if key == 'props'
|
|
899
|
+
end
|
|
900
|
+
has_tag && has_props
|
|
901
|
+
end
|
|
902
|
+
|
|
879
903
|
# Mirrors Hono's own CSS-injection guard (`hono/jsx/utils.ts`'s
|
|
880
904
|
# `hasUnsafeStyleValue` -- the ORACLE a dynamic `style={{...}}` value
|
|
881
905
|
# must match, #2261): a hand-rolled structural scan for characters that
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: barefoot_js
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.37.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- kobaken
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-09-
|
|
11
|
+
date: 2026-09-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: tzinfo
|