Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[AssetMapper] Only download a CSS file if it is explicitly advertised#52524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
335c460
to1f41d67
CompareJust speaking from a DX perspective: I think we shouldALWAYS grab the CSS file. A lot of js packages have small CSS files, but without it, everything can look a bit buggy. And I think CSS is part of the packages, the maintainer chooses to add CSS in their packages, so we should follow this decision. And I think it's easier if we don't have to run two commands one to install the CSS and on for the Js. |
I totally agree. But if that's the case, they will / should advertise that they have a CSS file - e.g. via the |
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:
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#L17Overall, I'm still tweaking with the ideal UX here. I think life will be better if we only install "for sure" CSS files.
Thanks!