proscenium 0.19.0-x86_64-darwin → 0.20.0-x86_64-darwin
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/README.md +5 -1
- data/lib/proscenium/ext/proscenium +0 -0
- data/lib/proscenium/importer.rb +1 -1
- data/lib/proscenium/middleware.rb +11 -19
- data/lib/proscenium/monkey.rb +7 -6
- data/lib/proscenium/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: 271a5c77ddb06b9fe54ec2925263863b992f18ab99f54482887ed69353e1b2e5
|
4
|
+
data.tar.gz: 2cb04c4bdf80aaf850f51965e988d16b6200350c5b909617a864dfcf8b3d2f5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b38c0f24ca1cccbe755af05ea314422f64381cbf9f54afc97b1afc02558202f4fa09b821c309e808bba61269f2cbbba89bd5d12c31d160657df982bc2f82b7d
|
7
|
+
data.tar.gz: 507caf7511ae7cec05ea9d53d76f6778aa221df1a97ef5b5c0d9bb5afa7e91a888de5eb480e11e056565c340782279e9067f57f25cef7fdc3d6ac97c59e961ec
|
data/README.md
CHANGED
@@ -415,13 +415,17 @@ if (typeof proscenium.env?.UNKNOWN !== "undefined") {
|
|
415
415
|
|
416
416
|
## i18n
|
417
417
|
|
418
|
-
|
418
|
+
Support is provided for importing your Rails locale files from `config/locales/*.yml`, exporting them as JSON.
|
419
419
|
|
420
420
|
```js
|
421
421
|
import translations from "proscenium/i18n";
|
422
422
|
// translations.en.*
|
423
423
|
```
|
424
424
|
|
425
|
+
If you have multiple locale files, they will be merged together. into one json object.
|
426
|
+
|
427
|
+
Note that because it is assumed that you will be consuming these translations in the browser, all keys are converted to camelCase, as per the JavaScript conventions.
|
428
|
+
|
425
429
|
## Javascript
|
426
430
|
|
427
431
|
By default, Proscenium's output will take advantage of all modern JS features from the ES2022 spec and earlier. For example, `a !== void 0 && a !== null ? a : b` will become `a ?? b` when minifying (enabled by default in production), which makes use of syntax from the ES2020 version of JavaScript. Any syntax feature that is not supported by ES2020 will be transformed into older JavaScript syntax that is more widely supported.
|
Binary file
|
data/lib/proscenium/importer.rb
CHANGED
@@ -13,10 +13,6 @@ module Proscenium
|
|
13
13
|
|
14
14
|
def initialize(app)
|
15
15
|
@app = app
|
16
|
-
|
17
|
-
chunks_path = Rails.public_path.join('assets').to_s
|
18
|
-
headers = Rails.application.config.public_file_server.headers || {}
|
19
|
-
@chunk_handler = ::ActionDispatch::FileHandler.new(chunks_path, headers:)
|
20
16
|
end
|
21
17
|
|
22
18
|
def call(env)
|
@@ -24,23 +20,19 @@ module Proscenium
|
|
24
20
|
|
25
21
|
return @app.call(env) if !request.get? && !request.head?
|
26
22
|
|
23
|
+
# If this is a request for an asset chunk, we want to serve it with a very long
|
24
|
+
# cache lifetime, since these are content-hashed and will never change.
|
27
25
|
if request.path.match?(%r{^/_asset_chunks/})
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
response.body = []
|
38
|
-
end
|
39
|
-
|
40
|
-
return response.finish
|
26
|
+
::ActionDispatch::FileHandler.new(
|
27
|
+
Rails.public_path.join('assets').to_s,
|
28
|
+
headers: {
|
29
|
+
'Cache-Control' => "public, max-age=#{100.years}, immutable",
|
30
|
+
'etag' => request.path.match(/-\$([a-z0-9]+)\$/i)[1]
|
31
|
+
}
|
32
|
+
).attempt(env) || @app.call(env)
|
33
|
+
else
|
34
|
+
attempt(request) || @app.call(env)
|
41
35
|
end
|
42
|
-
|
43
|
-
attempt(request) || @app.call(env)
|
44
36
|
end
|
45
37
|
|
46
38
|
private
|
data/lib/proscenium/monkey.rb
CHANGED
@@ -9,11 +9,11 @@ module Proscenium
|
|
9
9
|
result = super
|
10
10
|
return result if !view.controller || !Proscenium.config.side_load
|
11
11
|
|
12
|
-
to_sideload = if template.respond_to?(:
|
12
|
+
to_sideload = if template.respond_to?(:identifier) &&
|
13
13
|
template.respond_to?(:type) && template.type == :html
|
14
14
|
template
|
15
15
|
end
|
16
|
-
if to_sideload
|
16
|
+
if to_sideload && view.controller.respond_to?(:sideload_assets_options)
|
17
17
|
options = view.controller.sideload_assets_options
|
18
18
|
layout = find_layout(layout_name, locals.keys, [formats.first])
|
19
19
|
sideload_template_assets layout, view.controller, options if layout
|
@@ -40,7 +40,7 @@ module Proscenium
|
|
40
40
|
options[k] = controller.instance_eval(&options[k]) if options[k].is_a?(Proc)
|
41
41
|
end
|
42
42
|
|
43
|
-
Importer.sideload
|
43
|
+
Importer.sideload Pathname.new(tpl.identifier), **options
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
@@ -52,8 +52,9 @@ module Proscenium
|
|
52
52
|
|
53
53
|
return result if !view.controller || !Proscenium.config.side_load
|
54
54
|
|
55
|
-
if template.respond_to?(:
|
56
|
-
template.respond_to?(:type) && template.type == :html
|
55
|
+
if template.respond_to?(:identifier) &&
|
56
|
+
template.respond_to?(:type) && template.type == :html &&
|
57
|
+
view.controller.respond_to?(:sideload_assets_options)
|
57
58
|
options = view.controller.sideload_assets_options
|
58
59
|
sideload_template_assets layout, options if layout
|
59
60
|
sideload_template_assets template, options
|
@@ -79,7 +80,7 @@ module Proscenium
|
|
79
80
|
options[k] = controller.instance_eval(&options[k]) if options[k].is_a?(Proc)
|
80
81
|
end
|
81
82
|
|
82
|
-
Importer.sideload
|
83
|
+
Importer.sideload Pathname.new(tpl.identifier), **options
|
83
84
|
end
|
84
85
|
end
|
85
86
|
end
|
data/lib/proscenium/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proscenium
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.20.0
|
5
5
|
platform: x86_64-darwin
|
6
6
|
authors:
|
7
7
|
- Joel Moss
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|