Additional import.meta.glob fixes#10315
Conversation
✅ Deploy Preview for astro-docs-2 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
| default: Record<string, any>; | ||
| } | ||
| const data = await import.meta.glob<CustomDataFile>('../data/**/*.js'); | ||
| const data = import.meta.glob<CustomDataFile>('../data/**/*.js'); |
There was a problem hiding this comment.
Just checking, normally we've been removing await when there is eager loading! And, this doesn't need the Object.values?
There was a problem hiding this comment.
await is removed because import.meta.glob never returns a promise, but it returns a record of functions that return promises when called. There's no usage example, and we can't showcase this easily, but whether someone needs eager: true will probably come down to what they're importing and why. The Vite docs cover what eager does, and we link to that above.
* i18n(fr): update all the `migrate-to` guides Signed-off-by: Armand Philippot <git@armand.philippot.eu> * i18n(fr): update `guides/imports.mdx` See #9240, #10140, #10310 and #10315 * farewell `Astro.glob` * fix wrong locale * fix bold text Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com> * remove useless await see #10332 --------- Signed-off-by: Armand Philippot <git@armand.philippot.eu> Co-authored-by: Thomas Bonnet <thomasbnt@protonmail.com>
Fixes 2 more instances of
import.meta.glob