You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to clear these warnings from my browser while debugging my app, because only the admin section of my site currently uses hotwire_combobox:
The resource /assets/hotwire_combobox.esm-3cc9ba76.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
The resource /assets/hotwire_combobox.umd-c0b89259.js was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
Is the UMD build ever appropriate to pin or preload for importmaps users? Since importmaps depends on ESM, I would hazard a guess no? In that case it might be more appropriate to rewrite hw_importmap.rb to only pin the ESM build
Would it be possible to make the preload-or-not config exposed to end users in a reasonable way? This feels like it may be a limitation of importmap-rails, given that Mission Control has a similar issue
Additionally, by using pin_all_from, individual modulepreload links are generated for each and every JavaScript file in the project, which is probably not what you want
The text was updated successfully, but these errors were encountered:
searls
changed the title
Importmaps are pinning and preloading both UMD and ESM builds of hotwirecombobox
Importmaps are pinning and preloading both UMD and ESM builds (and ~25 other files)
Jun 18, 2024
Thanks for raising this and trying to find a workaround.
Yeah, this is a remnant from first spiking on the library and trying a spray approach. I'll have to take a look and see what we need and don't need. UMD is probably fine to drop, and I'd expect ESM to be able to stand on its own, since that's what's published on npm for use in non-importmap apps. But that's evidently not working so something's up.
I'll keep this open while I (or someone else) take a look.
I'm trying to clear these warnings from my browser while debugging my app, because only the admin section of my site currently uses hotwire_combobox:
If you're using importmaps, the importmap.rb:
Will pin and (apparently?) preload both of these files (they aren't checked into the repo, as they're generated):
I guess there are two issues here:
hw_importmap.rb
to only pin the ESM buildAdditionally, by using
pin_all_from
, individualmodulepreload
links are generated for each and every JavaScript file in the project, which is probably not what you wantThe text was updated successfully, but these errors were encountered: