isomorfeus-asset-manager 0.14.13 → 0.14.17
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a5ab8e8c6bb0f3297e3dc3f01a67cb9466667c9401a2df07c3e2326490497fd
|
4
|
+
data.tar.gz: 3d5602cf63c29b384c6fb58264ba5955bee0488159d8855fdc7e692105db7f1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ff06c1a873fce44da2a5a6e666e562868e45e4771ba667390161c61840e4a8f7de9b47443e8d2d6702989e711b42ddcd13604ef36bcd9743f92b93aa958d29a
|
7
|
+
data.tar.gz: 9450313ed271a49d3c862bb4169d27a94cd222c54bdb0e05ea1a1481fff808dcce1dc55e258d2bb34b828249484881e4320c23288c11fb835c49e7ad6d877307
|
data/README.md
CHANGED
@@ -6,10 +6,14 @@
|
|
6
6
|
|
7
7
|
Convenient and well performing on demand asset bundling for the isomorfeus framework project, internally using esbuild (esbuild-wasm).
|
8
8
|
|
9
|
-
Version follows esbuild version: 0.
|
9
|
+
Version follows esbuild version: 0.14.x comes with esbuild 0.14.y.
|
10
10
|
|
11
11
|
No need to install esbuild separately, everything bundled ready to go.
|
12
12
|
However, if within the project the 'esbuild' npm package is installed in node_modules, that version will be used instead.
|
13
13
|
|
14
14
|
### Community and Support
|
15
15
|
At the [Isomorfeus Framework Project](https://isomorfeus.com)
|
16
|
+
|
17
|
+
### Targets
|
18
|
+
By default bundles for browsers using the 'es6' target of esbuild.
|
19
|
+
By default bundles for node using the 'node16' target of esbuild.
|
@@ -61,6 +61,18 @@ module Isomorfeus
|
|
61
61
|
def test?
|
62
62
|
@test
|
63
63
|
end
|
64
|
+
|
65
|
+
def server_requires_reload?
|
66
|
+
@server_requires_reload
|
67
|
+
end
|
68
|
+
|
69
|
+
def server_reloaded!
|
70
|
+
@server_requires_reload = false
|
71
|
+
end
|
72
|
+
|
73
|
+
def server_requires_reload!
|
74
|
+
@server_requires_reload = true
|
75
|
+
end
|
64
76
|
end
|
65
77
|
end
|
66
78
|
|
@@ -71,8 +71,7 @@ module Isomorfeus
|
|
71
71
|
if asset && asset.browser?
|
72
72
|
headers = { Rack::CONTENT_TYPE => 'application/json' }
|
73
73
|
asset_manager.transition(asset_key, asset)
|
74
|
-
|
75
|
-
return [200, headers, content]
|
74
|
+
return [200, headers, get_content(env, headers, asset, asset_key, asset.hash[:css][:map])]
|
76
75
|
end
|
77
76
|
end
|
78
77
|
end
|
@@ -135,7 +134,7 @@ module Isomorfeus
|
|
135
134
|
end
|
136
135
|
headers[Rack::CONTENT_LENGTH] = content.size
|
137
136
|
headers['Last-Modified'] = asset.mtime
|
138
|
-
content
|
137
|
+
[content]
|
139
138
|
end
|
140
139
|
end
|
141
140
|
end
|
@@ -125,22 +125,27 @@ module Isomorfeus
|
|
125
125
|
am_class = self.class
|
126
126
|
Isomorfeus.hmr_listener = Listen.to(*listen_dirs) do |modified, added, _|
|
127
127
|
(modified + added).each do |file|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
128
|
+
if file.start_with?(@server_path)
|
129
|
+
Isomorfeus.server_requires_reload!
|
130
|
+
else
|
131
|
+
begin
|
132
|
+
if file.end_with?('.rb')
|
133
|
+
Isomorfeus.server_requires_reload!
|
134
|
+
Isomorfeus.assets.each_value { |asset| asset.unbundle! }
|
135
|
+
update = compile_ruby(file)
|
136
|
+
update_json = Oj.dump(update, mode: :strict)
|
137
|
+
elsif file.end_with?('.yml') || file.end_with?('.mo') || file.end_with?('.po')
|
138
|
+
Isomorfeus.server_requires_reload!
|
139
|
+
update_json = Oj.dump({ locale: file }, mode: :strict)
|
140
|
+
else
|
141
|
+
update_json = Oj.dump({ error: "Don't know how to update #{file}!" }, mode: :strict)
|
142
|
+
end
|
143
|
+
Iodine.publish(Isomorfeus.asset_manager_hmr_channel, update_json)
|
144
|
+
rescue Exception => e
|
145
|
+
message = "Isomorfeus Asset Manager during hot module update:\n#{e.class}\n#{e.message}\n#{e.backtrace.join("\n")}"
|
146
|
+
STDERR.puts message
|
147
|
+
Iodine.publish(Isomorfeus.asset_manager_hmr_channel, Oj.dump({ error: message }, mode: :strict))
|
138
148
|
end
|
139
|
-
Iodine.publish(Isomorfeus.asset_manager_hmr_channel, update_json)
|
140
|
-
rescue Exception => e
|
141
|
-
message = "Isomorfeus Asset Manager during hot module update:\n#{e.class}\n#{e.message}\n#{e.backtrace.join("\n")}"
|
142
|
-
STDERR.puts message
|
143
|
-
Iodine.publish(Isomorfeus.asset_manager_hmr_channel, Oj.dump({ error: message }, mode: :strict))
|
144
149
|
end
|
145
150
|
end
|
146
151
|
end
|
@@ -169,7 +174,7 @@ module Isomorfeus
|
|
169
174
|
publicPath: '#{asset.browser? ? Isomorfeus.assets_path : @output_path}',
|
170
175
|
sourcemap: #{(!Isomorfeus.production? && asset.browser?) ? 'true' : 'false'},
|
171
176
|
splitting: false,
|
172
|
-
target: 'es6',
|
177
|
+
target: '#{asset.browser? ? 'es6' : 'node16' }',
|
173
178
|
write: true
|
174
179
|
}).then((result) => { global.res_meta = result.metafile; return result; });
|
175
180
|
JAVASCRIPT
|
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.14.
|
4
|
+
version: 0.14.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Biedermann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-20 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.5.2
|
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.5.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: listen
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|