Skip to content

Add query: '?url' parameter to all glob imports#938

Merged
chrisvire merged 1 commit intomainfrom
fix/import-glob-query
Feb 10, 2026
Merged

Add query: '?url' parameter to all glob imports#938
chrisvire merged 1 commit intomainfrom
fix/import-glob-query

Conversation

@FyreByrd
Copy link
Collaborator

@FyreByrd FyreByrd commented Feb 10, 2026

This forces svelte to use the url for the resource, rather than aggressively optimizing by building some data into the page itself.

Summary by CodeRabbit

  • Refactor
    • Optimized static asset resolution across the application, including icons, images, audio files, videos, and illustrations. Updated asset loading mechanisms across multiple components and pages for consistent and efficient resource handling.

This forces svelte to use the url for the resource, rather than aggressively optimizing by building some data into the page itself.
@FyreByrd FyreByrd requested a review from chrisvire February 10, 2026 17:13
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

This PR adds the query: '?url' parameter to 19 import.meta.glob() calls across 14 files, enabling the bundler to return URL strings for assets instead of module defaults. Changes affect components, data utilities, and routes uniformly.

Changes

Cohort / File(s) Summary
Component Asset Imports
src/lib/components/BookTabs.svelte, src/lib/components/BottomNavigationBar.svelte, src/lib/components/CollectionList.svelte, src/lib/components/ScriptureViewSofria.svelte, src/lib/components/Sidebar.svelte
Added query: '?url' to glob calls for tab icons, navigation icons, and illustrations, causing assets to resolve as URL strings instead of module defaults.
Data & Utility Imports
src/lib/data/audio.ts, src/lib/scripts/milestoneLinks.ts, src/lib/video/index.ts
Added query: '?url' to glob imports for audio/timings, clips, and video/thumbnail assets respectively, enabling URL-based asset resolution in utility modules.
Route Asset Imports
src/routes/about/+page.js, src/routes/plans/+page.svelte, src/routes/plans/[id]/+page.svelte, src/routes/quiz/[collection]/[id]/+page.svelte, src/routes/share/+page.svelte, src/routes/text/+page.svelte
Added query: '?url' to glob calls across multiple routes (about, plans, quiz, share, text) to resolve illustrations, plans, badges, clips, and border assets as URLs.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • Fix plan image caching #921: Modifies image glob usage in src/routes/plans/+page.svelte; this PR extends that change by adding URL resolution to the same glob.
  • Migrate Plans to Svelte 5 #893: Changes how image URLs are constructed via asset proxies in src/routes/plans/+page.svelte; this PR complements that work by enabling glob URL returns.
  • Feature/book tabs component #857: Introduces asset glob imports in src/lib/components/BookTabs.svelte; this PR modifies that same component's import behavior to return URLs.

Suggested reviewers

  • chrisvire

Poem

🐰 The URLs hop in bright and free,
No more modules dancing endlessly,
From glob to string the assets fly,
Like carrots bright 'neath open sky! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: adding query: '?url' parameter to all glob imports, which is consistently applied across multiple files in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/import-glob-query

No actionable comments were generated in the recent review. 🎉

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Member

@chrisvire chrisvire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@chrisvire chrisvire merged commit f62feaf into main Feb 10, 2026
4 checks passed
@chrisvire chrisvire deleted the fix/import-glob-query branch February 10, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants