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

fix(core): fail fast if plugin has no name #10239

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 20, 2024

Motivation

Docusaurus plugins should always have a name.

Apart from clearly identifying them, it also helps to create a dedicated unique namespace per plugin used for various things (creating json files, looking for i18n files...)

Before Docusaurus 3.4- there were cases where using an "anonymous plugin" worked, but it is only by luck of not implementing lifecycles requiring a name. (see #10203)

And our TS types always assumed a name is there.

For these reasons Docusaurus will now ensure a name is provided. I'll consider it a bugfix and not a breaking change.

Test Plan

unit tests

@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label Jun 20, 2024
@slorber slorber requested a review from Josh-Cena as a code owner June 20, 2024 16:44
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 20, 2024
Copy link

netlify bot commented Jun 20, 2024

[V2]

Name Link
🔨 Latest commit 45ab31e
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/66745e70980eff0008d9020a
😎 Deploy Preview https://deploy-preview-10239--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

github-actions bot commented Jun 20, 2024

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 69 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 59 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 70 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 65 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 68 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/tags 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report

Copy link

Size Change: 0 B

Total Size: 1.84 MB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/codeTranslations.json 2 B
website/.docusaurus/docusaurus.config.mjs 27.1 kB
website/.docusaurus/globalData.json 123 kB
website/.docusaurus/i18n.json 930 B
website/.docusaurus/registry.js 304 kB
website/.docusaurus/routes.js 202 kB
website/.docusaurus/routesChunkNames.json 130 kB
website/.docusaurus/site-metadata.json 2.17 kB
website/build/assets/css/styles.********.css 112 kB
website/build/assets/js/main.********.js 897 kB
website/build/index.html 38.1 kB

compressed-size-action

@slorber slorber merged commit 97630b4 into main Jun 20, 2024
32 checks passed
@slorber slorber deleted the slorber/improve-unnamed-plugin-error branch June 20, 2024 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants