Sprint 2: globalThis Sync in Sub-Module Resolution (_resolveSubModuleImports) #52
Labels
No labels
bug
docs
feature
housekeeping
html-spec
performance
react-compat
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
glow-all/true-headless-browser#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problembeschreibung
executeModule()sync't proxy-window Properties nachglobalThisvorimport()— aber_resolveSubModuleImports()(für rekursiv geladene Sub-Modules) tut das nicht. Dadurch sehen tiefere Module keine Config-Variablen als Bare-Globals.Betroffene Sites: vuejs.org (
__VP_HASH_MAP__), discord.com (__OVERLAY__,GLOBAL_ENV), x.com (__INITIAL_STATE__)Aktueller Code
executeModule()(execution-realm.ts ~L340):_resolveSubModuleImports()(execution-realm.ts ~L400) — KEIN Sync vorhanden.Lösung
Den Sync-Code in
_resolveSubModuleImportseinbauen, vor demBun.write()der Sub-Module.Akzeptanzkriterien
__VP_HASH_MAP__ist in Sub-Modules von vuejs.org definiert__INITIAL_STATE__ist in Sub-Modules von x.com definiert__OVERLAY__ist in Sub-Modules von discord.com definiertBetroffene Dateien
src/js/execution-realm.ts_resolveSubModuleImportseinfügenCross-Ref
a274576): Module Sub-Import ResolutionImplemented in
9fa5e83:_syncGlobalsToGlobalThis()as shared private methodexecuteModule()beforeimport()— main module sees inline config_resolveSubModuleImports()beforeBun.write()— sub-modules see inline configglobalThis(filters Bun/node globals)Verified:
window.__CFG__set by inline script is visible as__CFG__(bare global) inside type="module" scripts.