Commit 541c80c
committed
bug symfony#52524 [AssetMapper] Only download a CSS file if it is explicitly advertised (weaverryan)
This PR was merged into the 6.4 branch.
Discussion
----------
[AssetMapper] Only download a CSS file if it is explicitly advertised
| Q | A
| ------------- | ---
| Branch? | 6.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues | None
| License | MIT
When we download a JS package, we check to see if that JS package has a CSS file. And if it does, we add that too. This is purely to be helpful. For example, `importmap:require bootstrap` grabs the Bootstrap CSS file.
A JavaScript package can explicitly advertise that it has a CSS file or jsdelivr can "guess". It tells us if it's guessing or not:
* Not guessing: https://data.jsdelivr.com/v1/packages/npm/[email protected]/entrypoints
* Yes guessing: https://data.jsdelivr.com/v1/packages/npm/[email protected]/entrypoints
I propose we only grab the CSS file if it's a "sure thing". Right now, when you install `tom-select`, it's grabbing a CSS file that... we certainly don't use and I'm not sure if anyone does. It'd be better if it grabbed nothing. And, if needed (probably will be), we an make Flex install any enabled "autoimports" - e.g. https://github.com/symfony/ux/blob/2.x/src/Autocomplete/assets/package.json#L17
Overall, I'm still tweaking with the ideal UX here. I think life will be better if we only install "for sure" CSS files.
Thanks!
Commits
-------
1f41d67 [AssetMapper] Only download a CSS file if it is explicitly advertisedFile tree
2 files changed
+3
-2
lines changed- src/Symfony/Component/AssetMapper
- ImportMap/Resolver
- Tests/ImportMap/Resolver
2 files changed
+3
-2
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
132 | 133 | | |
133 | | - | |
| 134 | + | |
134 | 135 | | |
135 | 136 | | |
136 | 137 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
0 commit comments