Skip to content

feat(theme-common, theme-classic): Improve CodeBlock Extensibility #11011

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

Closed

Conversation

Danielku15
Copy link
Contributor

@Danielku15 Danielku15 commented Mar 19, 2025

Pre-flight checklist

Motivation

Closes #11008

Test Plan

Verified and tested via unit tests. I primarily focused on codeBlockUtils.test.ts but all other tests locally are green. Looking at the rendered codeblocks on the website they are equal to before.

Test links

Deploy preview: https://deploy-preview-11011--docusaurus-2.netlify.app/
Relevant Links:

Related issues/PRs

#11008

@facebook-github-bot
Copy link
Contributor

Hi @Danielku15!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at [email protected]. Thanks!

Copy link

netlify bot commented Mar 19, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit ee22ed9
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/67db1819a897950008228d64
😎 Deploy Preview https://deploy-preview-11011--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Mar 19, 2025
Copy link

github-actions bot commented Mar 19, 2025

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🔴 42 🟢 98 🟢 100 🟢 100 Report
/docs/installation 🔴 47 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 71 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 61 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🔴 45 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 62 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 73 🟢 100 🟢 100 🟠 86 Report

@Danielku15 Danielku15 force-pushed the feature/codeblock-extensibility branch from bbfcf38 to ee22ed9 Compare March 19, 2025 19:16
@slorber slorber added the Argos Add this label to run UI visual regression tests. See argos.yml GH action. label Mar 20, 2025
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

This PR is already quite large and hard to review

It would be better to split it into many subparts. We don't have to merge everything at once, incremental improvements are easier to merge.

Copy link
Contributor Author

@Danielku15 Danielku15 left a comment

Choose a reason for hiding this comment

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

This PR is already quite large and hard to review

It would be better to split it into many subparts. We don't have to merge everything at once, incremental improvements are easier to merge.

@slorber
I wouldn't consider it "large", but it indeed has a bit of complexity to it. 😅 I'll split it up and refactor some bits as mentioned in the remarks.

I added some comments to give insights in my decision paths. No need to give again anwers, but it might contain some valueable bits for the split PRs.

@slorber
Copy link
Collaborator

slorber commented Mar 20, 2025

I wouldn't consider it "large", but it indeed has a bit of complexity to it. 😅 I'll split it up and refactor some bits as mentioned in the remarks.

Even if it's not a huge PR, it still can be split into many smaller ones.

I'd prefer to progress incrementally. Start by refactoring the code, without changing any behavior. Then apply fine-grained behavior changes, and justify each of them in a dedicated PR.

If you refactor and change everything at once, then we may not agree on everything, and your PR is less likely to be merged fast.

Let's start by focusing on what we agree on:

  • reorganizing code in a better, more testable way
  • 0 implementation detail and behavior change - play it safe
  • more unit tests on parts that we plan to change

@Danielku15
Copy link
Contributor Author

I fully agree on your points. Will work on adapted PRs soon-ish (just wrapping up some other general Docs parts on my project) 😉

@Danielku15
Copy link
Contributor Author

All new PRs with individual changes are ready. They build on-top of each other for simplicity but if we decide to rework/not-merge some parts I'll rebase the changes accordingly .

I also went through all remarks and I think they are covered in the new implementations. Lets continue the discussion step-by-step on the individual PRs. 😉

@Danielku15 Danielku15 closed this Mar 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Argos Add this label to run UI visual regression tests. See argos.yml GH action. CLA Signed Signed Facebook CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve CodeBlock Extensibility
3 participants