Skip to content

docs: document Vite's worker format and fix README snippets - #780

Merged
kylebarron merged 1 commit into
mainfrom
kyle/docs-vite-worker
Oct 22, 2026
Merged

kylebarron merged 1 commit into
mainfrom
kyle/docs-vite-worker

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

The deck.gl-geotiff quick start doesn't build with a default Vite config. The GeoTIFF decoder worker uses top-level await and dynamic imports, and Vite bundles workers in iife format by default, so vite build fails:

  • Vite 8: Top-level await is currently not supported with the 'iife' output format
  • Vite 7: Invalid value "iife" for option "worker.format" - UMD and IIFE output formats are not supported for code-splitting builds.

vite dev doesn't bundle workers, so this only shows up in production builds. Every example sets worker: { format: "es" }, but no README mentioned it.

Changes

  • deck.gl-geotiff README: a "Using Vite" section after the quick start, with the config and both error messages, so searching for either finds it.
  • geotiff README:
    • The same setting under the worker pool section.
    • Fixes for three snippets that didn't compile:
      • registry is exported as DECODER_REGISTRY. The pool/worker doc comment had the same mistake.
      • GeoTIFF.open takes { headerSource, dataSource }. The example now reads the header through the chunked, cached source and tile data straight from HTTP, as GeoTIFF.fromUrl does.
      • data exists only on pixel-interleaved arrays, so the example checks layout before reading it.
    • It also finishes a sentence that was cut off, and says a decoder can return decoded pixels as well as bytes.
    • It links Decoder in the API docs instead of ./src/decode.ts, which 404s on the docs site.
  • proj README: it said the package doesn't depend on proj4, which stopped being true in perf(proj): resolve common EPSG codes without a request, share in-flight ones #760.

Checked

  • A Vite app whose main.ts is the quick start fails vite build on Vite 8.3.5 and 7.3.7 with the default config. With the README's config, copied verbatim, it builds on both and emits the worker chunk.
  • With strict on, every ts block in the two READMEs except the Vite config typechecks against this branch's build. Before, three failed: TS2305 (registry), TS2739 (GeoTIFF.open) and TS2339 (data).
  • The docs site builds, and the three API pages show the new text.

🤖 Written by Claude Code

The GeoTIFF decoder worker uses top-level await and dynamic imports, so
`vite build` fails with Vite's default `iife` worker format. Tell users
to set `worker: { format: "es" }` in the deck.gl-geotiff and geotiff
READMEs.

Fix the geotiff README snippets that didn't compile (`DECODER_REGISTRY`,
`GeoTIFF.open` options, narrowing before `data`), and the proj README,
which said proj doesn't depend on proj4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the docs label Oct 22, 2026

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@kylebarron
kylebarron merged commit e141901 into main Oct 22, 2026
3 checks passed
@kylebarron
kylebarron deleted the kyle/docs-vite-worker branch October 22, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant