Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand All @@ -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;

Expand Down