diff --git a/src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php b/src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php index cbcd8024e0d34..cbb597856f774 100644 --- a/src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php +++ b/src/Symfony/Component/AssetMapper/ImportMap/ImportMapConfigReader.php @@ -41,7 +41,7 @@ public function getEntries(): ImportMapEntries $entries = new ImportMapEntries(); foreach ($importMapConfig ?? [] as $importName => $data) { - $validKeys = ['path', 'version', 'type', 'entrypoint', 'url', 'package_specifier']; + $validKeys = ['path', 'version', 'type', 'entrypoint', 'url', 'package_specifier', 'downloaded_to', 'preload']; if ($invalidKeys = array_diff(array_keys($data), $validKeys)) { 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))); } @@ -51,6 +51,20 @@ public function getEntries(): ImportMapEntries trigger_deprecation('symfony/asset-mapper', '6.4', 'The "url" option is deprecated, use "version" instead.'); } + // should solve itself when the config is written again + if (isset($data['downloaded_to'])) { + trigger_deprecation('symfony/asset-mapper', '6.4', 'The "downloaded_to" option is deprecated and will be removed.'); + // remove deprecated downloaded_to + unset($data['downloaded_to']); + } + + // should solve itself when the config is written again + if (isset($data['preload'])) { + trigger_deprecation('symfony/asset-mapper', '6.4', 'The "preload" option is deprecated, preloading is automatically done.'); + // remove deprecated preload + unset($data['preload']); + } + $type = isset($data['type']) ? ImportMapType::tryFrom($data['type']) : ImportMapType::JS; $isEntrypoint = $data['entrypoint'] ?? false;