Skip to content

Keep renderer workspace packages out of stale Vite prebundles #138

Description

@kostyafarber

Problem

Renderer code imports local workspace packages such as @shift/types, @shift/geo, and @shift/validation. If a local package is not explicitly aliased to source and excluded from Vite dependency optimization, Vite can serve a stale optimized bundle from apps/desktop/node_modules/.vite/deps.

We hit this with clipboard paste: Clipboard.ts called ValidateClipboard.isShiftContent, but the optimized @shift_validation.js bundle still exposed an older API shape. Typecheck passed against source, runtime imported stale optimized output, and Shift's own clipboard JSON was reported as unsupported.

Desired rule

Every local @shift/* package imported by renderer code should be listed in both places in apps/desktop/vite.renderer.config.ts:

  • resolve.alias
  • optimizeDeps.exclude

Acceptance criteria

  • Audit renderer-imported local @shift/* packages and ensure each has source alias + optimizeDeps exclusion.
  • Add a small check/lint script so adding a new renderer @shift/* import cannot silently miss Vite config.
  • Document the debugging pattern for stale .vite/deps package output.

Obsidian context: Ticket - Renderer Vite Workspace Package Dependencies.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions