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(core): async docusaurus.config.js creator function #6165

Merged
merged 2 commits into from
Dec 22, 2021

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Dec 22, 2021

Motivation

Fixes #3791

We should be able to use async code to create the config.

Later: we'll try to also support ESM config + top-level await

Have you read the Contributing Guidelines on pull requests?

Yes

Test Plan

tests + dogfood

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Dec 22, 2021
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Dec 22, 2021
@Josh-Cena Josh-Cena changed the title feat(v2): async support for config file feat(core): async config creator Dec 22, 2021
@netlify
Copy link

netlify bot commented Dec 22, 2021

✔️ [V2]

🔨 Explore the source changes: 0b63194

🔍 Inspect the deploy log: https://app.netlify.com/sites/docusaurus-2/deploys/61c33f3797ffc0000734edb2

😎 Browse the preview: https://deploy-preview-6165--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 85
🟢 Accessibility 98
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

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

@Josh-Cena
Copy link
Collaborator

This actually means we can support ESM remark plugins, because they can now be await import()'ed. We can upgrade the docs on this

@github-actions
Copy link

Size Change: 0 B

Total Size: 662 kB

ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 40.1 kB
website/build/assets/css/styles.********.css 102 kB
website/build/assets/js/main.********.js 490 kB
website/build/index.html 29.6 kB

compressed-size-action

@slorber
Copy link
Collaborator Author

slorber commented Dec 22, 2021

This actually means we can support ESM remark plugins, because they can now be await import()'ed. We can upgrade the docs on this

Maybe we should dogfood this first and ensure it works before documenting it?

I'm not sure to see how it would actually work considering we are still using Remark 12 and most ES plugins are for Remark 13? It is retro compatible enough so that Remark 13 plugins can work with our current setup?

@Josh-Cena
Copy link
Collaborator

Hmmm, that part I don't know😄 We can still test

@slorber slorber changed the title feat(core): async config creator feat(core): async docusaurus.config.js creator function zv Dec 22, 2021
@slorber slorber changed the title feat(core): async docusaurus.config.js creator function zv feat(core): async docusaurus.config.js creator function Dec 22, 2021
@slorber slorber merged commit f8a6709 into main Dec 22, 2021
@slorber slorber deleted the slorber/async-support branch December 22, 2021 16:03
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: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

async config loading
3 participants