[Turbo] `data-turbo-track` attribute for CSS is missing
Hi :),
I see that the JS links have the data-turbo-track attribute but not the CSS ones:
https://github.com/symfony/ux/blob/2.x/src/Turbo/src/DependencyInjection/TurboExtension.php#L102
I see that the JS links have the data-turbo-track attribute but not the CSS ones:
Not "the JS links", only the importmap script, if AssetMapper is installed :)
Are you suggesting a new feature ? Or is there something not working as you'd expect ?
For https://ux.symfony.com/ there is the following source code:
Shouldn't that be it?
[...]
<link rel="stylesheet" href="/assets/styles/app-e6e5573999adb63729abd6652c7ebcd5.css" data-turbo-track="reload">
<link rel="stylesheet" href="/assets/vendor/tippy.js/dist/tippy-2cffb277c396057474574f721014a03f.css" data-turbo-track="reload">
<link rel="stylesheet" href="/assets/vendor/tippy.js/themes/translucent-02f3023fa2e1a35311c7e80893e98a69.css" data-turbo-track="reload">
<script type="importmap" data-turbo-track="reload">
[...]
Can you explain why?
I do not agree nor disagree here, it's a genuine question :)
Is it always the case ? Or something developper should set manually ?
It seems logical to me on the importmap, but i feel (i may be wrong) that stylesheet rule would be really hard to generalize
Could you illustrate on the website what would be the effect / in which scénario ? :)
These are genuine questions :)
I don't have an example to give you :/. I saw it used on https://app.hey.com/.
Well, i don't think we can do it with AssetMapper / ImportMap for now.... at least not with the importmap() function.
https://github.com/symfony/symfony/blob/44395abfcb2c859b26e0c6880c74dadd94da1038/src/Symfony/Component/AssetMapper/ImportMap/ImportMapRenderer.php#L140-L144
foreach ($modulePreloads as $url) {
$url = $this->escapeAttributeValue($url);
$output .= "\n<link rel=\"modulepreload\" href=\"$url\">";
}
But this could be a good PR for AssetMapper :)
Thank you for this issue. There has not been a lot of activity here for a while. Has this been resolved?
Could I get a reply or should I close this?
Hey,
I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!