facebook / facebook/docusaurus

Extend existing content plugins (CMS integration, middleware, doc gen...)

Abierto
#4,138 31 comentarios 7 reacciones 0 asignados Ver en GitHub
proposal
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

## 💥 Proposal

I've written a couple of blog posts (which I will shortly publish) on how to use Docusaurus as a headless CMS, with Wordpress's Gutenberg.

I've also written a sample plugin, `wordpress-to-docusaurus-plugin` which uses GraphQL to pull Blog posts from Wordpress, which I then use to build Docusaurus posts with.

All looks good but one problem remains. Plugins currently load in parallel, so new blog posts are not seen until I reload. I need my plugin's `loadContent` to run before the blog plugin runs, so it sees the new posts, I've created.

I would like to add an optional `loadingPriority` to plugin options, which defines the order they are loaded.

This will enable us to still load plugins in parallel or without any priority defined but for certain use-cases, we can prioritise the order of loading.

I've found, I only need to prioritise, `loadContent`, so we could have a single numeric `loadingPriority` option which is available to any plugin.

```
[
require.resolve('wordpress-to-docusaurus-plugin'),
{
// ... my other options
loadingPriority: 1 // optional
},
],
```

It's small change that is required to the existing code to make this possible.
Is this a PR you would be interested in reviewing or do you have an alternative preference ?

### Have you read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/master/CONTRIBUTING.md#reporting-new-issues)?

Yes

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.