Skip to content

@flue/vite: parse JSX markdown importers and delegate external skill registries #638

Description

@jairojair

Package

@flue/vite@2.0.3 with Vite 8.x.

Reproduction

  1. Create a .tsx module containing a type-only import and JSX, and a static
    .md import:

    import type { Props } from './props';
    import instructions from './instructions.md';
    
    export const view = <div>{instructions}</div>;
  2. Build with the Flue Vite plugin.

The markdown transform calls parserLangForFile('view.tsx'), but the current
implementation returns js. The parser then rejects valid TSX syntax.

A second independent reproduction occurs when another Vite plugin owns a
virtual skill registry. Given an importer ID such as
\\0agents:skills:/workspace/src/skills that reaches a resolved
/workspace/src/skills/example/SKILL.md, Flue's markdown resolver throws
Skill import ... reached resolution untransformed instead of delegating the
edge to the plugin that owns the virtual namespace.

Expected behavior

  • .tsx and .jsx files are parsed with the corresponding JSX-aware parser.
  • A SKILL.md import from an explicitly external virtual registry is left for
    that registry's resolver; Flue should keep rejecting genuinely untransformed
    Flue imports from ordinary JS/TS importers.

Proposed fix

The smallest fix is to map .tsxtsx and .jsxjsx in
parserLangForFile, and return null from the markdown resolver only when the
importer starts with \\0agents:skills:. A focused test can cover both cases
without depending on a particular application.

The current main branch (832ad2ee, published as 2.0.3) still reproduces both
failures.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions