Skip to content

Support CDN loading for DuckDB WASM#31

Merged
caioricciuti merged 2 commits intocaioricciuti:mainfrom
xxxbrian:main
Feb 24, 2026
Merged

Support CDN loading for DuckDB WASM#31
caioricciuti merged 2 commits intocaioricciuti:mainfrom
xxxbrian:main

Conversation

@xxxbrian
Copy link
Contributor

This PR introduces a configurable mechanism for loading DuckDB WASM and worker assets, enabling both local and CDN-based deployments.

Key changes:

  • Replace the static MANUAL_BUNDLES with resolveDuckdbBundles, which determines asset sources at runtime based on environment variables.
  • Add support for CDN-based loading via:
    • DUCK_UI_DUCKDB_WASM_USE_CDN
    • DUCK_UI_DUCKDB_WASM_BASE_URL
  • Introduce a build-time flag DUCK_UI_DUCKDB_WASM_CDN_ONLY, exposed as __DUCK_UI_BUILD_DUCKDB_CDN_ONLY__ in Vite, to allow CDN-only builds.
  • Add createDuckdbWorker to standardize worker instantiation (including proper URL revocation) and update all DuckDB connection paths to use it.
  • Update environment variable documentation and typings accordingly.

There are no changes to query behavior. This update focuses on making DuckDB WASM asset loading configurable and better suited for edge deployments.

@caioricciuti caioricciuti merged commit 8f3adc3 into caioricciuti:main Feb 24, 2026
4 of 5 checks passed
@caioricciuti
Copy link
Owner

Merged :) thank you very much!

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