refactor: remove long-deprecated routesLoaded lifecycle (#7257)
This commit is contained in:
parent
51815c12c9
commit
b1cafe73df
|
|
@ -505,7 +505,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;
|
||||
|
|
|
|||
|
|
@ -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';
|
||||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue