Upgrade shared Cesium adapter to 1.147 with cache contract checks

This commit is contained in:
Codex
2026-11-16 16:18:35 +03:00
parent f4e7369eec
commit 872f01cd27
9 changed files with 174 additions and 62 deletions
+1 -1
View File
@@ -13,7 +13,7 @@
"@nodedc/page-patterns": "0.1.0",
"@nodedc/ui-core": "0.7.1",
"@nodedc/ui-react": "0.7.1",
"cesium": "^1.143.0",
"cesium": "1.147.0",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
+3 -3
View File
@@ -1,7 +1,7 @@
# Shared Cesium React adapter
`@nodedc/map-cesium-react 0.1.0` is the shared renderer boundary for the
canonical `Map Page 0.1.0` and CesiumJS `1.143.0`.
`@nodedc/map-cesium-react 0.1.2` is the shared renderer boundary for the
canonical `Map Page 0.1.0` and CesiumJS `1.147.0`.
It is not a Foundry application component and does not own product navigation,
Inspector fields, tokens, provider allowlists, TileCache storage or admin
@@ -25,7 +25,7 @@ must not be used as a substitute for the `DC Default` treatment.
- The browser receives only same-origin BFF paths.
- Runtime config must use `missioncore.map-runtime/v1`, Map Page `0.1.0` and
Cesium `1.143.0`.
Cesium `1.147.0`.
- Canonical assets are fixed to imagery `2`, terrain `1` and buildings
`96188`.
- Provider endpoint documents must declare `credentialMode=gateway`.
+3 -3
View File
@@ -231,9 +231,9 @@ Page/Visual/Application previews не содержат shipped domain fixtures.
Во внутренней sandbox-сборке Map Page временно скрывает визуальный credit overlay renderer, потому что он перекрывает рабочую композицию во время настройки шаблона. Метаданные provider attribution не удаляются из runtime. Перед любым внешним, пользовательским или коммерческим развёртыванием overlay должен быть возвращён в соответствии с условиями выбранного provider. Это зафиксированный технический долг, а не правило production-интерфейса.
## Cesium adapter 1.143
## Cesium adapter 1.147
Текущий reference adapter использует CesiumJS `1.143.0`. Он загружается отдельным lazy chunk только при открытии Map Page и преобразует только declared Application bindings в реальные Cesium entities. Пустая Map Page не содержит domain entities.
Текущий reference adapter использует CesiumJS `1.147.0`. Он загружается отдельным lazy chunk только при открытии Map Page и преобразует только declared Application bindings в реальные Cesium entities. Пустая Map Page не содержит domain entities.
Server-side runtime contract:
@@ -323,7 +323,7 @@ profile.
## Domain geometry in the existing renderer
`@nodedc/map-cesium-react` 0.1.1 adds optional `onSceneReady(context)`;
CesiumJS remains pinned to **1.143.0**. Existing consumers need no changes.
Version 0.1.2 pins CesiumJS to **1.147.0**, retaining this callback contract. Existing consumers need no changes.
`context` contains the existing `Cesium` namespace, renderer-owned `viewer`,
and an abort `signal`. A consumer can attach ready domain geometry, pick
objects and move the camera, returning synchronous cleanup for its own
+82 -50
View File
@@ -30,7 +30,7 @@
"@nodedc/page-patterns": "0.1.0",
"@nodedc/ui-core": "0.7.1",
"@nodedc/ui-react": "0.7.1",
"cesium": "^1.143.0",
"cesium": "1.147.0",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
@@ -325,36 +325,63 @@
"node": ">=6.9.0"
}
},
"node_modules/@cesium/engine": {
"version": "26.1.0",
"resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-26.1.0.tgz",
"integrity": "sha512-WzeJEcmGD7/htBJ8JEZt95OgZjErPwUHqyAlJY/mCzmDm7hfwpuucLBSUhiynWW3khqBT1C7dhibjb7tdic7oA==",
"node_modules/@cesium/core": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@cesium/core/-/core-0.1.1.tgz",
"integrity": "sha512-2twC6bAYWdrJ4YVS2UPCpgkE7EZWHl+GVuh5n9IT6gVL9W9OYPas29Vh+wrUVI/9Hs8TeiNtis+Du2U9b+ce6A==",
"license": "Apache-2.0",
"dependencies": {
"earcut": "3.0.2",
"mersenne-twister": "^1.1.0",
"urijs": "^1.19.7"
},
"engines": {
"node": ">=22.17.0"
}
},
"node_modules/@cesium/engine": {
"version": "26.5.0",
"resolved": "https://registry.npmjs.org/@cesium/engine/-/engine-26.5.0.tgz",
"integrity": "sha512-vpMuIOQ7QXNVrVTCCPWQ9y0zyfR+lhKLUOWt8XRCrDibtsASVpXGRFKQEdONf2D2EznIAQZ09sGOC8LwhvOeIQ==",
"license": "Apache-2.0",
"dependencies": {
"@cesium/core": "^0.1.1",
"@cesium/gltf": "^0.1.1",
"@cesium/wasm-splats": "^0.1.0-alpha.2",
"@spz-loader/core": "0.3.1",
"@tweenjs/tween.js": "^25.0.0",
"@zip.js/zip.js": "^2.8.1",
"@zip.js/zip.js": "^2.9.0",
"autolinker": "^4.0.0",
"bitmap-sdf": "^1.0.3",
"dompurify": "^3.3.0",
"draco3d": "^1.5.1",
"earcut": "3.0.2",
"dompurify": "^3.4.14",
"draco3d": "1.5.7",
"grapheme-splitter": "^1.0.4",
"jsep": "^1.3.8",
"kdbush": "^4.0.1",
"ktx-parse": "^1.0.0",
"kdbush": "^4.1.0",
"ktx-parse": "^2.0.0",
"lerc": "^2.0.0",
"mersenne-twister": "^1.1.0",
"meshoptimizer": "^1.0.1",
"meshoptimizer": "^1.2.0",
"pako": "^3.0.0",
"protobufjs": "^8.6.5",
"protobufjs": "^8.8.0",
"rbush": "^4.0.1",
"topojson-client": "^3.1.0",
"urijs": "^1.19.7"
},
"engines": {
"node": ">=22.0.0"
"node": ">=22.17.0"
}
},
"node_modules/@cesium/gltf": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@cesium/gltf/-/gltf-0.1.1.tgz",
"integrity": "sha512-tACM+dBXm+hXU4iyMynEK11ymce6GqUaB8TjF7jbtqBfxVYh45C2zBjNnv3ElpwhlwjLjwbc25zKZrO8oGYegw==",
"license": "Apache-2.0",
"dependencies": {
"@cesium/core": "^0.1.1"
},
"engines": {
"node": ">=22.17.0"
}
},
"node_modules/@cesium/wasm-splats": {
@@ -364,16 +391,17 @@
"license": "Apache-2.0"
},
"node_modules/@cesium/widgets": {
"version": "16.1.0",
"resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-16.1.0.tgz",
"integrity": "sha512-c+jt8F3YIZs2x6+X+HS4q0S9nd2jVcbPVShUmlrDK1s+C7IlEvXceDGrkjivHRElAVCzfaWEEwY1g7Lg5HCGmA==",
"version": "16.3.1",
"resolved": "https://registry.npmjs.org/@cesium/widgets/-/widgets-16.3.1.tgz",
"integrity": "sha512-eyAGPYYL4v/WeLasmphRwxFcCl/qeTcRhncbBlOzMTSTLjgjZSea0IcEDCKC2ip/mHPeGe887X84xi1SV8mcEQ==",
"license": "Apache-2.0",
"dependencies": {
"@cesium/engine": "^26.1.0",
"@cesium/core": "^0.1.1",
"@cesium/engine": "^26.5.0",
"nosleep.js": "^0.12.0"
},
"engines": {
"node": ">=22.0.0"
"node": ">=22.17.0"
}
},
"node_modules/@dnd-kit/accessibility": {
@@ -1433,9 +1461,9 @@
}
},
"node_modules/@zip.js/zip.js": {
"version": "2.8.26",
"resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.8.26.tgz",
"integrity": "sha512-RQ4h9F6DOiHxpdocUDrOl6xBM+yOtz+LkUol47AVWcfebGBDpZ7w7Xvz9PS24JgXvLGiXXzSAfdCdVy1tPlaFA==",
"version": "2.25.0",
"resolved": "https://registry.npmjs.org/@zip.js/zip.js/-/zip.js-2.25.0.tgz",
"integrity": "sha512-oNRqUuU1XFu6G5d7Z0jufJ9dS9WteO0xiU/PNxsUrb4itZCsSbn191jpJzU00Gmc6S680X3DPZeF5EV4zAEMAg==",
"license": "BSD-3-Clause",
"engines": {
"bun": ">=0.7.0",
@@ -1583,22 +1611,26 @@
"license": "CC-BY-4.0"
},
"node_modules/cesium": {
"version": "1.143.0",
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.143.0.tgz",
"integrity": "sha512-EHz61NBp/2UPYE4iWCZ+YK9Jcb0d2hzRfqkj4DRaUM3cJmA9hE2FTmcPPZ2iL7w+W0YUScI0gc9XeSTXlPIQtA==",
"version": "1.147.0",
"resolved": "https://registry.npmjs.org/cesium/-/cesium-1.147.0.tgz",
"integrity": "sha512-gY5TF0rSyIMtnSIFHUuiHnrCuhdKaHUzLWFcjxytsdheKfKtYYOWicIWMypGjwYfnmJrgPgNF7HNjO9SK/JIkw==",
"license": "Apache-2.0",
"workspaces": [
"packages/core",
"packages/gltf",
"packages/engine",
"packages/widgets",
"packages/sandcastle"
],
"dependencies": {
"@cesium/engine": "^26.1.0",
"@cesium/widgets": "^16.1.0",
"protobufjs": "^8.6.5"
"@cesium/core": "^0.1.1",
"@cesium/engine": "^26.5.0",
"@cesium/gltf": "^0.1.1",
"@cesium/widgets": "^16.3.1",
"protobufjs": "^8.8.0"
},
"engines": {
"node": ">=22.0.0"
"node": ">=22.17.0"
}
},
"node_modules/chokidar": {
@@ -1665,9 +1697,9 @@
}
},
"node_modules/dompurify": {
"version": "3.4.12",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.12.tgz",
"integrity": "sha512-zQvGet8Z2sWbQhCmfFz/T5QWH2oBmjnqK3qvOjaqaNLrLEF912WamU+ohnTp0TCep/MFVHpdJuCZEdFOdTnEFg==",
"version": "3.4.18",
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.4.18.tgz",
"integrity": "sha512-ofe3wI/uNm68HInABYFJYqQxRw1EaKAjNdrFVKqjUY+UZurvNd2L/HuQe097s/4RivWiZyP6tT7aoT8atjfhwg==",
"license": "(MPL-2.0 OR Apache-2.0)",
"optionalDependencies": {
"@types/trusted-types": "^2.0.7"
@@ -1873,12 +1905,12 @@
"license": "MIT"
},
"node_modules/jsep": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz",
"integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/jsep/-/jsep-1.6.0.tgz",
"integrity": "sha512-Y8Tr54CX7B5YGAwo7/n8eumidEX3Opx98RyyQVnlHqUaZcPA8uUzL2v1rshr9ypW9Q6hNjfJtg3sL+8kaNE7TA==",
"license": "MIT",
"engines": {
"node": ">= 10.16.0"
"node": ">= 20.16.0"
}
},
"node_modules/jsesc": {
@@ -1914,9 +1946,9 @@
"license": "ISC"
},
"node_modules/ktx-parse": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-1.1.0.tgz",
"integrity": "sha512-mKp3y+FaYgR7mXWAbyyzpa/r1zDWeaunH+INJO4fou3hb45XuNSwar+7llrRyvpMWafxSIi99RNFJ05MHedaJQ==",
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-2.0.0.tgz",
"integrity": "sha512-PW38i6SBZagE7c4yCYru636ICCkhJ8FNjOzAdjGkC65BZ0gElQJvFenSGc62SHFj5Fg0ft+U38PPhMZsWYQLCg==",
"license": "MIT"
},
"node_modules/lerc": {
@@ -1957,9 +1989,9 @@
"license": "MIT"
},
"node_modules/meshoptimizer": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.2.0.tgz",
"integrity": "sha512-davRZeIJbxJrE24cwQle7ZDsxjdk/OphNOV83oX+efQinyoHY9Jcyz3MHbaoG0qySZajldGztNZ1RN/T19PZsg==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.3.0.tgz",
"integrity": "sha512-2oZqMAcEEiCtXWUjIGtZ71oPx1B0ZxYGTqIKsXB1wzWFhleNsCFxQuUJzgCV706bRcwPWtMGf1odmQvAcqKkIw==",
"license": "MIT"
},
"node_modules/ms": {
@@ -2028,9 +2060,9 @@
}
},
"node_modules/pako": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/pako/-/pako-3.0.1.tgz",
"integrity": "sha512-GupotUUI0mlhugKjUs4bjOwLt3nrehy9Ys2dxC0GtgVef5cnKggkDMmf2bq2poCCuVXopWPmqsc9VDT2iJUy+w==",
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/pako/-/pako-3.0.3.tgz",
"integrity": "sha512-tmrebBBYI5FOw8QICGwJNqE8fotC8R+gwcxOvoFNv+GKehOI6Lc6YBolNcQNnC4v96l1wt7rh102ifD4kVeZAQ==",
"funding": [
{
"type": "github",
@@ -2093,9 +2125,9 @@
}
},
"node_modules/protobufjs": {
"version": "8.7.0",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.7.0.tgz",
"integrity": "sha512-uu52JNxLh3vsL7tXU/h0gDaywufvuUCTbGSi0NKQKBZ2ZopkmrWQJSQO/EFqzu/5YhiwgVM8rq/a/iVpx4eZ0g==",
"version": "8.8.1",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-8.8.1.tgz",
"integrity": "sha512-d9e9179bjXSJdpJ3+R9fP8hzXsnKLyxTjHLG1dUzje8a27pPyXCe6PrcRtgx2rjoM3IZzHd2vAs+6J/BsO1k7Q==",
"license": "BSD-3-Clause",
"dependencies": {
"long": "^5.3.2"
@@ -2462,9 +2494,9 @@
},
"packages/map-cesium-react": {
"name": "@nodedc/map-cesium-react",
"version": "0.1.1",
"version": "0.1.2",
"dependencies": {
"cesium": "1.143.0"
"cesium": "1.147.0"
},
"devDependencies": {
"@types/react": "^19.1.0",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "@nodedc/map-cesium-react",
"version": "0.1.1",
"version": "0.1.2",
"description": "Shared credential-free Cesium adapter for NODE.DC Map Page consumers.",
"type": "module",
"main": "./dist/index.js",
@@ -21,7 +21,7 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"cesium": "1.143.0"
"cesium": "1.147.0"
},
"peerDependencies": {
"react": ">=18"
+1 -1
View File
@@ -1,7 +1,7 @@
import type * as Cesium from "cesium";
export const MAP_RUNTIME_SCHEMA_VERSION = "missioncore.map-runtime/v1" as const;
export const MAP_PAGE_VERSION = "0.1.0" as const;
export const CESIUM_RENDERER_VERSION = "1.143.0" as const;
export const CESIUM_RENDERER_VERSION = "1.147.0" as const;
export type MapProviderId = "imagery" | "terrain" | "buildings";
export type MapProviderPhase = "idle" | "loading" | "ready" | "disabled" | "error";
@@ -0,0 +1,80 @@
import assert from "node:assert/strict";
import test from "node:test";
import { DefaultProxy, Resource, VERSION } from "cesium";
import { CESIUM_RENDERER_VERSION } from "../dist/contracts.js";
import { applyCacheIntent, fetchMapRuntimeConfiguration } from "../dist/runtime.js";
test("installed Cesium and the runtime contract agree", () => {
assert.equal(VERSION, CESIUM_RENDERER_VERSION);
});
test("Cesium derived terrain and building resources retain the existing cache route", () => {
for (const [root, child] of [
["https://assets.ion.cesium.com/1/", "12/124/113.terrain?v=1"],
["https://assets.ion.cesium.com/96188/tileset.json", "12/124/113.b3dm"],
]) {
const resource = new Resource({
url: applyCacheIntent(root, { enabled: true, no_overwrite: true }, false),
proxy: new DefaultProxy("/api/v1/map/gateway/cache?url="),
});
const derived = resource.getDerivedResource({ url: child });
const proxied = new URL(derived.getUrlComponent(true, true), "http://127.0.0.1:8000");
assert.equal(proxied.pathname, "/api/v1/map/gateway/cache");
const upstream = new URL(proxied.searchParams.get("url"));
assert.equal(upstream.searchParams.get("nodedc_cache_profile"), "live");
assert.equal(upstream.searchParams.has("nodedc_cache_refresh"), false);
assert.equal(upstream.searchParams.has("access_token"), false);
assert.equal(upstream.pathname, new URL(child, root).pathname);
}
});
test("a mismatched renderer cannot silently start against another runtime release", async (t) => {
const originalWindow = globalThis.window;
globalThis.window = { location: { origin: "http://127.0.0.1:8000" } };
t.after(() => {
if (originalWindow === undefined) delete globalThis.window;
else globalThis.window = originalWindow;
});
const configuration = {
schema_version: "missioncore.map-runtime/v1",
map_page_version: "0.1.0",
renderer: { id: "cesium", version: CESIUM_RENDERER_VERSION },
gateway: {
configured: true,
health_url: "/api/v1/map/gateway/health",
asset_endpoint_template: "/api/v1/map/gateway/ion/assets/{asset_id}/endpoint",
cache_proxy_prefix: "/api/v1/map/gateway/cache?url=",
},
assets: { imagery: 2, terrain: 1, buildings: 96188 },
};
t.mock.method(globalThis, "fetch", async () => Response.json(configuration));
assert.equal((await fetchMapRuntimeConfiguration("/api/v1/map/runtime-config", new AbortController().signal)).renderer.version, CESIUM_RENDERER_VERSION);
configuration.renderer.version = "1.143.0";
await assert.rejects(fetchMapRuntimeConfiguration("/api/v1/map/runtime-config", new AbortController().signal), { code: "map_runtime_contract_mismatch" });
});
test("project focus keeps its range and survives the persisted camera round trip", async () => {
const C = await import("cesium");
const scene = {
drawingBufferWidth: 840, drawingBufferHeight: 461,
mapProjection: new C.GeographicProjection(), ellipsoid: C.Ellipsoid.WGS84,
mode: C.SceneMode.SCENE3D,
screenSpaceCameraController: { minimumZoomDistance: 1, maximumZoomDistance: Infinity },
};
const camera = new C.Camera(scene);
scene.camera = camera;
camera.update(C.SceneMode.SCENE3D);
for (const [lon, lat, height] of [[3.711, 51.065, 10], [37.58, 55.75, 160], [-97.736, 30.287, 180]]) {
const target = C.Cartesian3.fromDegrees(lon, lat, height);
camera.flyToBoundingSphere(new C.BoundingSphere(target, 160), {
duration: 0, offset: new C.HeadingPitchRange(0, -Math.PI / 4, 600),
});
assert.ok(Math.abs(C.Cartesian3.distance(camera.positionWC, target) - 600) < 1e-5);
const position = C.Cartographic.clone(camera.positionCartographic);
const orientation = { heading: camera.heading, pitch: camera.pitch, roll: camera.roll };
camera.setView({ destination: C.Cartesian3.fromRadians(position.longitude, position.latitude, position.height), orientation });
const toward = C.Cartesian3.normalize(C.Cartesian3.subtract(target, camera.positionWC, new C.Cartesian3()), new C.Cartesian3());
assert.ok(C.Cartesian3.dot(camera.directionWC, toward) > 0.999999);
assert.ok(Math.abs(C.Cartesian3.distance(camera.positionWC, target) - 600) < 1e-5);
}
});
+1 -1
View File
@@ -32,7 +32,7 @@
{
"name": "@nodedc/map-cesium-react",
"path": "packages/map-cesium-react",
"role": "credential-free Cesium 1.143.0 renderer adapter for canonical Map Page and same-origin Map Gateway BFFs; optional lifetime-scoped ready-domain geometry hook"
"role": "credential-free Cesium 1.147.0 renderer adapter for canonical Map Page and same-origin Map Gateway BFFs; optional lifetime-scoped ready-domain geometry hook"
}
],
"sourceRegistry": "sources.json",
+1 -1
View File
@@ -3157,7 +3157,7 @@ const server = createServer(async (request, response) => {
const gatewayReady = Boolean(mapGatewayInternalUrl);
const gaussianAssetId = String(process.env.CESIUM_GAUSSIAN_SPLAT_ASSET_ID || "").trim();
json(response, 200, {
cesiumVersion: "1.143.0",
cesiumVersion: "1.147.0",
provider: gatewayReady ? "nodedc-map-gateway" : "gateway-required",
ionReady: gatewayReady,
gatewayReady,