8000 [AssetMapper] Upgrade asset mapper to 6.4 fails due to invalid entrie… · symfony/symfony@122c0c6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 122c0c6

Browse files
committed
[AssetMapper] Upgrade asset mapper to 6.4 fails due to invalid entries "downloaded_to" and "preload"
1 parent e3e3d5f commit 122c0c6

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function getEntries(): ImportMapEntries
4141

4242
$entries = new ImportMapEntries();
4343
foreach ($importMapConfig ?? [] as $importName => $data) {
44-
$validKeys = ['path', 'version', 'type', 'entrypoint', 'url', 'package_specifier'];
44+
$validKeys = ['path', 'version', 'type', 'entrypoint', 'url', 'package_specifier', 'downloaded_to', 'preload'];
4545
if ($invalidKeys = array_diff(array_keys($data), $validKeys)) {
4646
throw new \InvalidArgumentException(sprintf('The following keys are not valid for the importmap entry "%s": "%s". Valid keys are: "%s".', $importName, implode('", "', $invalidKeys), implode('", "', $validKeys)));
4747
}
@@ -51,6 +51,20 @@ public function getEntries(): ImportMapEntries
5151
trigger_deprecation('symfony/asset-mapper', '6.4', 'The "url" option is deprecated, use "version" instead.');
5252
}
5353

54+
// should solve itself when the config is written again
55+
if (isset($data['downloaded_to'])) {
56+
trigger_deprecation('symfony/asset-mapper', '6.4', 'The "downloaded_to" option is deprecated and will be removed.');
57+
// remove deprecated downloaded_to
58+
unset($data['downloaded_to']);
59+
}
60+
61+
// should solve itself when the config is written again
62+
if (isset($data['preload'])) {
63+
trigger_deprecation('symfony/asset-mapper', '6.4', 'The "preload" option is deprecated, preloading is automatically done.');
64+
// remove deprecated preload
65+
unset($data['preload']);
66+
}
67+
5468
$type = isset($data['type']) ? ImportMapType::tryFrom($data['type']) : ImportMapType::JS;
5569
$isEntrypoint = $data['entrypoint'] ?? false;
5670

0 commit comments

Comments
 (0)
0