Repository navigation
fix: keep widget shortcuts working in AOT standalone builds - #184134
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
|
Merged via squash.
|
…#184134) * fix: keep widget shortcuts working in AOT standalone builds * fix(build): declare widget shortcut asset consumers
What Problem This Solves
Fixes: command-palette shortcuts stop working inside embedded widgets when an AOT standalone build omits function source.
User Impact
Widget shortcuts remain available in builds where
Function.toString()returns an opaque native body. Keyboard matching, widget isolation, and configuration stay the same.Why This Change Was Made
The sandbox generated its browser shortcut matcher by serializing a host function. An opaque
[native code]body produces invalid JavaScript in the widget frame. The existing runtime-script asset generator now bundles the canonical typed matcher at build time, and the sandbox embeds that asset. Its normal content version changes with the generated bytes.Related: #183120, #183611.
Evidence
The new regression fetches the real sandbox HTTP response, delivers widget content through its message handler, and parses the resulting inner-frame scripts with opaque host function source. It fails on the original owner with the expected syntax error and passes with this change. The existing Unicode and prototype-isolation test now exercises the generated matcher; asset freshness and dependency-store determinism remain covered.
Focused tests passed across six files (53 tests), including repository/project preparation and opaque-source worker scripts. Targeted production and test typechecking, lint, formatting, and independent review cover the final patch. The final four-test HTTP file passed again after its descriptor-based fixture correction (26.9 s command wall time; test bodies under 1 s). Matcher and asset-generation test bodies took 2 ms and 340 ms respectively; CI timing is pending.
Small emitted-JS JIT and AOT (
functionSource: false) executables using the real owners clone and capture a synthetic Git repository, run project inspection, and emit valid widget scripts. The original sandbox AOT control emits an invalid native function body; JIT passes. The worker controls also confirm the already-landed #183611 repair. These are macOS arm64 owner probes; no full application build or Linux AOT qualification is claimed.The scoped production unused-export scan found the string-named matcher build input missing from Knip's generator roots; this PR now declares it beside the existing script factory inputs. That scan also reported four untouched exports (
buildCustomS3PublicUrl,cronSourceScheduleKey,deepFreezeDiagnosticValue,OnboardingRecommendationMatchesSchema). Those findings remain recorded; the local scan is not claimed clean, and exact-head CI is required.Initial CI also caught the new generated import missing from the trusted PR wrapper's extraction inventory. The asset is now declared there, and both exact failed closure tests pass locally (14.84 s command wall time). The two declaration corrections received a fresh independent review and targeted lint/type/format checks; the runtime implementation and earlier behavior proof are unchanged.