refactor: own application request operations and surface caches

This commit is contained in:
Sameh Khamis committed 2026-09-14 14:49:04 -07:00
1 parent 310809e8f1
commit ac977bd8bc
53 files changed
+4388 -3317

No files matched your search

+10 -1
View File
@@ -577,5 +577,14 @@
"src/app/layers/aisLiveVessels.js",
"src/app/constructCatalog.js",
"src/standalone/layerSources.js",
"src/app/constructCatalog.test.mjs"
"src/app/constructCatalog.test.mjs",
"src/app/surfaceServices.js",
"src/app/operations.js",
"src/data/surfaceServices.js",
"src/annotations/resolver.js",
"src/services/terrainHeights.js",
"src/services/groundFloor.js",
"src/services/meshFloorSampler.js",
"src/services/groundSnap.js",
"src/app/operations.test.mjs"
]
+51 -6
View File
@@ -1521,7 +1521,15 @@
"src/app/layers/overlayHost.js",
"src/app/layers/aisLiveVessels.js",
"src/app/constructCatalog.js",
"src/standalone/layerSources.js"
"src/standalone/layerSources.js",
"src/app/surfaceServices.js",
"src/app/operations.js",
"src/data/surfaceServices.js",
"src/annotations/resolver.js",
"src/services/terrainHeights.js",
"src/services/groundFloor.js",
"src/services/meshFloorSampler.js",
"src/services/groundSnap.js"
],
"external": [
"@mapbox/vector-tile",
@@ -1541,6 +1549,7 @@
"exports": ["./application/layers"],
"modules": [
"src/annotations/annotationResolver.js",
"src/annotations/resolver.js",
"src/app/catalog.js",
"src/app/constructCatalog.js",
"src/app/layers/aisLiveVessels.js",
@@ -1581,14 +1590,11 @@
"src/data/detectionCohort.js",
"src/data/detectionDraw.js",
"src/data/detectionPolicy.js",
"src/data/fireAnchors.js",
"src/data/firmsAdapt.js",
"src/data/firmsLabels.js",
"src/data/flowMatch.js",
"src/data/focusDeemphasis.js",
"src/data/geoid.js",
"src/data/groundFloor.js",
"src/data/groundSnap.js",
"src/data/iconOrientation.js",
"src/data/infrastructure.js",
"src/data/installationFeedback.js",
@@ -1601,7 +1607,6 @@
"src/data/local_data/natural_earth/marine.json",
"src/data/local_data/natural_earth/regions.json",
"src/data/local_data/neighborhoods/san-francisco.json",
"src/data/meshFloorSampler.js",
"src/data/militaryAwarenessEngine.js",
"src/data/militaryInstallationData.js",
"src/data/modelVisualAnchor.js",
@@ -1616,7 +1621,6 @@
"src/data/satelliteClass.js",
"src/data/scenePick.js",
"src/data/spriteOrder.js",
"src/data/terrainHeights.js",
"src/data/tomtomTiles.js",
"src/data/tr3bRegistry.js",
"src/data/trackedCamera.js",
@@ -1859,5 +1863,46 @@
"pbf",
"mgrs"
]
},
"application-operations": {
"exports": ["./application/operations"],
"modules": [
"src/annotations/annotationResolver.js",
"src/annotations/resolver.js",
"src/app/operations.js",
"src/app/sourceSlot.js",
"src/app/surfaceServices.js",
"src/data/dataCredits.js",
"src/data/geoid.js",
"src/data/local_data/natural_earth/marine.json",
"src/data/local_data/natural_earth/regions.json",
"src/data/local_data/neighborhoods/san-francisco.json",
"src/data/naturalEarthRegions.js",
"src/data/neighborhoodPolygons.js",
"src/data/retryableLoad.js",
"src/data/scenePick.js",
"src/keylessGeocoder.js",
"src/layers/firms/anchors.js",
"src/locations.js",
"src/search/defaults.js",
"src/search/geospatial.js",
"src/search/google.js",
"src/search/http.js",
"src/search/placeSearch.js",
"src/services/application.js",
"src/services/groundFloor.js",
"src/services/groundSnap.js",
"src/services/meshFloorSampler.js",
"src/services/requests.js",
"src/services/terrainHeights.js"
],
"external": [
"cesium",
"egm96-universal",
"satellite.js",
"@mapbox/vector-tile",
"pbf",
"mgrs"
]
}
}
+5 -11
View File
@@ -2986,17 +2986,12 @@ async function main() {
}
return window.__dfCountModels(icao);
};
// Vite serves an edited source file as `…/groundFloor.js?t=<hmr stamp>`;
// importing the PLAIN path then hands back a second, unrelated module
// instance whose cells the app never reads. Offer the URL the app itself
// loaded first, then the plain path (clean, never-hot-reloaded server).
const seen = performance.getEntriesByType('resource')
.map((e) => e.name)
.filter((n) => /\/src\/data\/groundFloor\.js(\?|$)/.test(n));
window.__dfCandidates = [...new Set([...seen.reverse(), `${window.__gevQaSourceBase || '/src'}/data/groundFloor.js`])];
// Read the application's surface owner, then prove it is the one
// used by the actual poll/render path with the unchanged floor seed.
window.__dfCandidates = window.__godsEyeView.surfaceServices?.groundFloor ? ['application surface'] : [];
return { candidates: window.__dfCandidates.length };
});
record('display-floor: groundFloor module URL candidates found', dfSetup.candidates > 0,
record('display-floor: ground-floor service owner found', dfSetup.candidates > 0,
JSON.stringify(dfSetup));
// Identity probe. Seed a contact's FIX cell BEFORE its first fix arrives,
@@ -3012,8 +3007,7 @@ async function main() {
const tried = [];
for (let i = 0; i < window.__dfCandidates.length; i++) {
const url = window.__dfCandidates[i];
let gf;
try { gf = await import(/* @vite-ignore */ url); } catch { tried.push({ url, h: null }); continue; }
const gf = window.__godsEyeView.surfaceServices.groundFloor;
if (typeof gf.reportMeshFloorCell !== 'function') { tried.push({ url, h: null }); continue; }
gf.setMeshFloorPreferred(true);
gf._clearMeshFloorCellsForTest();