mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Load the default renderer as the page starts, and follow through the camera port in tests
- The standalone page starts loading the default renderer as it starts (loadDefaultRenderer), so Cesium arrives beside the page's own setup, not after it; the scene takes a plugin or a promise of one. - Where a follow target's layer has no display position yet, the followed position is the target's own position at the frame port's scene time. - The globe engine's photoreal base that fails to come back is off again and the globe shown; a later switch tries again. The draped-imagery host asks the map engine whether the globe is shown where the renderer cannot say. The scene resizes the renderer with its container. - Cockpit and voice tests follow through the camera port (followEntity), not by setting the viewer's tracked entity; the fake frame port has a scene time.
This commit is contained in:
1 parent
6daf63d90c
commit
ae4fbb5053
21 files changed
+328
-87
No files matched your search
@@ -62,8 +62,8 @@ const isAdapter = (file) => file.startsWith('src/render/cesium/');
|
||||
* counts as above. Neither is a file still to port, so neither is on the
|
||||
* allow-list; this list is never grown.
|
||||
* - The application scene is the composition root: it picks the Cesium
|
||||
* renderer as the default and takes the viewer hooks it hands the
|
||||
* application from the adapter's application module.
|
||||
* renderer as the default, loading the adapter's application module only
|
||||
* when it is given no renderer (`DYNAMIC_ENTRIES`).
|
||||
* - The conformance page runs the suite on the Cesium adapter's harness
|
||||
* and draws the reference scenes on its scene renderer.
|
||||
*/
|
||||
@@ -75,6 +75,12 @@ const ADAPTER_ENTRIES = {
|
||||
],
|
||||
};
|
||||
|
||||
/**
|
||||
* The entries that load their adapter modules on demand: `import()`, its
|
||||
* result awaited and destructured by name, never kept whole or forwarded.
|
||||
*/
|
||||
const DYNAMIC_ENTRIES = new Set(['src/app/scene.js']);
|
||||
|
||||
const git = (...args) =>
|
||||
execFileSync('git', args, { cwd: root, encoding: 'utf8' });
|
||||
const tracked = git(
|
||||
@@ -329,11 +335,26 @@ test('the files that name the adapter by design take named exports, never Cesium
|
||||
readFileSync(path.join(root, file), 'utf8'),
|
||||
);
|
||||
// A static import by name only: no namespace or default binding, no
|
||||
// dynamic import, and no forwarding of the module.
|
||||
for (const [node] of nodesOf(parsed.program)) {
|
||||
// dynamic import (but in DYNAMIC_ENTRIES, one destructured by name), and
|
||||
// no forwarding of the module.
|
||||
const parents = new Map(nodesOf(parsed.program));
|
||||
for (const [node, parent] of parents) {
|
||||
const source = node.source?.value;
|
||||
if (typeof source !== 'string') continue;
|
||||
if (!modules.includes(targetOf(file, source))) continue;
|
||||
if (node.type === 'ImportExpression' && DYNAMIC_ENTRIES.has(file)) {
|
||||
const declarator = parents.get(parent);
|
||||
assert.ok(
|
||||
parent?.type === 'AwaitExpression' &&
|
||||
declarator?.type === 'VariableDeclarator' &&
|
||||
declarator.id.type === 'ObjectPattern' &&
|
||||
declarator.id.properties.every(
|
||||
(p) => p.type === 'ObjectProperty' && !p.computed,
|
||||
),
|
||||
`${file} must destructure import(${source}) by name`,
|
||||
);
|
||||
continue;
|
||||
}
|
||||
assert.equal(
|
||||
node.type,
|
||||
'ImportDeclaration',
|
||||
|
||||
Reference in new issue
Block a user