Skip to content

Commit fb9331f

Browse files
JanpotCopilot
authored andcommitted
[code-infra] Migrate everything to getStaticProps (#47152)
1 parent 92defa2 commit fb9331f

File tree

229 files changed

+1373
-915
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+1373
-915
lines changed

docs/pages/experiments/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default function Experiments({ experiments }) {
138138
);
139139
}
140140

141-
Experiments.getInitialProps = () => {
141+
export async function getStaticProps() {
142142
const experiments = [];
143143
const req = require.context('./', true, /^\.\/.*(?<!index)\.(js|tsx)$/);
144144

@@ -147,6 +147,8 @@ Experiments.getInitialProps = () => {
147147
});
148148

149149
return {
150-
experiments,
150+
props: {
151+
experiments,
152+
},
151153
};
152-
};
154+
}

docs/pages/joy-ui/api/accordion-details.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/accordion-details',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/accordion-group.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/accordion-group',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/accordion-summary.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/accordion-summary',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/accordion.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/accordion',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/alert.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context('docs/translations/api-docs-joy/alert', false, /\.\/alert.*.json$/);
1313
const descriptions = mapApiPageTranslations(req);
1414

1515
return {
16-
descriptions,
17-
pageContent: jsonPageContent,
16+
props: {
17+
descriptions,
18+
pageContent: jsonPageContent,
19+
},
1820
};
19-
};
21+
}

docs/pages/joy-ui/api/aspect-ratio.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/aspect-ratio',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/autocomplete-listbox.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/autocomplete-listbox',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/autocomplete-option.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/autocomplete-option',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

docs/pages/joy-ui/api/autocomplete.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default function Page(props) {
88
return <ApiPage descriptions={descriptions} pageContent={pageContent} />;
99
}
1010

11-
Page.getInitialProps = () => {
11+
export async function getStaticProps() {
1212
const req = require.context(
1313
'docs/translations/api-docs-joy/autocomplete',
1414
false,
@@ -17,7 +17,9 @@ Page.getInitialProps = () => {
1717
const descriptions = mapApiPageTranslations(req);
1818

1919
return {
20-
descriptions,
21-
pageContent: jsonPageContent,
20+
props: {
21+
descriptions,
22+
pageContent: jsonPageContent,
23+
},
2224
};
23-
};
25+
}

0 commit comments

Comments
 (0)