completion-kit 0.5.22 → 0.5.23
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: 3f3a33489dfdc8c4b5744b3d04ef7f1fbb7d4c257e6198e1213b2a6508247a05
|
|
4
|
+
data.tar.gz: b9c96940b2b4954d707068bee76e6beee58ae19e3f20194cece5643e813fe3b5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d787d4f44220fd48907954c871b5576d10a4fcb3baf5a7d4106fcf9a30cf06563c3fad3a4e2cb3cf2027843b50b5fd52c1aadf0910fc402dbd04d14d54f73a8d
|
|
7
|
+
data.tar.gz: 7d24b2744b473e98403ff30b7c7bb664f1b1f76a72330a973f290b049b67c76ca6283d5f26dc32b70d0d4bce529bbf267d7dd3ff2d06febf1781b1bb5c2b05a8
|
|
@@ -231,7 +231,7 @@ module CompletionKit
|
|
|
231
231
|
end
|
|
232
232
|
|
|
233
233
|
def render_engine_partial(partial, locals)
|
|
234
|
-
CompletionKit::Engine.
|
|
234
|
+
CompletionKit::Engine.warm_routes!
|
|
235
235
|
CompletionKit::ApplicationController.render(
|
|
236
236
|
partial: partial,
|
|
237
237
|
locals: locals
|
|
@@ -7,6 +7,21 @@ module CompletionKit
|
|
|
7
7
|
|
|
8
8
|
paths.add "app/services", eager_load: true
|
|
9
9
|
|
|
10
|
+
ROUTES_WARMUP_LOCK = Mutex.new
|
|
11
|
+
@routes_warmed = false
|
|
12
|
+
|
|
13
|
+
# Materialise the engine's lazy route set once, single-threaded. Background
|
|
14
|
+
# worker threads that render engine partials for Turbo broadcasts otherwise
|
|
15
|
+
# race the lazy first-load and raise "undefined method 'run_response_path'"
|
|
16
|
+
# (production survives only because eager_load finalises routes at boot).
|
|
17
|
+
def self.warm_routes!
|
|
18
|
+
ROUTES_WARMUP_LOCK.synchronize do
|
|
19
|
+
return if @routes_warmed
|
|
20
|
+
routes.url_helpers.root_path
|
|
21
|
+
@routes_warmed = true
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
10
25
|
def self.register_assets(app)
|
|
11
26
|
app.config.assets.precompile += %w(
|
|
12
27
|
completion_kit/application.css
|