Skip to content

Commit

Permalink
Fix weird TS compilation issue
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 2, 2024
1 parent 170e321 commit 77fa391
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/docusaurus/src/client/serverEntry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
createStatefulBrokenLinks,
BrokenLinksProvider,
} from './BrokenLinksContext';
import type {PageCollectedData, AppRenderer} from '../types';
import type {PageCollectedData, AppRenderer} from '../common';

function buildSSRErrorMessage({
error,
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import defaultSSRTemplate from '../templates/ssr.html.template';

import type {Manifest} from 'react-loadable-ssr-addon-v5-slorber';
import type {LoadedPlugin, Props} from '@docusaurus/types';
import type {SiteCollectedData} from '../types';
import type {SiteCollectedData} from '../common';

export type BuildCLIOptions = Pick<
LoadContextOptions,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,10 @@
* LICENSE file in the root directory of this source tree.
*/

import type {HelmetServerState} from 'react-helmet-async';
import type {Manifest} from 'react-loadable-ssr-addon-v5-slorber';
import type {SSRTemplateCompiled} from './templates/templates';
// This file is for types that are common between client/server
// In particular the interface between SSG and serverEntry code

export type SSGParams = {
trailingSlash: boolean | undefined;
manifest: Manifest;
headTags: string;
preBodyTags: string;
postBodyTags: string;
outDir: string;
baseUrl: string;
noIndex: boolean;
DOCUSAURUS_VERSION: string;
ssrTemplate: SSRTemplateCompiled;
};
import type {HelmetServerState} from 'react-helmet-async';

export type AppRenderResult = {
html: string;
Expand Down
23 changes: 17 additions & 6 deletions packages/docusaurus/src/ssg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,23 @@ import pMap from 'p-map';
import {minify} from 'html-minifier-terser';
import {PerfLogger} from './utils';
import {renderSSRTemplate} from './templates/templates';
import type {
AppRenderer,
AppRenderResult,
SiteCollectedData,
SSGParams,
} from './types';
import type {AppRenderer, AppRenderResult, SiteCollectedData} from './common';

import type {Manifest} from 'react-loadable-ssr-addon-v5-slorber';
import type {SSRTemplateCompiled} from './templates/templates';

export type SSGParams = {
trailingSlash: boolean | undefined;
manifest: Manifest;
headTags: string;
preBodyTags: string;
postBodyTags: string;
outDir: string;
baseUrl: string;
noIndex: boolean;
DOCUSAURUS_VERSION: string;
ssrTemplate: SSRTemplateCompiled;
};

// Secret way to set SSR plugin concurrency option
// Waiting for feedback before documenting this officially?
Expand Down
3 changes: 2 additions & 1 deletion packages/docusaurus/src/templates/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

import * as eta from 'eta';
import {getBundles} from 'react-loadable-ssr-addon-v5-slorber';
import type {SSGParams, AppRenderResult} from '../types';
import type {SSGParams} from '../ssg';
import type {AppRenderResult} from '../common';
import type {Manifest} from 'react-loadable-ssr-addon-v5-slorber';

// TODO this is historical server template data
Expand Down

0 comments on commit 77fa391

Please sign in to comment.