fix(client): consume bootstrap handoff queue
This commit is contained in:
1 parent
85bfc7bb22
commit
4ad6e28663
2 files changed
+2
-1
No files matched your search
@@ -88,7 +88,7 @@ export class ClientModuleSystem implements ClientModuleLoader {
|
||||
// Replace first: a bundle that executes while queued handoffs are draining
|
||||
// must register against the live sink rather than append behind the drain.
|
||||
win.__ModuleLoader__ = sink
|
||||
for (const handoff of queued?.handoffs ?? []) sink.load(handoff)
|
||||
for (const handoff of queued?.handoffs.splice(0) ?? []) sink.load(handoff)
|
||||
}
|
||||
|
||||
/** Register one bundle factory, rejecting a script that executes twice without invalidation. */
|
||||
|
||||
@@ -72,6 +72,7 @@ describe('lazy CJS arrival', () => {
|
||||
const b = bench([row('runtime')])
|
||||
const exports = await b.loader.import('runtime', '', {})
|
||||
expect((exports as { marker: string }).marker).toBe('preloaded')
|
||||
expect(handoffs).toEqual([])
|
||||
expect(b.fetched).toEqual([])
|
||||
expect(win.__ModuleLoader__?.mode).toBe('live')
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user