Skip to content

Commit 0d8a0ec

Browse files
committed
chore: update stencil version, fix breaks, enable prerendering
1 parent bc5834b commit 0d8a0ec

File tree

23 files changed

+1707
-1375
lines changed

23 files changed

+1707
-1375
lines changed

.eslintrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"watch": "multiline"
3939
}
4040
],
41-
"@stencil/element-type": 2,
41+
"@stencil/element-type": 0,
4242
"@stencil/host-data-deprecated": 2,
4343
"@stencil/methods-must-be-public": 2,
4444
"@stencil/no-unused-watch": 2,

capi/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"fast-glob": "^3.1.1",
1313
"front-matter": "^3.1.0",
1414
"fs-extra": "^8.1.0",
15-
"marked": "^0.8.0",
15+
"marked": "0.8.0",
1616
"parse5": "^5.1.1",
1717
"prismjs": "^1.19.0",
1818
"traverse": "^0.6.6",

capi/src/write/get-page.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export async function getPage(config: t.Config, ctx: t.Ctx): Promise<void> {
1919
.writeLine(`import * as t from "./types";`)
2020
.blankLine()
2121
.writeLine(
22-
"export async function getPage(route: string): Promise<t.Page> {",
22+
"export function getPage(route: string): Promise<t.Page> | undefined {",
2323
)
24-
.writeLine(` return (() => {`)
25-
.writeLine(" switch(route) {");
24+
.writeLine(` const pending = (() => {`)
25+
.writeLine(" switch (route) {");
2626

2727
for (const [srcPath, pathDeduction] of ctx.pathDeductionBySrcPath) {
2828
if (pathDeduction.route) {
@@ -39,7 +39,12 @@ export async function getPage(config: t.Config, ctx: t.Ctx): Promise<void> {
3939

4040
writer
4141
.writeLine(" }")
42-
.writeLine(` })().then((response) => response.json());`)
42+
.writeLine(` })();`)
43+
.writeLine(` return pending`)
44+
.writeLine(
45+
` ? pending.then((response) => response.json()) as Promise<t.Page>`,
46+
)
47+
.writeLine(` : undefined;`)
4348
.writeLine("}");
4449
},
4550
{overwrite: true},

capi/src/write/stencil-renderer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function stencilRenderer(config: t.Config): Promise<void> {
1212
*/
1313
1414
import {h} from "@stencil/core";
15-
import {VNode} from "@stencil/core/dist/declarations";
15+
import {VNode} from "@stencil/core";
1616
import {OrText, HyperscriptNode, Props} from "./types";
1717
1818
export type HyperscriptResult = OrText<VNode>;

client/src/amplify-ui/responsive-grid/responsive-grid.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export class AmplifyResponsiveGrid {
1717

1818
@State() computedStyle?: string;
1919

20+
// @ts-ignore
2021
@Watch("columnCountByBreakpoint")
2122
computeStyle() {
2223
this.computedStyle = cx(

client/src/amplify-ui/sidebar-layout/sidebar-layout-sidebar/sidebar-layout-sidebar.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export class AmplifySidebarLayoutSidebar {
1515
ref?: HTMLElement | null;
1616
setRef = (ref: HTMLElement | null) => (this.ref = ref);
1717

18+
// @ts-ignore
1819
@Listen("mousedown", {target: "window"})
20+
// @ts-ignore
1921
@Listen("touchstart", {target: "window"})
2022
clickListener(e: Event) {
2123
if (this.inView) {

client/src/amplify-ui/toc/toc-content/toc-content.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {SetContent} from "../toc.types";
44

55
@Component({tag: "amplify-toc-contents", shadow: false})
66
export class AmplifyTOCContent {
7-
@Element() content?: HTMLAmplifyTocContentsElement;
7+
@Element() content?: HTMLElement;
88
/**
99
* Sets `content` prop within parent `amplify-toc-provider`,
1010
* which propogates into the provider's child `amplify-toc` instances

client/src/amplify-ui/toc/toc-provider/toc-provider.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export class AmplifyTOCProvider {
2020
this.content.querySelectorAll("h2, h3"),
2121
).filter((e) => headingIsVisible(e)) as HTMLElement[]);
2222

23+
// @ts-ignore
2324
@Watch("content")
2425
bindToContent() {
2526
this.setElements();

client/src/amplify-ui/toc/toc/toc.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export class AmplifyTOC {
2424
@State() activeLinkI?: number;
2525
previous?: number;
2626

27+
// @ts-ignore
2728
@Listen("scroll", {target: "window"})
29+
// @ts-ignore
2830
@Listen("resize", {target: "window"})
2931
setActiveLink() {
3032
if (this.elements) {

0 commit comments

Comments
 (0)