Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #50231 [AssetMapper] Fixing 2 bugs related to the compile command…
… and importmaps (weaverryan) This PR was squashed before being merged into the 6.3 branch. Discussion ---------- [AssetMapper] Fixing 2 bugs related to the compile command and importmaps | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no | Deprecations? | none | Tickets | none | License | MIT | Doc PR | not needed Fixes 2 bugs: A) Running `assetmap:compile` gives you a `public/assets/importmap.json` for fast importmap dumping on production. But, running `assetmap:compile` again later would re-use the `importmap.json` info to create the new `importmap.json`... meaning it would never update after the first compile. B) The importmap process generates 2 pieces of information: (A) the importmap and (B) which files from the importmap should be preloaded. When we use `assetmap:compile`, we need to dump both pieces of info. So, we now also dump an `importmap.preload.json` file. These are TWO files (and not just one) because we avoid parsing `importmap.json` at runtime: we read the file and dump it straight out. We DO need to parse the "preload" file. So, I've kept them separate. Blocked by #50219, which has some changes that will fix the tests here. Cheers! Commits ------- f9f7274 [AssetMapper] Fixing 2 bugs related to the compile command and importmaps
- Loading branch information
Showing
8 changed files
with
112 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/Symfony/Component/AssetMapper/Tests/fixtures/importmap.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
return [ | ||
'@hotwired/stimulus' => [ | ||
'url' => 'https://unpkg.com/@hotwired/stimulus@3.2.1/dist/stimulus.js', | ||
'preload' => true, | ||
], | ||
'lodash' => [ | ||
'url' => 'https://ga.jspm.io/npm:lodash@4.17.21/lodash.js', | ||
'preload' => false, | ||
], | ||
'file6' => [ | ||
'path' => 'subdir/file6.js', | ||
'preload' => true, | ||
], | ||
]; |
3 changes: 3 additions & 0 deletions
3
...fony/Component/AssetMapper/Tests/fixtures/test_public/final-assets/importmap.preload.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ | ||
"/assets/app-ea9ebe6156adc038aba53164e2be0867.js" | ||
] |