render-react 0.0.3 → 0.0.4
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/js/dist/{compiler/_react.js → react.js} +0 -0
- data/lib/render/react/compiler.rb +17 -10
- data/lib/render/react/config.rb +3 -1
- data/lib/render/react/version.rb +1 -1
- metadata +2 -4
- data/js/dist/compiler/react-dom.js +0 -42
- data/js/dist/transpiler/_react.js +0 -20640
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8207624f1aecc2a35548dca05f898163debeacd3
|
4
|
+
data.tar.gz: 7c21458d4d3e758d3217af9bbdddc1a6118ceea0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 817c39361103f3fa94e277518f9a5e187170143b038b086f73574accdfe6c3263d1e26826f42d2ca90f17612f5b32c4440d154fcf67bb3a3c6b66348c2e05d0c
|
7
|
+
data.tar.gz: 7bd123ad0228db99f0934395240a1a634ecd884a91584a7d9cd66ad7203012b1689fc39e80b9dc246b929db55623e7cdf3cc3ea9fdab81662113cef2bc32c8ca
|
File without changes
|
@@ -21,14 +21,7 @@ module Render
|
|
21
21
|
js_lib_files.each { |file| @cxt.load(file) }
|
22
22
|
end
|
23
23
|
|
24
|
-
def
|
25
|
-
if @durability && @durability <= 0
|
26
|
-
@cxt.destroy
|
27
|
-
@cxt = nil
|
28
|
-
end
|
29
|
-
|
30
|
-
create_context unless @cxt
|
31
|
-
|
24
|
+
def load_components
|
32
25
|
Config.paths.each do |path|
|
33
26
|
files = Dir.glob(File.join(path, '**', '*.js'))
|
34
27
|
files.each do |filename|
|
@@ -37,8 +30,22 @@ module Render
|
|
37
30
|
lookup[name.to_sym] = true
|
38
31
|
end
|
39
32
|
end
|
33
|
+
end
|
40
34
|
|
41
|
-
|
35
|
+
def bootstrap
|
36
|
+
if @durability
|
37
|
+
if @durability <= 0
|
38
|
+
@cxt.destroy
|
39
|
+
@cxt = nil
|
40
|
+
create_context
|
41
|
+
load_components
|
42
|
+
else
|
43
|
+
@durability -= 1
|
44
|
+
end
|
45
|
+
else
|
46
|
+
create_context
|
47
|
+
load_components
|
48
|
+
end
|
42
49
|
end
|
43
50
|
|
44
51
|
def render(component_class, **props)
|
@@ -55,7 +62,7 @@ module Render
|
|
55
62
|
@cxt.eval(code)
|
56
63
|
end
|
57
64
|
|
58
|
-
module_function :bootstrap, :create_context, :render, :lookup, :evaljs
|
65
|
+
module_function :bootstrap, :create_context, :render, :lookup, :evaljs, :load_components
|
59
66
|
end
|
60
67
|
end
|
61
68
|
end
|
data/lib/render/react/config.rb
CHANGED
data/lib/render/react/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: render-react
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Krasnoschekov
|
@@ -97,10 +97,8 @@ files:
|
|
97
97
|
- Rakefile
|
98
98
|
- bin/console
|
99
99
|
- bin/setup
|
100
|
-
- js/dist/compiler/_react.js
|
101
100
|
- js/dist/compiler/react-dom-server.js
|
102
|
-
- js/dist/
|
103
|
-
- js/dist/transpiler/_react.js
|
101
|
+
- js/dist/react.js
|
104
102
|
- js/dist/transpiler/babel.js
|
105
103
|
- js/package.json
|
106
104
|
- lib/render/react.rb
|
@@ -1,42 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* ReactDOM v15.3.0
|
3
|
-
*
|
4
|
-
* Copyright 2013-present, Facebook, Inc.
|
5
|
-
* All rights reserved.
|
6
|
-
*
|
7
|
-
* This source code is licensed under the BSD-style license found in the
|
8
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
9
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
10
|
-
*
|
11
|
-
*/
|
12
|
-
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
|
13
|
-
;(function(f) {
|
14
|
-
// CommonJS
|
15
|
-
if (typeof exports === "object" && typeof module !== "undefined") {
|
16
|
-
module.exports = f(require('react'));
|
17
|
-
|
18
|
-
// RequireJS
|
19
|
-
} else if (typeof define === "function" && define.amd) {
|
20
|
-
define(['react'], f);
|
21
|
-
|
22
|
-
// <script>
|
23
|
-
} else {
|
24
|
-
var g;
|
25
|
-
if (typeof window !== "undefined") {
|
26
|
-
g = window;
|
27
|
-
} else if (typeof global !== "undefined") {
|
28
|
-
g = global;
|
29
|
-
} else if (typeof self !== "undefined") {
|
30
|
-
g = self;
|
31
|
-
} else {
|
32
|
-
// works providing we're not in "use strict";
|
33
|
-
// needed for Java 8 Nashorn
|
34
|
-
// see https://github.com/facebook/react/issues/3037
|
35
|
-
g = this;
|
36
|
-
}
|
37
|
-
g.ReactDOM = f(g.React);
|
38
|
-
}
|
39
|
-
|
40
|
-
})(function(React) {
|
41
|
-
return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
42
|
-
});
|