isomorfeus-redux 4.0.22 → 4.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/iso_opal.rb +9 -0
- data/lib/isomorfeus-redux.rb +2 -1
- data/lib/isomorfeus/core_ext/kernel.rb +1 -1
- data/lib/isomorfeus/execution_environment.rb +16 -10
- data/lib/redux/store.rb +3 -3
- data/lib/redux/version.rb +1 -1
- metadata +9 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19fc76d501f48926088f0cd807d7790c157583ea8b03ab484f9cd9a8c1c6f0d6
|
4
|
+
data.tar.gz: 180d4709e3a045b9a103e88eee61965c7a26e09581c806edfb03718ce8cce313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e8084bb775a249b1b43ecc33007e0ae284ba189e8adf5964ca3079517b19115ff818119631d83e84ccdf4abfcdcecc2a3f9d6bf656b0e2a8f34dbb7f1d2167e
|
7
|
+
data.tar.gz: 7e97d4a62d4decdccd50481a177c785712a537aac0ca5721ee8f60de71655d174afd50fb13cf20f870ff4529a6aff65827c3116f99fbc604c123b39a0ceeaa80
|
data/README.md
CHANGED
@@ -7,12 +7,12 @@ At the [Isomorfeus Framework Project](http://isomorfeus.com)
|
|
7
7
|
|
8
8
|
## Versioning
|
9
9
|
isomorfeus-redux version follows the Redux version which features and API it implements.
|
10
|
-
Isomorfeus-redux 4.
|
10
|
+
Isomorfeus-redux 4.1.x implements features and the API of Redux 4.1 and should be used with Redux 4.1
|
11
11
|
|
12
12
|
## Installation
|
13
13
|
To install redux with the matching version:
|
14
14
|
```
|
15
|
-
yarn add redux@4.0
|
15
|
+
yarn add redux@4.1.0
|
16
16
|
```
|
17
17
|
then add to the Gemfile:
|
18
18
|
```ruby
|
@@ -34,7 +34,7 @@ For full functionality the following are required:
|
|
34
34
|
For the Gemfile:
|
35
35
|
```ruby
|
36
36
|
gem 'opal', github: 'janbiedermann/opal', branch: 'es6_modules_1_1'
|
37
|
-
gem 'opal-webpack-loader', '~> 0.
|
37
|
+
gem 'opal-webpack-loader', '~> 0.10.1'
|
38
38
|
```
|
39
39
|
|
40
40
|
## Usage within Isomorfeus
|
data/lib/iso_opal.rb
ADDED
data/lib/isomorfeus-redux.rb
CHANGED
@@ -23,9 +23,10 @@ else
|
|
23
23
|
promise_path = File.join(opal_path, 'stdlib', 'promise.rb')
|
24
24
|
require promise_path
|
25
25
|
require 'redux/version'
|
26
|
+
require 'iso_opal'
|
26
27
|
|
27
28
|
Opal.append_path(__dir__.untaint)
|
28
29
|
|
29
30
|
path = File.expand_path('app')
|
30
|
-
Opal.append_path(path) unless
|
31
|
+
Opal.append_path(path) unless IsoOpal.paths_include?(path)
|
31
32
|
end
|
@@ -8,6 +8,7 @@ module Isomorfeus
|
|
8
8
|
attr_accessor :on_ios
|
9
9
|
attr_accessor :on_android
|
10
10
|
attr_accessor :on_mobile
|
11
|
+
attr_accessor :on_pad
|
11
12
|
attr_accessor :on_database
|
12
13
|
attr_accessor :on_tvos
|
13
14
|
attr_accessor :on_androidtv
|
@@ -48,6 +49,11 @@ module Isomorfeus
|
|
48
49
|
@on_mobile
|
49
50
|
end
|
50
51
|
|
52
|
+
def on_pad?
|
53
|
+
# true if running on a pad
|
54
|
+
@on_pad
|
55
|
+
end
|
56
|
+
|
51
57
|
def on_database?
|
52
58
|
# true if running in database context
|
53
59
|
@on_database
|
@@ -70,16 +76,17 @@ module Isomorfeus
|
|
70
76
|
end
|
71
77
|
|
72
78
|
self.on_ssr = `(typeof process === 'object' && typeof process.release === 'object' && typeof process.release.name === 'string' && process.release.name === 'node') ? true : false`
|
73
|
-
self.on_desktop =
|
74
|
-
self.on_ios = `(typeof Platform === 'object' &&
|
75
|
-
self.on_android = `(typeof Platform === 'object' &&
|
79
|
+
self.on_desktop = false
|
80
|
+
self.on_ios = `(typeof Platform === 'object' && Platform.OS.toLowerCase().includes('ios')) ? true : false`
|
81
|
+
self.on_android = `(typeof Platform === 'object' && Platform.OS.toLowerCase().includes('android')) ? true : false`
|
82
|
+
self.on_pad = `(typeof Platform === 'object') ? (Platform.OS.toLowerCase().includes('ios') && Platform.isPad) : false`
|
83
|
+
self.on_tvos = `(typeof Platform === 'object') ? (Platform.isTV && Platform.OS.toLowerCase().includes('ios') && Platform.isTVOS) : false`
|
84
|
+
self.on_androidtv = `(typeof Platform === 'object') ? (Platform.isTV && Platform.OS.toLowerCase().includes('android')) : false`
|
85
|
+
self.on_tv = `(typeof Platform === 'object') ? Platform.isTV : false`
|
76
86
|
self.on_mobile = self.on_ios? || self.on_android?
|
77
87
|
self.on_database = false
|
78
|
-
self.on_browser = !self.on_ssr? && !self.on_desktop? && !self.on_mobile? && !self.on_database?
|
79
88
|
self.on_server = false
|
80
|
-
self.
|
81
|
-
self.on_androidtv = false
|
82
|
-
self.on_tv = false
|
89
|
+
self.on_browser = !self.on_ssr? && !self.on_desktop? && !self.on_mobile? && !self.on_database? && !self.on_tv?
|
83
90
|
else
|
84
91
|
class << self
|
85
92
|
def on_ssr?; false; end
|
@@ -87,15 +94,14 @@ module Isomorfeus
|
|
87
94
|
def on_ios?; false; end
|
88
95
|
def on_android?; false; end
|
89
96
|
def on_mobile?; false; end
|
97
|
+
def on_pad?; false; end
|
90
98
|
def on_database?; false; end
|
91
99
|
def on_browser?; false; end
|
92
100
|
def on_tvos?; false; end
|
93
101
|
def on_androidtv?; false; end
|
94
102
|
def on_tv?; false; end
|
95
103
|
|
96
|
-
def on_server
|
97
|
-
true # so true ...
|
98
|
-
end
|
104
|
+
def on_server?; true; end
|
99
105
|
end
|
100
106
|
end
|
101
107
|
end
|
data/lib/redux/store.rb
CHANGED
@@ -131,7 +131,7 @@ module Redux
|
|
131
131
|
@deferred_actions[type] = [] unless @deferred_actions.key?(type)
|
132
132
|
@deferred_actions[type].push(action)
|
133
133
|
@last_dispatch_time = `Date.now()`
|
134
|
-
`console.log(#@last_dispatch_time)`
|
134
|
+
# `console.log(#@last_dispatch_time)`
|
135
135
|
deferred_dispatcher(`Date.now()`) unless @deferred_dispatcher
|
136
136
|
else
|
137
137
|
dispatch(action)
|
@@ -161,7 +161,7 @@ module Redux
|
|
161
161
|
end
|
162
162
|
|
163
163
|
def dispatch_deferred_dispatches
|
164
|
-
`console.log(Date.now())`
|
164
|
+
# `console.log(Date.now())`
|
165
165
|
@deferred_dispatcher = false
|
166
166
|
actions = @deferred_actions
|
167
167
|
@deferred_actions = {}
|
@@ -173,7 +173,7 @@ module Redux
|
|
173
173
|
def wait_longer?(first)
|
174
174
|
t = `Date.now()`
|
175
175
|
time_since_first = `t - first`
|
176
|
-
`console.log('delta', time_since_first)`
|
176
|
+
# `console.log('delta', time_since_first)`
|
177
177
|
return true if `typeof Opal.React !== 'undefined' && typeof Opal.React.render_buffer !== 'undefined' && Opal.React.render_buffer.length > 0 && time_since_first < 1000`
|
178
178
|
return false if time_since_first > 100 # ms
|
179
179
|
return false if (`t - #@last_dispatch_time`) > 9 # ms
|
data/lib/redux/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.2.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,6 +47,7 @@ extra_rdoc_files: []
|
|
47
47
|
files:
|
48
48
|
- README.md
|
49
49
|
- lib/app_store.rb
|
50
|
+
- lib/iso_opal.rb
|
50
51
|
- lib/isomorfeus-redux.rb
|
51
52
|
- lib/isomorfeus/browser_store_api.rb
|
52
53
|
- lib/isomorfeus/core_ext/hash/deep_merge.rb
|
@@ -64,7 +65,7 @@ licenses:
|
|
64
65
|
- MIT
|
65
66
|
metadata:
|
66
67
|
github_repo: ssh://github.com/isomorfeus/gems
|
67
|
-
post_install_message:
|
68
|
+
post_install_message:
|
68
69
|
rdoc_options: []
|
69
70
|
require_paths:
|
70
71
|
- lib
|
@@ -79,8 +80,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
80
|
- !ruby/object:Gem::Version
|
80
81
|
version: '0'
|
81
82
|
requirements: []
|
82
|
-
rubygems_version: 3.
|
83
|
-
signing_key:
|
83
|
+
rubygems_version: 3.2.15
|
84
|
+
signing_key:
|
84
85
|
specification_version: 4
|
85
86
|
summary: Redux and Stores for Isomorfeus.
|
86
87
|
test_files: []
|