Skip to content

Codemod skips native SVG ownership when a component is referenced in a type query #2403

Closed

Description

@domgan-oai

Reproduction

In the renderer-ownership change in #2402, give @octanejs/codemod a path-only mark.svg and run the following module with --svg-paths.

import type { ComponentProps } from 'react';
import Mark from './mark.svg';

function Button({ children }) {
  return <button>{children}</button>;
}

export function Pane() {
  return <Button><Mark /></Button>;
}

export type Props = ComponentProps<typeof Pane>;

Observed behavior

The SVG stays on its original import. The generated module matches the default run byte for byte. Removing the last line lets the same command generate the native SVG component. A type query on Button also prevents migration. We reproduced these results on both 38d1933d0 and the integrated head ee03e3fb7. The package manifest on those revisions is @octanejs/[email protected].

Expected behavior

An erased type query on the owner or receiving component should preserve eligibility for this migration. The resulting public type expression should still resolve. An executable use of the component such as capture(Pane) can hand it to another renderer and should continue to defer migration.

The ownership walk receives references from localUses, including value symbols used in TypeScript type queries. This is a missed migration present before the conflict resolution in #2402. Its fix needs regression coverage for both type references and runtime escapes. Original review finding.

Activity

  1. added
    bug
    agent-authored
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-authoredbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions