Skip to content

follow-up(components): drop the globalThis process cast now that the browser shim is source-only #6833

Description

@claude

Blocked-by: #6808

What

objectui#6809 (PR pending) narrows packages/components' browser process shim so it no longer reaches the package's TEST project: the declaration moved from src/global.d.ts to src/browser-process-shim.d.ts, and packages/components/tsconfig.test.json names that one file in exclude. With that in place, tsc -p tsconfig.test.json resolves process to node's real global again — measured green on all of process.cwd(), process.platform and process.versions.node.

PR #6808 (claude/issue-6779-container-declaration-ratchet, still open and unmerged) predates that and carries a local workaround at its call site, with the reasoning written out beside it:

(globalThis as unknown as { process: { cwd(): string } }).process.cwd()

Once #6808 lands, that cast is dead weight — the plain process.cwd() idiom compiles in this package, and the workaround now reads as a warning about a hazard that no longer exists.

Why it was not done in the objectui#6809 PR

The call site does not exist on main yet: #6808 is unmerged, so there is nothing in the objectui#6809 branch's base to edit. Touching it there would have meant either editing a file that only exists on another agent's branch or creating a merge conflict with in-flight work. The objectui#6809 dispatch ruled it out explicitly and asked for this follow-up instead.

Scope

  • Replace the globalThis cast at its call site with the plain process.cwd() spelling.
  • Remove the explanatory comment that justifies the cast, or reduce it to a pointer at objectui#6809 if the surrounding prose still needs one.
  • No other change. Whether the call site itself is still wanted is test(components): ratchet the container-declaration census to zero #6808's call, not this one's.

⚠️ Do this only AFTER #6808 has merged. Until then the file is another branch's in-flight work.


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions