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

feat(syntax-highlight): do client side #11654

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

LeoMcA
Copy link
Member

@LeoMcA LeoMcA commented Aug 19, 2024

Summary

Problem

Syntax highlighting in the content build system clutters our API, and would require porting to rari

Solution

Do it client side

Also fixes e.g. vue pages having examples with a MARKUP header


How did you test this change?

  • yarn dev
  • visited :3000 and :5042
  • visited pages with various syntaxes: both ones which require dynamic importing, and those which are built into prism
  • visited pages with examples with aliased and ignored syntaxes
  • visited pages with markdown code blocks and manually crafted <pre>s
  • tested streaming responses and loading responses from history in ai help

@LeoMcA LeoMcA requested review from mdn-bot and a team as code owners August 19, 2024 16:54
@github-actions github-actions bot added dependencies Pull requests that update a dependency file plus work around features related to MDN Plus blog plus:ai-help labels Aug 19, 2024
@LeoMcA LeoMcA changed the title client syntax highlight feat(syntax-highlight): do client side Aug 19, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label Aug 22, 2024
Copy link
Contributor

@argl argl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@github-actions github-actions bot added merge conflicts 🚧 Please rebase onto or merge the latest main. and removed merge conflicts 🚧 Please rebase onto or merge the latest main. labels Aug 22, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@fiji-flo fiji-flo self-requested a review September 3, 2024 09:28
@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label Sep 5, 2024
Copy link
Contributor

@fiji-flo fiji-flo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Let's see how it performs in prod.

@LeoMcA
Copy link
Member Author

LeoMcA commented Sep 10, 2024

Deploying to stage: https://github.com/mdn/yari/actions/runs/10792160559

Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, left some comments.

build/code-headers.ts Outdated Show resolved Hide resolved
client/src/document/code/syntax-highlight.tsx Show resolved Hide resolved
client/src/document/hooks.ts Outdated Show resolved Hide resolved
client/src/document/code/syntax-highlight.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot added the merge conflicts 🚧 Please rebase onto or merge the latest main. label Sep 10, 2024
Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions github-actions bot removed the merge conflicts 🚧 Please rebase onto or merge the latest main. label Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blog dependencies Pull requests that update a dependency file plus:ai-help plus work around features related to MDN Plus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants