Skip to content

Commit

Permalink
refactor: remove long-deprecated routesLoaded lifecycle
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena committed Apr 28, 2022
1 parent b747143 commit c313363
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
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

0 comments on commit c313363

Please sign in to comment.