Skip to content

charlie: next/v3 Raw and Conditional pipeline parity with main #351

@charliecreates

Description

@charliecreates

Subtask of #348. Align next/v3 Raw and Conditional behavior with main by adopting the rehype plugin based Raw and Conditional pipeline (including <![endif]/--> closers, head aware conditionals, multiline Raw support, and Raw inside Conditional) and backfilling the associated tests and snapshots.

Target branch

All work for this issue should be implemented against the next/v3 branch.

  • Branch from origin/next/v3.
  • Open pull requests with base set to next/v3 (not main).

Context

On main, Raw and Conditional are implemented as a plugin-driven pipeline:

  • <Raw> uses a rehype plugin to turn placeholder nodes into type: 'raw' nodes so multiline HTML is emitted verbatim.
  • <Conditional> renders light-weight markers that a rehype plugin then transforms into conditional comment blocks, including head-aware conditionals and the safer <![endif]/--> closer.
  • Tests assert correct closer syntax, support for nested <Raw> inside <Conditional>, and correct <head>/<body> placement.

On next/v3, Raw and Conditional still rely on string-based rendering (including a Suspense-based Conditional implementation) and older closer behavior. This issue is about bringing next/v3 up to the same behavioral baseline as main while keeping the v3 branch focus.

Implementation notes

When working this issue:

  1. Use the Raw/Conditional comparison work in charlie: head vs next/v3 #348 as a guide for the expected behavior on main.
  2. Port the rehype-based Raw and Conditional plugins, plus the updated <Conditional> implementation, from main into next/v3, reconciling any v3-only differences in the renderer.
  3. Bring over the dedicated tests and snapshots for Raw and Conditional (including closer, multiline Raw, and Raw-inside-Conditional cases) so next/v3 has the same coverage as main.
  4. Keep the public API surface of <Raw> and <Conditional> unchanged; the goal is to align behavior and serialization, not to introduce new props or flags.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions