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

refactor: remove long-deprecated routesLoaded lifecycle #7257

Merged
merged 1 commit into from
May 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/docusaurus-types/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,6 @@ export type Plugin<Content = unknown> = {
allContent: AllContent;
actions: PluginContentLoadedActions;
}) => Promise<void> | void;
routesLoaded?: (routes: RouteConfig[]) => void; // TODO remove soon, deprecated (alpha-60)
postBuild?: (
props: Props & {
content: Content;
Expand Down
16 changes: 0 additions & 16 deletions packages/docusaurus/src/server/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type {
} from '@docusaurus/types';
import {initPlugins} from './init';
import {createBootstrapPlugin, createMDXFallbackPlugin} from './synthetic';
import logger from '@docusaurus/logger';
import _ from 'lodash';
import {localizePluginTranslationFile} from '../translations/translations';
import {applyRouteTrailingSlash, sortConfig} from './routeConfig';
Expand Down Expand Up @@ -147,21 +146,6 @@ export async function loadPlugins(context: LoadContext): Promise<{
}),
);

// 4. Plugin Lifecycle - routesLoaded.
await Promise.all(
loadedPlugins.map(async (plugin) => {
if (!plugin.routesLoaded) {
return;
}

// TODO alpha-60: remove this deprecated lifecycle soon
// 1 user reported usage of this lifecycle: https://github.com/facebook/docusaurus/issues/3918
logger.error`Plugin code=${'routesLoaded'} lifecycle is deprecated. If you think we should keep this lifecycle, please report here: url=${'https://github.com/facebook/docusaurus/issues/3918'}`;

await plugin.routesLoaded(pluginsRouteConfigs);
}),
);

// Sort the route config. This ensures that route with nested
// routes are always placed last.
sortConfig(pluginsRouteConfigs, context.siteConfig.baseUrl);
Expand Down