Repository navigation
docs: document Vite's worker format and fix README snippets - #780
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
iifeformat by default, sovite buildfails:Top-level await is currently not supported with the 'iife' output formatInvalid value "iife" for option "worker.format" - UMD and IIFE output formats are not supported for code-splitting builds.vite devdoesn't bundle workers, so this only shows up in production builds. Every example setsworker: { format: "es" }, but no README mentioned it.Changes
registryis exported asDECODER_REGISTRY. Thepool/workerdoc comment had the same mistake.GeoTIFF.opentakes{ headerSource, dataSource }. The example now reads the header through the chunked, cached source and tile data straight from HTTP, asGeoTIFF.fromUrldoes.dataexists only on pixel-interleaved arrays, so the example checkslayoutbefore reading it.Decoderin the API docs instead of./src/decode.ts, which 404s on the docs site.Checked
main.tsis the quick start failsvite buildon 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.stricton, everytsblock in the two READMEs except the Vite config typechecks against this branch's build. Before, three failed:TS2305(registry),TS2739(GeoTIFF.open) andTS2339(data).🤖 Written by Claude Code