isomorfeus-preact 23.7.0.rc5 → 23.8.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/browser/delegate_native.rb +3 -1
- data/lib/browser/document.rb +2 -0
- data/lib/browser/element/canvas.rb +2 -0
- data/lib/browser/element/media.rb +2 -0
- data/lib/browser/element.rb +2 -0
- data/lib/browser/event.rb +2 -0
- data/lib/browser/event_target.rb +2 -0
- data/lib/browser/file_list.rb +2 -0
- data/lib/browser/history.rb +4 -2
- data/lib/browser/window.rb +2 -0
- data/lib/isomorfeus/preact/config.rb +2 -0
- data/lib/isomorfeus/preact/version.rb +1 -1
- data/lib/isomorfeus/top_level.rb +2 -0
- data/lib/isomorfeus-preact.rb +2 -0
- data/lib/link.rb +2 -0
- data/lib/lucid_component.rb +2 -0
- data/lib/nano_css.rb +4 -2
- data/lib/preact/component.rb +2 -0
- data/lib/preact/component_resolution.rb +2 -4
- data/lib/preact/html_elements.rb +2 -0
- data/lib/preact/math_ml_elements.rb +2 -0
- data/lib/preact/module_component_resolution.rb +3 -4
- data/lib/preact/svg_elements.rb +2 -0
- data/lib/preact.rb +15 -21
- data/lib/redirect.rb +8 -6
- data/lib/router.rb +2 -0
- data/lib/switch.rb +2 -0
- metadata +12 -13
- data/opal/cgi.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ddc9384a1eb50682d92249ddc5bb104096145c2e735d4e29f279c54abe6670c
|
4
|
+
data.tar.gz: a07b26b674eaf136687d6b9643d4900320da5b260656e08a3a0a1b6b6db353ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 878bd642bcf4afa03506624cac8ecd05a5e53e4b0a773154fdc05454441c0214af69f339512c78953a028e58fe50c5d8312ae6c1088aad47da5d4a08d545152e
|
7
|
+
data.tar.gz: b85b82f6c32e97419d1c01bbd3ac418beb996e436ca729471203958da554de4454d4103484dc4aa61678935eb481d586d5ac971f7fb312c854523e4bd1c926b9
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
module Browser
|
2
4
|
module DelegateNative
|
3
5
|
# Provides a default initializer. This should be overridden in all but the
|
@@ -57,7 +59,7 @@ module Browser
|
|
57
59
|
end
|
58
60
|
|
59
61
|
def respond_to_missing? message, include_all
|
60
|
-
|
62
|
+
message = message.chop if message.end_with? '='
|
61
63
|
property_name = property_for_message(message)
|
62
64
|
return true if `#{property_name} in #@native`
|
63
65
|
false
|
data/lib/browser/document.rb
CHANGED
data/lib/browser/element.rb
CHANGED
data/lib/browser/event.rb
CHANGED
data/lib/browser/event_target.rb
CHANGED
data/lib/browser/file_list.rb
CHANGED
data/lib/browser/history.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
module Browser
|
2
4
|
class History
|
3
5
|
if RUBY_ENGINE == 'opal'
|
@@ -11,11 +13,11 @@ module Browser
|
|
11
13
|
alias :size :length
|
12
14
|
|
13
15
|
def push_state(state, title = '', url = `null`)
|
14
|
-
`#@native.pushState(#{state
|
16
|
+
`#@native.pushState(Object.fromEntries(#{state}), #{title}, #{url})`
|
15
17
|
end
|
16
18
|
|
17
19
|
def replace_state(state, title = '', url = `null`)
|
18
|
-
`#@native.replaceState(#{state
|
20
|
+
`#@native.replaceState(Object.fromEntries(#{state}), #{title}, #{url})`
|
19
21
|
end
|
20
22
|
|
21
23
|
def scroll_restoration
|
data/lib/browser/window.rb
CHANGED
data/lib/isomorfeus/top_level.rb
CHANGED
data/lib/isomorfeus-preact.rb
CHANGED
data/lib/link.rb
CHANGED
data/lib/lucid_component.rb
CHANGED
data/lib/nano_css.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
class NanoCSS
|
2
|
-
KEBAB_REGEX = /[A-Z]
|
4
|
+
KEBAB_REGEX = /[A-Z]/.freeze
|
3
5
|
UNITLESS_NUMBER_PROPS = %w[animation-iteration-count border-image-outset border-image-slice
|
4
6
|
border-image-width box-flex box-flex-group box-ordinal-group column-count columns flex
|
5
7
|
flex-grow flex-positive flex-shrink flex-negative flex-order grid-row grid-row-end
|
6
8
|
grid-row-span grid-row-start grid-column grid-column-end grid-column-span grid-column-start
|
7
9
|
font-weight line-clamp line-height opacity order orphans tabSize widows z-index zoom
|
8
10
|
fill-opacity flood-opacity stop-opacity stroke-dasharray stroke-dashoffset stroke-miterlimit
|
9
|
-
stroke-opacity stroke-width] # from fill-opacity onwards is for SVG
|
11
|
+
stroke-opacity stroke-width].freeze # from fill-opacity onwards is for SVG
|
10
12
|
|
11
13
|
class << self
|
12
14
|
if RUBY_ENGINE == 'opal'
|
data/lib/preact/component.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
module Preact::ComponentResolution
|
2
4
|
if RUBY_ENGINE == 'opal'
|
3
5
|
unless method_defined?(:_preact_component_resolution_original_method_missing)
|
@@ -13,8 +15,6 @@ module Preact::ComponentResolution
|
|
13
15
|
let sc = self.$class();
|
14
16
|
// disable stack traces here for improved performance
|
15
17
|
// if const cannot be found, the orignal method_mising will throw with stacktrace
|
16
|
-
let orig_est = Opal.config.enable_stack_trace;
|
17
|
-
Opal.config.enable_stack_trace = false;
|
18
18
|
try {
|
19
19
|
// disable the const cache for development, so that always the latest constant
|
20
20
|
// version is used to make hot reloading reliable
|
@@ -35,8 +35,6 @@ module Preact::ComponentResolution
|
|
35
35
|
break;
|
36
36
|
} catch(err) { }
|
37
37
|
}
|
38
|
-
} finally {
|
39
|
-
Opal.config.enable_stack_trace = orig_est;
|
40
38
|
}
|
41
39
|
if (constant) {
|
42
40
|
if (!Opal.Isomorfeus.development && !self.$$iso_preact_const_cache[component_name]) {
|
data/lib/preact/html_elements.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
class Module
|
2
4
|
if RUBY_ENGINE == 'opal'
|
3
5
|
unless method_defined?(:_preact_component_class_resolution_original_method_missing)
|
@@ -14,8 +16,7 @@ class Module
|
|
14
16
|
let c = component_name[0];
|
15
17
|
if (c == c.toUpperCase()) {
|
16
18
|
// disable stack traces here for improved performance
|
17
|
-
// if const cannot be found, the orignal
|
18
|
-
Opal.config.enable_stack_trace = false;
|
19
|
+
// if const cannot be found, the orignal method_missing will throw with stacktrace
|
19
20
|
try {
|
20
21
|
// disable the const cache for development, so that always the latest constant
|
21
22
|
// version is used to make hot reloading reliable
|
@@ -26,8 +27,6 @@ class Module
|
|
26
27
|
constant = self.$const_get(component_name);
|
27
28
|
} catch(err) {
|
28
29
|
// nothing
|
29
|
-
} finally {
|
30
|
-
Opal.config.enable_stack_trace = true;
|
31
30
|
}
|
32
31
|
if (constant) {
|
33
32
|
if (!Opal.Isomorfeus.development && !self.$$iso_preact_const_cache[component_name]) {
|
data/lib/preact/svg_elements.rb
CHANGED
data/lib/preact.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# backtick_javascript: true
|
2
|
+
# helpers: hash_get, hash_put
|
2
3
|
|
3
4
|
if RUBY_ENGINE == 'opal'
|
4
5
|
class VNode
|
@@ -65,7 +66,6 @@ module Preact
|
|
65
66
|
const EMPTY_OBJ = Object.create(null);
|
66
67
|
const EMPTY_ARR = [];
|
67
68
|
const slice = EMPTY_ARR.slice;
|
68
|
-
const $has_own = Object.hasOwn || $call.bind(Object.prototype.hasOwnProperty);
|
69
69
|
|
70
70
|
function hash_fetch(hash, key) {
|
71
71
|
let val = $hash_get(hash, key);
|
@@ -84,7 +84,7 @@ module Preact
|
|
84
84
|
else if (typeof value.$$class !== 'undefined') { converted_value = value; }
|
85
85
|
else if (value instanceof Element || value instanceof Node) { converted_value = #{Browser::Element.new(`value`)}; }
|
86
86
|
if (typeof ref === "function") ref.$call(converted_value);
|
87
|
-
else
|
87
|
+
else ref.set("current", converted_value);
|
88
88
|
} catch (e) {
|
89
89
|
_catchError(e, vnode);
|
90
90
|
}
|
@@ -489,11 +489,11 @@ module Preact
|
|
489
489
|
}
|
490
490
|
|
491
491
|
if (value && value !== nil && value.$$is_hash) {
|
492
|
-
value = value
|
492
|
+
value = Object.fromEntries(value);
|
493
493
|
}
|
494
494
|
|
495
495
|
if (oldValue && oldValue !== nil && oldValue.$$is_hash) {
|
496
|
-
oldValue = oldValue
|
496
|
+
oldValue = Object.fromEntries(oldValue);
|
497
497
|
}
|
498
498
|
|
499
499
|
if (oldValue && oldValue !== nil) {
|
@@ -584,7 +584,7 @@ module Preact
|
|
584
584
|
|
585
585
|
function diff_props(dom, new_props, old_props, is_svg, hydrate) {
|
586
586
|
#{`old_props`.each do |prop, value|
|
587
|
-
`if (prop !== "children" && prop !== "key" && !(prop.$$is_string &&
|
587
|
+
`if (prop !== "children" && prop !== "key" && !(prop.$$is_string && new_props.has(prop))) { self.setProperty(dom, prop, null, value, is_svg); }`
|
588
588
|
nil
|
589
589
|
end
|
590
590
|
`new_props`.each do |prop, value|
|
@@ -647,7 +647,7 @@ module Preact
|
|
647
647
|
nodeType
|
648
648
|
);
|
649
649
|
} else {
|
650
|
-
let np = newProps
|
650
|
+
let np = Object.fromEntries(newProps);
|
651
651
|
dom = document.createElement(
|
652
652
|
// We know `newVNode.type` is a string
|
653
653
|
nodeType,
|
@@ -670,7 +670,7 @@ module Preact
|
|
670
670
|
// If excessDomChildren was not null, repopulate it with the current element's children:
|
671
671
|
excessDomChildren = excessDomChildren && slice.call(dom.childNodes);
|
672
672
|
|
673
|
-
oldProps = oldVNode.props ||
|
673
|
+
oldProps = oldVNode.props || new Map();
|
674
674
|
|
675
675
|
let oldHtml = hash_fetch(oldProps, "dangerouslySetInnerHTML");
|
676
676
|
let newHtml = hash_fetch(newProps, "dangerouslySetInnerHTML");
|
@@ -681,9 +681,9 @@ module Preact
|
|
681
681
|
// But, if we are in a situation where we are using existing DOM (e.g. replaceNode)
|
682
682
|
// we should read the existing DOM attributes to diff them
|
683
683
|
if (excessDomChildren != null) {
|
684
|
-
oldProps =
|
684
|
+
oldProps = new Map();
|
685
685
|
for (i = 0; i < dom.attributes.length; i++) {
|
686
|
-
|
686
|
+
oldProps.set(dom.attributes[i].name, dom.attributes[i].value);
|
687
687
|
}
|
688
688
|
}
|
689
689
|
|
@@ -732,8 +732,6 @@ module Preact
|
|
732
732
|
// (as above, don't diff props during hydration)
|
733
733
|
if (!isHydrating) {
|
734
734
|
if (
|
735
|
-
// instead of newProps["$key?"]("value")
|
736
|
-
$has_own(newProps.$$smap, "value") &&
|
737
735
|
(i = hash_fetch(newProps, "value")) !== nil &&
|
738
736
|
// #2756 For the <progress>-element the initial value is 0,
|
739
737
|
// despite the attribute not being present. When the attribute
|
@@ -747,11 +745,7 @@ module Preact
|
|
747
745
|
) {
|
748
746
|
self.setProperty(dom, 'value', i, hash_fetch(oldProps, "value"), false, null);
|
749
747
|
}
|
750
|
-
if (
|
751
|
-
$has_own(newProps.$$smap, "checked") &&
|
752
|
-
(i = hash_fetch(newProps, "checked")) !== nil &&
|
753
|
-
i !== dom.checked
|
754
|
-
) {
|
748
|
+
if ((i = hash_fetch(newProps, "checked")) !== nil && i !== dom.checked) {
|
755
749
|
self.setProperty(dom, 'checked', i, hash_fetch(oldProps, "checked"), false, null);
|
756
750
|
}
|
757
751
|
}
|
@@ -764,7 +758,7 @@ module Preact
|
|
764
758
|
if (newType.declared_props && newType.declared_props !== nil) {
|
765
759
|
#{
|
766
760
|
`newType.declared_props`.each do |prop, value|
|
767
|
-
`if (
|
761
|
+
`if (value.has("default") && !newProps.has(prop)) { newProps.set(prop, value.get("default")) }`
|
768
762
|
nil
|
769
763
|
end
|
770
764
|
}
|
@@ -824,7 +818,7 @@ module Preact
|
|
824
818
|
if (provider && provider !== nil) provider.$sub(c);
|
825
819
|
|
826
820
|
c.props = newProps;
|
827
|
-
if (c.state === nil || !c.state) c.state =
|
821
|
+
if (c.state === nil || !c.state) c.state = new Map();
|
828
822
|
c.context = componentContext;
|
829
823
|
c._globalContext = globalContext;
|
830
824
|
isNew = c._dirty = true;
|
@@ -1055,7 +1049,7 @@ module Preact
|
|
1055
1049
|
// our custom `_children` property.
|
1056
1050
|
vnode,
|
1057
1051
|
ov ? oldVNode : EMPTY_OBJ,
|
1058
|
-
|
1052
|
+
new Map(),
|
1059
1053
|
parentDom.ownerSVGElement !== undefined,
|
1060
1054
|
nohy_reno ? [replaceNode] : ov ? null : parentDom.firstChild ? slice.call(parentDom.childNodes) : null,
|
1061
1055
|
commitQueue,
|
@@ -1220,7 +1214,7 @@ module Preact
|
|
1220
1214
|
end
|
1221
1215
|
|
1222
1216
|
%x{
|
1223
|
-
if (children !== nil && children !== null) {
|
1217
|
+
if (children !== nil && children !== null) { normalized_props.set("children", children); }
|
1224
1218
|
return self.createVNode(type, normalized_props, key, ref, null);
|
1225
1219
|
}
|
1226
1220
|
end
|
data/lib/redirect.rb
CHANGED
@@ -1,17 +1,19 @@
|
|
1
|
+
# backtick_javascript: true
|
2
|
+
|
1
3
|
class Redirect < Preact::Component
|
2
4
|
EVENT_PUSH_STATE = "pushState"
|
3
5
|
EVENT_REPLACE_STATE = "replaceState"
|
4
6
|
|
5
7
|
self.context_type = RouterContext
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
@history =
|
9
|
+
if RUBY_ENGINE == 'opal'
|
10
|
+
def initialize(props, context)
|
11
|
+
super(props, context)
|
12
|
+
@history = if `typeof window !== "undefined"`
|
11
13
|
`window.history`
|
12
|
-
|
14
|
+
else
|
13
15
|
`{ length: 1, state: null, scrollRestoration: "auto", pushState: function(e,t,n){}, replaceState: function(e,t,n){} }`
|
14
|
-
|
16
|
+
end
|
15
17
|
@base = ''
|
16
18
|
end
|
17
19
|
end
|
data/lib/router.rb
CHANGED
data/lib/switch.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-preact
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 23.
|
4
|
+
version: 23.8.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: oj
|
@@ -36,14 +36,14 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 1.
|
39
|
+
version: 1.8.0.alpha1
|
40
40
|
type: :runtime
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 1.
|
46
|
+
version: 1.8.0.alpha1
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: opal-activesupport
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -64,42 +64,42 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 0.
|
67
|
+
version: 0.19.1
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 0.
|
74
|
+
version: 0.19.1
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: isomorfeus-i18n
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - '='
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 23.
|
81
|
+
version: 23.8.0.rc2
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 23.
|
88
|
+
version: 23.8.0.rc2
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: isomorfeus-redux
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 23.
|
95
|
+
version: 23.8.0.rc2
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 23.
|
102
|
+
version: 23.8.0.rc2
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: benchmark-ips
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,14 +120,14 @@ dependencies:
|
|
120
120
|
requirements:
|
121
121
|
- - "~>"
|
122
122
|
- !ruby/object:Gem::Version
|
123
|
-
version: 0.
|
123
|
+
version: 0.9.1
|
124
124
|
type: :development
|
125
125
|
prerelease: false
|
126
126
|
version_requirements: !ruby/object:Gem::Requirement
|
127
127
|
requirements:
|
128
128
|
- - "~>"
|
129
129
|
- !ruby/object:Gem::Version
|
130
|
-
version: 0.
|
130
|
+
version: 0.9.1
|
131
131
|
- !ruby/object:Gem::Dependency
|
132
132
|
name: rake
|
133
133
|
requirement: !ruby/object:Gem::Requirement
|
@@ -226,7 +226,6 @@ files:
|
|
226
226
|
- lib/route.rb
|
227
227
|
- lib/router.rb
|
228
228
|
- lib/switch.rb
|
229
|
-
- opal/cgi.rb
|
230
229
|
- opal/iso_uri.rb
|
231
230
|
- opal/uri/common.rb
|
232
231
|
- opal/uri/generic.rb
|