fix(transforms): prune destructured server values - #3861
Conversation
|
@codex Please review exact head RED-GREEN evidence: all five real-stage regressions failed before implementation and now pass. Exact-tree local verification: focused suite 129 steps; all transform stages 22 suites / 321 steps; typecheck; full |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe transform now analyzes destructured module-scope declarations, removes server-only bindings, and preserves pattern keys, defaults, and client-used sibling initializers. Tests cover nested, array, rest, default, computed-key, and mixed declarators. ChangesDestructured server-value pruning
Merge Risk: ⚪ Minimal · up to This change correctly extends server-value pruning to supported destructured bindings while preserving references and unrelated declarators; focused and full validation pass, so no actionable merge-blocking risk remains. Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Client bundle boundary
A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e3fca6409
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex Please re-review exact head Please mutation-check the three new side-effect/sibling regressions and verify that the basic, nested, array, rest, and mixed-declarator #607 cases still prune. Exact local verification: focused suite 132 steps; all transform stages 22 suites / 324 steps; typecheck; full |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Closes veryfront/veryfront-issue-inbox#607.
What changed
moduleScopeDeclarationsconsider supported object, nested, array, and rest patterns for hook-closure pruning.mainafter feat(integrations): run catalog tools with local credentials #3843, in a separate mechanical commit.Root cause
moduleScopeDeclarationsdiscarded every candidate in aVariableDeclarationas soon as one declarator used a non-Identifierbinding. A destructured hook-only value therefore never reached the existing multi-name pruning consumer, so its server import survived in the browser artifact.Safety invariant
Only plain binding positions become
namesandbindingIds. Patterns with computed keys or defaults remain untouched. Multi-binding patterns remain untouched unless every binding is part of the hook closure. The pass continues to under-prune when safety is uncertain.RED-GREEN evidence
Before their implementation changes, the real-stage regressions failed for:
The updated focused suite passes 132 steps with 0 failures.
Verification
deno task typecheck: passdeno task lint:ci: passgit diff --check: passThis is a functional transform fix only. It does not change Studio UI.