Load the presenter client only on presenter entry

This commit is contained in:
Jonathan Sykes
2026-10-08 04:39:52 +08:00
parent 3c9a24ae45
commit 5fb9564468
7 changed files with 238 additions and 211 deletions

View File

@@ -76,3 +76,11 @@ test('new group files with a changed dependency contract cannot run against the
const f=fixture(next,['/one.js?v=new','/two.js?v=2']);f.root.Lazy.manifest.groups['feature:test'].dependencies=['feature:dep'];f.root.Lazy.manifest.groups['feature:dep']={contract:1,files:[]};
await f.root.Lazy.load('feature:test');assert.deepEqual(f.inserted.map(n=>n.src),['/one.js?v=1','/two.js?v=2']);assert.equal(f.root.Lazy.reloadRequired,true);
});
test('classic chunk registry proxies use window.YT and keep the executed singleton pinned',async()=>{
const {root,inserted}=fixture();root.YT={TestApi:{open:n=>n+2}};
const proxy=root.Lazy.proxy('feature:test',['open'],'TestApi');
assert.equal(await proxy.open(3),5);
const singleton=root.YT.TestApi;await root.Lazy.load('feature:test');
assert.equal(root.YT.TestApi,singleton);assert.equal(inserted.length,2);
});