Skip to content

[R3][MED] routeInfo declared in 4 parallel places, all missing the emitted filePath/module fields #490

Description

@SisyphusZheng

Source: third full-project audit (2026-07-25). Severity: MEDIUM. Category: half-fix regression (docs/current/VERSION_PLAN.md:118 "complete the routeInfo type declarations" only half landed).

Evidence

  • Authority: packages/adapter-vite/src/internal/protocol/ssg.ts:254-268 (SsrBundle.routeInfo).
  • Divergent copies: internal/ssg/ssg-render.ts:55-61 (inline as Array<{...}> narrowing that drops rendering/params), internal/ssg/ssg-helpers.ts:81-86, internal/ssg/ssg-dynamic.ts:24-31 (RouteInfoItem, no rendering).
  • Emitted shape: internal/ssg/entry-render-ssg.ts:64-73 emits { path, filePath, tagName, module, isDynamic, paramNames, revalidate, rendering }filePath and module exist in none of the 4 declarations, while generated code consumes info.filePath (entry-render-ssg.ts:120).
  • git diff v0.41.0-alpha.17..v0.41.0-alpha.18 -- packages/adapter-vite/src/internal/protocol/ssg.ts shows alpha.18 only added fields, never converged the copies.

Impact

Four hand-maintained copies of one contract will drift again (the ssg-render cast is already narrower than the authority); consumers reading filePath through the SsrBundle type fail to compile.

Suggested fix

Export a named RouteInfoEntry unit type from protocol/ssg.ts (add filePath; type module as unknown), point all four sites at it, delete the inline copies and redundant casts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions