← Back to Pull requests

perf: let jsx-ast and html start on their dependency's first chunk #1241

Open
unknown opened this pull request with 268 lines diff across 3 files
View on GitHub
unknown unknown commented on Nov 03, 2026 19:34 UTC
Author

<!--
Please read the Code of Conduct and the Contributing Guidelines before opening a pull request.
-->

Description

This PR lets jsx-ast and html start on their dependency's first chunk, so with more than one thread, page building and rendering overlap with the generators before them. It's part of the stack that splits #1205.

  • jsx-ast builds each page as its module's entries arrive. Once its input ends, it emits { manifest }, every page's head in the order the site lists them, without waiting for the pages still being built.

  • html compiles each page as it arrives, bundles the component library and the client assets as soon as the manifest does, and renders the pages as they're compiled.

  • Bundler adapters' compile can now run before and alongside buildServer and buildClient.
  • jsx-ast now yields pages in the order their entries arrive, plus the { manifest } item, which is a breaking change for anything reading its output.

    | Site build | main | This PR |
    | --- | --- | --- |
    | 4 threads | 9.82s, 1728MB | 8.12s (-17%), 2179MB (+26%) |
    | 6 threads | 8.56s, 2280MB | 6.82s (-20%), 2821MB (+24%) |

    Full Node.js docs, medians of 5 runs. The extra memory is stages that ran one after the other now running at once.

    Validation

    Added tests for jsx-ast building pages as they arrive and sending the manifest while worker.stream holds back its next batch, and for html bundling once the manifest arrives and building the same site from its whole input. On 12 of Node.js's API docs, the output is byte-identical to main's at 1 and 4 threads.

    Related Issues

    Refs: #1205

    Check List

  • I have read the Contributing Guidelines and made commit messages that follow the guideline.

  • I have run node --run test and all tests passed.

  • I have check code formatting with node --run format:check & node --run lint.

  • I've covered new added functionality with unit tests if necessary.
  • Diff: 268 lines (+201 / -67) across 3 files Reviewer: avivkeller Review duration: 33090m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.39) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.39 · 268 lines diff across 3 files
    0.39
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.335
    Real PR Conversation Timeline
    1 comments
    "Review active on #1241"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 39.4% (MEDIUM) · Higher = larger blast radius
    39.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.0% · Safe to merge
    21.0%
    Repository