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(plugin-content-blog): add setGlobalData #7163

Closed
wants to merge 1 commit into from

Conversation

kuizuo
Copy link
Contributor

@kuizuo kuizuo commented Apr 12, 2022

When I use useGlobalData hook, I only get docusaurus-plugin-content-docs data, but I didn't see any data from docusaurus-plugin-content-blog, so I wanted to give it setGlobalData.

image

But I think that's all there is to it.

When I use useGlobalData hook, I only get docusaurus-plugin-content-docs data, but I didn't see any data from docusaurus-plugin-content-blog, so I wanted to give it setGlobalData.
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Apr 12, 2022
@netlify
Copy link

netlify bot commented Apr 12, 2022

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 56169de
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/6255841d8c39480008d274fb
😎 Deploy Preview https://deploy-preview-7163--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 settings.

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 65
🟢 Accessibility 100
🟢 Best practices 92
🟢 SEO 100
🟢 PWA 90

Lighthouse ran on https://deploy-preview-7163--docusaurus-2.netlify.app/

@Josh-Cena
Copy link
Collaborator

Josh-Cena commented Apr 12, 2022

Sorry, we're not going to accept this, because it increases bundle size by 265 kB even for our tiny blog, which is far beyond acceptable. The doc global data is mostly needed because there are theme components like navbar doc items that need to access doc data on every page, and even then, the bundle carefully optimized and assured that only critical data is made global.

Please see #4492, #6923, and a few other related issues for discussions on how we can enable you to do this in userland (currently the only way is through plugin enhancement, as outlined in #4492). But I can assure you we are not interested in making this global data available out-of-the-box, especially since there's no sign of effort to reduce bundle size. If our own theme components/hooks don't use them, it's hard, if not impossible, to determine what's the right data to be made global.

@Josh-Cena Josh-Cena closed this Apr 12, 2022
@Josh-Cena Josh-Cena added the closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests) label Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA closed: wontfix A fix will bring significant overhead, or is out of scope (for feature requests)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants