opal-optimizer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +21 -25
- data/lib/opal/optimizer/step/tree_shaking.rb +13 -5
- data/lib/opal/optimizer/version.rb +1 -1
- 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: 95f417ee4f6e6c9089df85ffb552743254b8ce925fff838f43534a393bfdc5d2
|
4
|
+
data.tar.gz: 055757cb6d70b74694b4ba832da05214a4109538d2ff9dbd8e44d4f8ba559079
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a84df0108a0ba76605adcf72f8fd0d1fc71ab7ffa1811227101974dd59a20efd4381ee8cdcd20cffc72f2ca2712f94f5692b94e5f221ece6a10f7c64a162050
|
7
|
+
data.tar.gz: b21f95b69e040276fbee5bc0f829fb1536541c0877229ed78c067f79f2f6e08328c5d808caf3f1e5ae9d9f51a8ada7ba97e54a0420f0492fbaeb8815d9d71e63
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -5,18 +5,10 @@ PATH
|
|
5
5
|
opal (>= 1.0, < 2.0)
|
6
6
|
paggio
|
7
7
|
|
8
|
-
PATH
|
9
|
-
remote: ../opal-sprockets
|
10
|
-
specs:
|
11
|
-
opal-sprockets (1.0.0)
|
12
|
-
opal (>= 1.0, < 1.2)
|
13
|
-
sprockets (~> 4.0)
|
14
|
-
tilt (>= 1.4)
|
15
|
-
|
16
8
|
PATH
|
17
9
|
remote: ../opal
|
18
10
|
specs:
|
19
|
-
opal (1.
|
11
|
+
opal (1.2.0)
|
20
12
|
ast (>= 2.3.0)
|
21
13
|
parser (~> 3.0)
|
22
14
|
|
@@ -28,7 +20,7 @@ PATH
|
|
28
20
|
PATH
|
29
21
|
remote: .
|
30
22
|
specs:
|
31
|
-
opal-optimizer (0.1.
|
23
|
+
opal-optimizer (0.1.3)
|
32
24
|
opal (>= 1.0.0)
|
33
25
|
rkelly-turbo
|
34
26
|
|
@@ -37,30 +29,34 @@ GEM
|
|
37
29
|
specs:
|
38
30
|
ast (2.4.2)
|
39
31
|
coderay (1.1.3)
|
40
|
-
concurrent-ruby (1.1.
|
32
|
+
concurrent-ruby (1.1.9)
|
41
33
|
diff-lcs (1.4.4)
|
42
34
|
method_source (1.0.0)
|
35
|
+
opal-sprockets (1.0.1)
|
36
|
+
opal (>= 1.0, < 2.0)
|
37
|
+
sprockets (~> 4.0)
|
38
|
+
tilt (>= 1.4)
|
43
39
|
paggio (0.2.6)
|
44
|
-
parser (3.0.
|
40
|
+
parser (3.0.2.0)
|
45
41
|
ast (~> 2.4.1)
|
46
|
-
pry (0.
|
42
|
+
pry (0.14.1)
|
47
43
|
coderay (~> 1.1)
|
48
44
|
method_source (~> 1.0)
|
49
45
|
rack (2.2.3)
|
50
46
|
rake (12.3.3)
|
51
|
-
rspec (3.
|
52
|
-
rspec-core (~> 3.
|
53
|
-
rspec-expectations (~> 3.
|
54
|
-
rspec-mocks (~> 3.
|
55
|
-
rspec-core (3.
|
56
|
-
rspec-support (~> 3.
|
57
|
-
rspec-expectations (3.
|
47
|
+
rspec (3.10.0)
|
48
|
+
rspec-core (~> 3.10.0)
|
49
|
+
rspec-expectations (~> 3.10.0)
|
50
|
+
rspec-mocks (~> 3.10.0)
|
51
|
+
rspec-core (3.10.1)
|
52
|
+
rspec-support (~> 3.10.0)
|
53
|
+
rspec-expectations (3.10.1)
|
58
54
|
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
-
rspec-support (~> 3.
|
60
|
-
rspec-mocks (3.
|
55
|
+
rspec-support (~> 3.10.0)
|
56
|
+
rspec-mocks (3.10.2)
|
61
57
|
diff-lcs (>= 1.2.0, < 2.0)
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-support (3.
|
58
|
+
rspec-support (~> 3.10.0)
|
59
|
+
rspec-support (3.10.2)
|
64
60
|
ruby-prof (1.4.3)
|
65
61
|
sprockets (4.0.2)
|
66
62
|
concurrent-ruby (~> 1.0)
|
@@ -74,7 +70,7 @@ DEPENDENCIES
|
|
74
70
|
opal!
|
75
71
|
opal-browser!
|
76
72
|
opal-optimizer!
|
77
|
-
opal-sprockets
|
73
|
+
opal-sprockets
|
78
74
|
pry
|
79
75
|
rake (~> 12.0)
|
80
76
|
rkelly-turbo!
|
@@ -12,6 +12,7 @@ class TreeShaking < Step
|
|
12
12
|
method_defs = corelib_calls["def"] +
|
13
13
|
corelib_calls["defs"] +
|
14
14
|
corelib_calls["defn"] +
|
15
|
+
corelib_calls["udef"] +
|
15
16
|
aliases.keys
|
16
17
|
|
17
18
|
method_calls = Set.new
|
@@ -44,16 +45,23 @@ class TreeShaking < Step
|
|
44
45
|
method_calls += aliases.values
|
45
46
|
|
46
47
|
# Protected methods
|
47
|
-
method_calls += [
|
48
|
+
method_calls += []
|
48
49
|
|
49
50
|
removed = Set.new
|
50
51
|
|
51
52
|
method_defs.each do |m|
|
52
53
|
name = m.arguments.value[1]
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
54
|
+
case name
|
55
|
+
when AddNode
|
56
|
+
if StringNode === name.left && StringNode === name.value
|
57
|
+
name = name.left.value[1..-2] + name.value.value[1..-2]
|
58
|
+
end
|
59
|
+
when StringNode
|
60
|
+
name = name.value[1..-2]
|
61
|
+
name = "$" + name if m.value.accessor == "alias"
|
62
|
+
else
|
63
|
+
next
|
64
|
+
end
|
57
65
|
|
58
66
|
next if method_calls.include? name
|
59
67
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opal-optimizer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hmdne
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rkelly-turbo
|