Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDX v2 or support for JSX-style comments #249

Open
trevor-scheer opened this issue Oct 13, 2022 · 0 comments
Open

MDX v2 or support for JSX-style comments #249

trevor-scheer opened this issue Oct 13, 2022 · 0 comments

Comments

@trevor-scheer
Copy link
Member

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant