Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

MDX v2 or support for JSX-style comments #249

@trevor-scheer

Description

@trevor-scheer

Sorry if there is any glaring incorrectness in my recount of the issue here, I did this investigation awhile ago with @trevorblades and might not be remembering the facts exactly.

My desired outcome is to be able to use prettier + eslint to have my tooling / editor format code blocks correctly in the apollo-server repo's docs. This currently doesn't pan out due to a couple minor roadblocks that can hopefully be worked around or fixed in some way. The currently-dead-ended PR is here: apollographql/apollo-server#6914

Over there, I noted a couple potential ways to unblock:

  1. Figure a way to strip HTML comments before mdx parsing happens
  2. Print JSX-style comments correctly (i.e. don't print them) when we generate the HTML

IIRC, our current use of MDX v1 (which uses HTML-style comments) breaks current v2 tooling. So upgrading to v2 is potentially a solution.

Alternatively, we could stay on v1 if it was possible to use JSX-style comments instead. Currently, those turn up as actual text in the rendered HTML, so that's not a viable option for now (but could potentially be something we implement in the docs build pipeline, presumably, by stripping them out).

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