Skip to content

refactor: remove vestigial appRscStream handling from processRscComponents #148

Description

@uhyo

Problem

processRscComponents (packages/static/src/build/rscProcessor.ts) accepts an appRscStream parameter, drains it, applies the ID mapping to it, and returns appRscContent — but its only caller, buildApp (packages/static/src/build/buildApp.ts), passes a dummy empty stream and ignores the returned appRscContent:

// We pass a dummy empty stream since we handle per-entry RSC payloads separately.
const dummyStream = new ReadableStream<Uint8Array>({ ... });

Per-entry payload replacement actually happens in buildSingleEntry via replaceIdsInContent. The parameter and return field appear to be leftovers from a single-entry design.

Suggested fix

Drop appRscStream/appRscContent from processRscComponents (returning only components and idMapping), simplify its tests accordingly, and delete the dummy-stream plumbing in buildApp.

Found during a framework audit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions