Merge pull request #16506 from backstage/blam/fix-ms2

microsite/next: Build speed improvements
This commit is contained in:
Johan Haals
2023-02-22 09:54:44 +01:00
committed by GitHub
7 changed files with 155 additions and 8 deletions
+1
View File
@@ -15,6 +15,7 @@ jobs:
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
DOCUSAURUS_SSR_CONCURRENCY: 5
steps:
- uses: actions/checkout@v3
@@ -17,6 +17,7 @@ jobs:
env:
CI: true
NODE_OPTIONS: --max-old-space-size=4096
DOCUSAURUS_SSR_CONCURRENCY: 5
steps:
- uses: actions/checkout@v3
@@ -28,10 +29,16 @@ jobs:
# Skip caching of microsite dependencies, it keeps the global cache size
# smaller, which make Windows builds a lot faster for the rest of the project.
- name: top-level install
run: yarn install --immutable
- name: yarn install
run: yarn install --immutable
working-directory: microsite-next
- name: build API reference
run: yarn build:api-docs
- name: verify yarn dependency duplicates
run: node scripts/verify-lockfile-duplicates.js
+17 -2
View File
@@ -47,8 +47,6 @@ module.exports = {
/** @type {import('@docusaurus/preset-classic').Options} */
{
docs: {
showLastUpdateAuthor: true,
showLastUpdateTime: true,
editUrl: 'https://github.com/backstage/backstage/edit/master/docs/',
path: '../docs',
sidebarPath: 'sidebars.json',
@@ -65,6 +63,23 @@ module.exports = {
},
],
],
webpack: {
jsLoader: isServer => ({
loader: require.resolve('swc-loader'),
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
target: 'es2017',
},
module: {
type: isServer ? 'commonjs' : 'es6',
},
},
}),
},
plugins: [
'docusaurus-plugin-sass',
() => ({
+3 -1
View File
@@ -31,10 +31,12 @@
"dependencies": {
"@docusaurus/core": "2.3.1",
"@docusaurus/preset-classic": "2.3.1",
"@swc/core": "^1.3.36",
"clsx": "^1.1.1",
"docusaurus-plugin-sass": "^0.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"sass": "^1.57.1"
"sass": "^1.57.1",
"swc-loader": "^0.2.3"
}
}
@@ -6,7 +6,6 @@ import bannerGridStyles from './bannerSectionGrid.module.scss';
export type IBannerSectionColumnsProps = PropsWithChildren<{
header?: ReactNode;
className?: string;
// children: ReactNode | ReactNode[];
}>;
export const BannerSectionGrid = ({
@@ -14,8 +13,6 @@ export const BannerSectionGrid = ({
children,
className,
}: IBannerSectionColumnsProps) => {
console.log('Header: ', header);
return (
<div className={clsx(bannerGridStyles.sectionGridContainer, className)}>
{header && <div className="gridHeader">{header}</div>}
+121
View File
@@ -2603,6 +2603,115 @@ __metadata:
languageName: node
linkType: hard
"@swc/core-darwin-arm64@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-darwin-arm64@npm:1.3.36"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@swc/core-darwin-x64@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-darwin-x64@npm:1.3.36"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@swc/core-linux-arm-gnueabihf@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-linux-arm-gnueabihf@npm:1.3.36"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@swc/core-linux-arm64-gnu@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-linux-arm64-gnu@npm:1.3.36"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-arm64-musl@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-linux-arm64-musl@npm:1.3.36"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@swc/core-linux-x64-gnu@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-linux-x64-gnu@npm:1.3.36"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@swc/core-linux-x64-musl@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-linux-x64-musl@npm:1.3.36"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@swc/core-win32-arm64-msvc@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-win32-arm64-msvc@npm:1.3.36"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@swc/core-win32-ia32-msvc@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-win32-ia32-msvc@npm:1.3.36"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@swc/core-win32-x64-msvc@npm:1.3.36":
version: 1.3.36
resolution: "@swc/core-win32-x64-msvc@npm:1.3.36"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
"@swc/core@npm:^1.3.36":
version: 1.3.36
resolution: "@swc/core@npm:1.3.36"
dependencies:
"@swc/core-darwin-arm64": 1.3.36
"@swc/core-darwin-x64": 1.3.36
"@swc/core-linux-arm-gnueabihf": 1.3.36
"@swc/core-linux-arm64-gnu": 1.3.36
"@swc/core-linux-arm64-musl": 1.3.36
"@swc/core-linux-x64-gnu": 1.3.36
"@swc/core-linux-x64-musl": 1.3.36
"@swc/core-win32-arm64-msvc": 1.3.36
"@swc/core-win32-ia32-msvc": 1.3.36
"@swc/core-win32-x64-msvc": 1.3.36
dependenciesMeta:
"@swc/core-darwin-arm64":
optional: true
"@swc/core-darwin-x64":
optional: true
"@swc/core-linux-arm-gnueabihf":
optional: true
"@swc/core-linux-arm64-gnu":
optional: true
"@swc/core-linux-arm64-musl":
optional: true
"@swc/core-linux-x64-gnu":
optional: true
"@swc/core-linux-x64-musl":
optional: true
"@swc/core-win32-arm64-msvc":
optional: true
"@swc/core-win32-ia32-msvc":
optional: true
"@swc/core-win32-x64-msvc":
optional: true
checksum: 36e96e86d1ab8fd84eb51e7264a7ae781ee7e507d36b9ccc028d7f31a2ccf2949f074656e34139c970196774d24d55a54c3aa5c53d04eb6e3569c71cbfed0c0d
languageName: node
linkType: hard
"@szmarczak/http-timer@npm:^1.1.2":
version: 1.1.2
resolution: "@szmarczak/http-timer@npm:1.1.2"
@@ -3601,6 +3710,7 @@ __metadata:
"@docusaurus/module-type-aliases": 2.3.1
"@docusaurus/preset-classic": 2.3.1
"@spotify/prettier-config": ^14.0.0
"@swc/core": ^1.3.36
"@tsconfig/docusaurus": ^1.0.6
"@types/webpack-env": ^1.18.0
clsx: ^1.1.1
@@ -3611,6 +3721,7 @@ __metadata:
react-dom: ^17.0.2
replace: ^1.2.2
sass: ^1.57.1
swc-loader: ^0.2.3
typescript: ^4.9.4
yaml-loader: ^0.8.0
languageName: unknown
@@ -9998,6 +10109,16 @@ __metadata:
languageName: node
linkType: hard
"swc-loader@npm:^0.2.3":
version: 0.2.3
resolution: "swc-loader@npm:0.2.3"
peerDependencies:
"@swc/core": ^1.2.147
webpack: ">=2"
checksum: 010d84d399525c0185d36d62c86c55ae017e7a90046bc8a39be4b7e07526924037868049f6037bc966da98151cb2600934b96a66279b742d3c413a718b427251
languageName: node
linkType: hard
"tapable@npm:^1.0.0":
version: 1.1.3
resolution: "tapable@npm:1.1.3"
@@ -91,6 +91,10 @@ export class TestApiRegistry implements ApiHolder {
* It lets you provide any number of API implementations, without necessarily
* having to fully implement each of the APIs.
*
* @remarks
* todo: remove this remark tag and ship in the api-reference. There's some odd formatting going on when this is made into a markdown doc, that there's no line break between
* the emmited <p> for To the following </p> so what happens is that when parsing in docusaurus, it thinks that the code block is mdx rather than a code
* snippet. Just ommiting this from the report for now until we can work out how to fix laterr.
* A migration from `ApiRegistry` and `ApiProvider` might look like this, from:
*
* ```tsx
@@ -100,7 +104,7 @@ export class TestApiRegistry implements ApiHolder {
* [identityApiRef, mockIdentityApi as unknown as IdentityApi]
* ])}
* >
* // ...
* ...
* </ApiProvider>
* )
* ```
@@ -110,7 +114,7 @@ export class TestApiRegistry implements ApiHolder {
* ```tsx
* renderInTestApp(
* <TestApiProvider apis={[[identityApiRef, mockIdentityApi]]}>
* // ...
* ...
* </TestApiProvider>
* )
* ```