Skip to content

Commit 39579b6

Browse files
committed
perf: Prepend the app as a whole
Signed-off-by: Joas Schilling <[email protected]>
1 parent 00e1264 commit 39579b6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/public/Util.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,15 @@ public static function addScript(string $application, ?string $file = null, stri
168168
}
169169

170170
if ($prepend) {
171+
// Make sure the scripts of prepended applications are prepended within
172+
// the apps as well, so that e.g. Talk can prepend itself on `/call/123456`
173+
// URLs within it's template file, instead of being at the end, because
174+
// other apps already queued after `core` using an earlier event or the
175+
// `Application::boot()` method.
176+
$appDeps = self::$scriptDeps[$application] ?? [];
177+
unset(self::$scriptDeps[$application]);
178+
self::$scriptDeps = [$application => $appDeps] + self::$scriptDeps;
179+
171180
array_unshift(self::$scripts[$application], $path);
172181
} else {
173182
self::$scripts[$application][] = $path;

0 commit comments

Comments
 (0)