Skip to content

Fetch the vector renderer and style compiler from a vectortile release - #25

Merged
wf9a5m75 merged 1 commit into
developfrom
build/vector-assets-from-release
Oct 25, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
build/vector-assets-from-release

Conversation

@wf9a5m75

Copy link
Copy Markdown
Contributor

Stacked on #24. react-vectorstyle and react-vectortile arrive with that PR.

react-sdk carried copies of mapconductor-vectortile's web build in vectorstyle/ and vectortile/. They were made by that repo's scripts/sync-sdk.sh from a local build. Their dist/ was gitignored, so a clean checkout could not build either React package (#24, item 1), and nothing recorded which commit the copies came from.

MapConductor/vectortile now publishes these as release assets (v0.1.0). This PR takes them from there.

How the assets get here

  • Pin: scripts/vector-assets.json records the tag (v0.1.0) and the SHA-256 of vectorstyle-web.tgz and vectortile-web.tgz.
  • Fetch: scripts/fetch-vector-assets.mjs downloads both assets and checks their checksums. It unpacks them into react-vectorstyle/vendor/vectorstyle/ and react-vectortile/vendor/vectortile/, and writes a .release stamp so a second run does nothing. A mismatched checksum is refused.
  • When it runs: both packages run it as prebuild (react-vectortile also as predev). Dev, CI (test.yml, api-surface.yml) and npm-publish.yml all go through build, so they all use the same bytes.
  • Local builds: MAPCONDUCTOR_VECTORTILE_DIR=/path/to/mapconductor-vectortile copies a local build instead, unverified. This replaces sync-sdk.sh's web half.
  • Git: vendor/ is gitignored.

The packages

  • Shipping vendor/: both packages ship vendor/ next to dist/ and import it by relative path.
    • tsup.config.ts keeps vendor/ external. The renderer finds its worker with new URL('./worker.js', import.meta.url), and both find their wasm next to their own files, so bundling them into dist/ would break those paths.
    • The CLI's --external ../vendor/* does not match relative imports, so this needed a config file.
  • One copy of the compiler: react-vectortile compiles styles through react-vectorstyle. That package now re-exports compileStyle, CompiledStyle and StyleAffects. Without this, react-vectortile would carry a second copy of the style compiler's wasm.
  • API baselines: both are updated. StyleAffects now comes from the vendored types, and react-vectorstyle gains the three exports above.
  • Removed: the vectorstyle/ and vectortile/ workspaces and their API gate entries. Neither was ever published to npm.
  • Peer dependency: react-vectorstyle's js-sdk-core peer is now ^0.2.1. preflight-publish.mjs rejected the "*" it had.
  • Lockfile: package-lock.json is regenerated. Bring feature/bearing-clockwise into develop #24's lock was missing the react-vectorstyle workspace and was behind several ranges that Bring feature/bearing-clockwise into develop #24 raised, so npm ci would have rejected it.

Checked

  • Fetch: from an empty vendor/, the script fetched and verified both assets. A second run did nothing.
  • Build: npm run build for both packages passed. In dist/, vendor/ is imported, not inlined.
  • Packing: npm pack --dry-run includes vendor/ with the wasm, the worker and .release (react-vectorstyle 223 kB, react-vectortile 877 kB unpacked).
  • Example app: vite build of examples/basic emits both .wasm files and the renderer's worker.
  • Publish preflight: preflight-publish.mjs passes.
  • API gate: everything passes except the known Bring feature/bearing-clockwise into develop #24 items, react-icons-* and js-sdk-core (Dump the API baseline: marker tile query padding is per zoom js-sdk-core#9).
  • Not checked in a browser.

react-sdk carried copies of mapconductor-vectortile's web build in
vectorstyle/ and vectortile/, made by its scripts/sync-sdk.sh from a
local build. Their dist/ was gitignored, so a clean checkout could not
build react-vectorstyle or react-vectortile, and nothing recorded which
commit the copies came from.

MapConductor/vectortile now publishes these as release assets.
scripts/vector-assets.json pins the tag (v0.1.0) and each asset's
SHA-256, and scripts/fetch-vector-assets.mjs unpacks them into
react-vectorstyle/vendor/ and react-vectortile/vendor/, refusing a
mismatched checksum. Both packages run it as `prebuild`, so dev, CI and
publishing all use the same bytes. MAPCONDUCTOR_VECTORTILE_DIR points it
at a local vectortile build instead.

The two packages ship vendor/ next to dist/ and import it by relative
path, kept external (tsup.config.ts) so the renderer still finds its
worker and wasm next to its own files. react-vectortile compiles styles
through react-vectorstyle, which now re-exports compileStyle,
CompiledStyle and StyleAffects, rather than carrying a second copy of
the compiler. The vectorstyle and vectortile workspaces are removed;
neither was ever published.

Also pins react-vectorstyle's js-sdk-core peer to ^0.2.1. preflight
rejected the "*" it had.
Base automatically changed from feature/bearing-clockwise to develop October 25, 2026 07:11
@wf9a5m75
wf9a5m75 merged commit dc9bed7 into develop Oct 25, 2026
1 of 2 checks passed
wf9a5m75 added a commit to MapConductor/vectortile that referenced this pull request Oct 25, 2026
react-sdk no longer has vectorstyle/ and vectortile/ workspaces
(MapConductor/react-sdk#25): react-vectorstyle and react-vectortile
unpack a release into their own vendor/. sync-sdk.sh now copies a local
build there and stamps it as local, so the next plain fetch puts the
pinned release back.
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.

1 participant