isomorfeus-asset-manager 0.19.0 → 0.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isomorfeus/asset_manager/version.rb +1 -1
- data/lib/isomorfeus/asset_manager.rb +15 -5
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe48bc13745c886fd9b60e7283e5e072f294a3fc29cef4f15c68bbf8321b5f36
|
4
|
+
data.tar.gz: 9cfba00c3f49652a27630612a6784c884d61e1e5a5fd39ca9c6ec5ddb35b71ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de2fb9ac546e3225d7edb06638ad0ea8b37141009c84faf093dad3936669357f412016861a79a9622dddfc9e8b344923c2721827b8080ae6c9fdde06d252c6bd
|
7
|
+
data.tar.gz: fed8f5bf397c1e9b09f71082b4f961f1aadae0cb6a70c68eb9f56f0fb64600ff706018445475b8ff8555825689e514cf71f5a329f80a4a4957db050010b31dae
|
@@ -26,8 +26,6 @@ module Isomorfeus
|
|
26
26
|
@server_path = File.join(Isomorfeus.app_root, 'server')
|
27
27
|
self.class.add_app_imports
|
28
28
|
|
29
|
-
@context = ExecJS.permissive_compile(init_js)
|
30
|
-
|
31
29
|
init_hmr_listener if Isomorfeus.development? && !Isomorfeus.hmr_listener
|
32
30
|
end
|
33
31
|
|
@@ -55,6 +53,14 @@ module Isomorfeus
|
|
55
53
|
|
56
54
|
private
|
57
55
|
|
56
|
+
def get_context
|
57
|
+
@context ||= ExecJS.permissive_compile(init_js)
|
58
|
+
end
|
59
|
+
|
60
|
+
def stop_context
|
61
|
+
ExecJS::Runtimes::Speednode.stop_context(@context)
|
62
|
+
end
|
63
|
+
|
58
64
|
def compile_ruby(file)
|
59
65
|
source = File.binread(file)
|
60
66
|
module_file = file[(Isomorfeus.app_root.size + 1)..-1]
|
@@ -62,7 +68,6 @@ module Isomorfeus
|
|
62
68
|
{ javascript: compiler.compile }
|
63
69
|
end
|
64
70
|
|
65
|
-
|
66
71
|
def handle_errors(asset_key, result)
|
67
72
|
result = result['result']
|
68
73
|
if result && !(result['errors'].nil? || result['errors'].empty?)
|
@@ -135,7 +140,9 @@ module Isomorfeus
|
|
135
140
|
resolve_paths << 'node_modules'
|
136
141
|
resolve_paths.uniq!
|
137
142
|
|
138
|
-
|
143
|
+
context = get_context
|
144
|
+
|
145
|
+
result = context.await <<~JAVASCRIPT
|
139
146
|
esbuild.build({
|
140
147
|
entryPoints: [path.resolve(global.imports_path, '#{entry}')],
|
141
148
|
bundle: true,
|
@@ -159,11 +166,14 @@ module Isomorfeus
|
|
159
166
|
.catch((error) => { return { result: { errors: [{text: error.message}]}}; });
|
160
167
|
JAVASCRIPT
|
161
168
|
if analyze
|
162
|
-
analysis =
|
169
|
+
analysis = context.await <<~JAVASCRIPT
|
163
170
|
esbuild.analyzeMetafile(global.res_meta, { verbose: true });
|
164
171
|
JAVASCRIPT
|
165
172
|
puts "\n#{analysis}\n"
|
166
173
|
end
|
174
|
+
|
175
|
+
stop_context if Isomorfeus.production? # no need to keep node running all the time
|
176
|
+
|
167
177
|
handle_errors(asset_key, result)
|
168
178
|
end
|
169
179
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isomorfeus-asset-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.19.
|
4
|
+
version: 0.19.2
|
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: brotli
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
47
|
+
version: 0.7.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
54
|
+
version: 0.7.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: listen
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|