Plugins API: `beforeDevServer` and `afterDevServer` are documented, but don't exist
Have you read the Contributing Guidelines on issues?
- [X] I have read the Contributing Guidelines on issues.
Prerequisites
- [X] I'm using the latest version of Docusaurus.
- [X] I have tried the
npm run clearoryarn clearcommand. - [X] I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - [X] I have tried creating a repro with https://new.docusaurus.io.
- [X] I have read the console error message carefully (if applicable).
Description
https://docusaurus.io/docs/api/plugin-methods mentions beforeDevServer and afterDevServer. When I attempted to use these, I found I couldn't get them to do anything. A quick search in GitHub shows only results in .mdx files, so it appears to me like the API simply doesn't exist. Searching for configureWebpack instead, for example, brings up a bunch of results.
Reproducible demo
https://codesandbox.io/p/devbox/examples-classic-b9y9z?file=%2Fdocusaurus.config.js
Steps to reproduce
- Run the dev server
- Observe that
running beforeDevServerisn't logged
Expected behavior
I don't really know because it's completely broken, but I'd expect it to at least console.log when starting the dev server, like it does if I configure the plugin manually using configureWebpack.
Actual behavior
Nothing is logged. I get no behaviour change.
Your environment
No response
Self-service
- [ ] I'd be willing to fix this bug myself.
Methods marked as // TODO means they don't exist. Looks very unprofessional to have these stubs in the official documentation, but they have been there since docusaurus had <100 users 😅
I don't think they are off anyone's roadmap, AFAICT, but we haven't seen enough motivating use cases.
I don't particularly care about the APIs in question not existing. In practice, they would have probably saved me little effort. The issue here is the total lack of communication that the wishlist embedded in the documentation is merely that.
Methods marked as
// TODOmeans they don't exist
Why do I have to raise a GitHub issue to establish this? How am I supposed to know this? What I took these docs to mean were "methods with //TODO above them don't have a proper documentation comment". The idea TODO without any context is sufficient communication to anyone, let alone users of the product, is insane.
This entire page is not designed to be user-facing but for communication within a very small group of developers who both develop and consume the plugin APIs. Time has evolved and the audience has changed but the page is not updated. Therefore you are criticizing what is essentially an internal documentation page. I'm not saying it shouldn't be updated, just that no effort has been done and it served its purpose at its time.