Skip to content

finding(vscode-extension): Export to React generates a file that cannot compile — its preamble calls registerDefaultRenderers, an export @object-ui/components does not have #7837

Description

@claude

Found while fixing the root README's three phantom imports for #7417. Out of that
card's file surface (root README.md plus one ledger string), so it is filed rather
than edited.

The defect

packages/vscode-extension/src/extension.ts:225generateReactComponent(schema),
the body of the extension's Export to React command (called at line 203) — writes
a React file into the user's workspace whose first lines are:

packages/vscode-extension/src/extension.ts:230   import { registerDefaultRenderers } from '@object-ui/components';
packages/vscode-extension/src/extension.ts:233   registerDefaultRenderers();

registerDefaultRenderers is on no export of @object-ui/components. Measured
against the built artifact on origin/main at 900f8d99:

  • grep -c registerDefaultRenderers packages/components/dist/index.d.ts returns 0.
  • The only register* on that package's built dist/index.d.ts is
    registerPlaceholders.

So every invocation of Export to React emits a file that does not compile, and the
error the user sees names a symbol they never typed.

What the correct output is

That package registers its renderers as an import side effect — no call needed:

  • packages/components/package.json declares sideEffects: true.
  • packages/components/src/index.ts runs import './renderers'; under the comment
    Register all ObjectUI renderers (side-effects).
  • The built dist/index.js carries 114 top-level register( calls.

The generated preamble should therefore import the package for the side effect and
drop the call. The root README was carrying the identical wrong lines and is fixed
that way in the PR for #7417, so there is a landed spelling to copy.

packages/vscode-extension/DESIGN.md:272,274 documents the same two lines and needs
the same edit.

Why no gate caught it

The phantom lives inside a template literal, so TypeScript cannot see it and the
doc gates never reach it either:

  • scripts/check-doc-snippet-types.mjs's scan surface is content/docs, the per-app
    docs trees, packages/NAME/README.md, and the root README.md. DESIGN.md is not
    a README.md, so that file is outside it.
  • scripts/check-readme-exports.mjs tracks packages/NAME/README.md only.

A generator that emits import statements is a documentation surface with no gate,
which is why this survived while the same two lines in a README did not.

Severity note

packages/vscode-extension is private: true, so nothing is published from it and no
changeset is owed for a fix here. The blast radius is the extension's own users.


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

Labels

domain:devxobjectui devx stream: fix lands on .github/, scripts/ or release pipeline — devx lane cross-repofindingpm:dispatched

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions