Repository navigation
Fetch the vector renderer and style compiler from a vectortile release - #25
Merged
Merged
Conversation
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.
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.
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.
Stacked on #24.
react-vectorstyleandreact-vectortilearrive with that PR.react-sdk carried copies of mapconductor-vectortile's web build in
vectorstyle/andvectortile/. They were made by that repo'sscripts/sync-sdk.shfrom a local build. Theirdist/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
scripts/vector-assets.jsonrecords the tag (v0.1.0) and the SHA-256 ofvectorstyle-web.tgzandvectortile-web.tgz.scripts/fetch-vector-assets.mjsdownloads both assets and checks their checksums. It unpacks them intoreact-vectorstyle/vendor/vectorstyle/andreact-vectortile/vendor/vectortile/, and writes a.releasestamp so a second run does nothing. A mismatched checksum is refused.prebuild(react-vectortile also aspredev). Dev, CI (test.yml,api-surface.yml) andnpm-publish.ymlall go throughbuild, so they all use the same bytes.MAPCONDUCTOR_VECTORTILE_DIR=/path/to/mapconductor-vectortilecopies a local build instead, unverified. This replacessync-sdk.sh's web half.vendor/is gitignored.The packages
vendor/: both packages shipvendor/next todist/and import it by relative path.tsup.config.tskeepsvendor/external. The renderer finds its worker withnew URL('./worker.js', import.meta.url), and both find their wasm next to their own files, so bundling them intodist/would break those paths.--external ../vendor/*does not match relative imports, so this needed a config file.compileStyle,CompiledStyleandStyleAffects. Without this, react-vectortile would carry a second copy of the style compiler's wasm.StyleAffectsnow comes from the vendored types, and react-vectorstyle gains the three exports above.vectorstyle/andvectortile/workspaces and their API gate entries. Neither was ever published to npm.^0.2.1.preflight-publish.mjsrejected the"*"it had.package-lock.jsonis regenerated. Bring feature/bearing-clockwise into develop #24's lock was missing thereact-vectorstyleworkspace and was behind several ranges that Bring feature/bearing-clockwise into develop #24 raised, sonpm ciwould have rejected it.Checked
vendor/, the script fetched and verified both assets. A second run did nothing.npm run buildfor both packages passed. Indist/,vendor/is imported, not inlined.npm pack --dry-runincludesvendor/with the wasm, the worker and.release(react-vectorstyle 223 kB, react-vectortile 877 kB unpacked).vite buildofexamples/basicemits both.wasmfiles and the renderer's worker.preflight-publish.mjspasses.