Skip to content
New issue

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

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

Already on GitHub? # to your account

docs: disable plugin-debug in production by default #10928

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

taraspos
Copy link
Contributor

Motivation

Documentation says1

  • The debug plugin will display useful debug information at [`http://localhost:3000/__docusaurus/debug`](http://localhost:3000/__docusaurus/debug).
    It is mostly useful for plugin authors, that will be able to inspect more easily the content of the `.docusaurus` folder (like the creates routes), but also be able to inspect data structures that are never written to disk, like the plugin data loaded through the `contentLoaded` lifecycle.
    :::info
    If you use the plugin via the classic preset, the preset will **enable the plugin in development and disable it in production** by default (`debug: undefined`) to avoid exposing potentially sensitive information. You can use `debug: true` to always enable it or `debug: false` to always disable it.
    If you use a standalone plugin, you may need to achieve the same effect by checking the environment:

But code snippet does the opposite. This change updates code snippet to disable plugin in production by default.

Footnotes

  1. https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-debug

@facebook-github-bot
Copy link
Contributor

Hi @taraspos!

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 cla@meta.com. Thanks!

Copy link

netlify bot commented Feb 13, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 0a89f48
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/67adcbf7f25a290008c92ed7
😎 Deploy Preview https://deploy-preview-10928--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.

Copy link

⚡️ Lighthouse report for the deploy preview of this PR

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

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.

LGTM thanks 👍

Need to wait for the CLA bot to report your signature (can't merge without)

@slorber slorber changed the title Disable plugin-debug in production by default docs: disable plugin-debug in production by default Feb 13, 2025
@slorber slorber added the pr: internal This PR does not touch production code, or is not meaningful enough to be in the changelog. label Feb 13, 2025
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 14, 2025
@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!

@slorber slorber merged commit 75e5a00 into facebook:main Feb 16, 2025
13 of 14 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
CLA Signed Signed Facebook CLA pr: internal This PR does not touch production code, or is not meaningful enough to be in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants