Skip to content

[0.42-r2 H2] hasEnhancedForms static scan misses forms inside imported components — silent enhancement loss #577

Description

@SisyphusZheng

Severity: high · Category: framework design issue

Evidence. route-scanner.ts:243-249: hasEnhancedForms is set only when the PAGE ROUTE SOURCE contains data-open-enhance in attribute shape. A page whose only enhanced form lives in an imported component (e.g. app/components/contact-form.tsx) is not detected, so the client bundle omits the enhancement layer and the form silently degrades to a native POST — with no warning anywhere.

Fix. Follow project-local relative imports from page route sources (bounded depth, cycle-safe) and scan those sources too; if a form is detected only there, the route is marked. Keep the attribute-shape regex (prose must not trigger).

Acceptance. a fixture route whose enhanced form is in an imported component gets the enhancement layer (and a unit test pins the import-following scan); prose-only mentions still don't trigger.


Filed from the 0.42 round-2 review (docs/audit/2026-07-28-alpha5-round2-review.md). Target line: 0.42.0-alpha.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.42.0-alpha.60.42 round-2 review remediation (morph client hardening)architecturebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions