Skip to content

Commit

Permalink
chore: update stencil version, fix breaks, enable prerendering
Browse files Browse the repository at this point in the history
  • Loading branch information
harrysolovay committed Mar 19, 2020
1 parent bc5834b commit 0d8a0ec
Show file tree
Hide file tree
Showing 23 changed files with 1,707 additions and 1,375 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"watch": "multiline"
}
],
"@stencil/element-type": 2,
"@stencil/element-type": 0,
"@stencil/host-data-deprecated": 2,
"@stencil/methods-must-be-public": 2,
"@stencil/no-unused-watch": 2,
Expand Down
2 changes: 1 addition & 1 deletion capi/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"fast-glob": "^3.1.1",
"front-matter": "^3.1.0",
"fs-extra": "^8.1.0",
"marked": "^0.8.0",
"marked": "0.8.0",
"parse5": "^5.1.1",
"prismjs": "^1.19.0",
"traverse": "^0.6.6",
Expand Down
13 changes: 9 additions & 4 deletions capi/src/write/get-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export async function getPage(config: t.Config, ctx: t.Ctx): Promise<void> {
.writeLine(`import * as t from "./types";`)
.blankLine()
.writeLine(
"export async function getPage(route: string): Promise<t.Page> {",
"export function getPage(route: string): Promise<t.Page> | undefined {",
)
.writeLine(` return (() => {`)
.writeLine(" switch(route) {");
.writeLine(` const pending = (() => {`)
.writeLine(" switch (route) {");

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

writer
.writeLine(" }")
.writeLine(` })().then((response) => response.json());`)
.writeLine(` })();`)
.writeLine(` return pending`)
.writeLine(
` ? pending.then((response) => response.json()) as Promise<t.Page>`,
)
.writeLine(` : undefined;`)
.writeLine("}");
},
{overwrite: true},
Expand Down
2 changes: 1 addition & 1 deletion capi/src/write/stencil-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function stencilRenderer(config: t.Config): Promise<void> {
*/
import {h} from "@stencil/core";
import {VNode} from "@stencil/core/dist/declarations";
import {VNode} from "@stencil/core";
import {OrText, HyperscriptNode, Props} from "./types";
export type HyperscriptResult = OrText<VNode>;
Expand Down
1 change: 1 addition & 0 deletions client/src/amplify-ui/responsive-grid/responsive-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export class AmplifyResponsiveGrid {

@State() computedStyle?: string;

// @ts-ignore
@Watch("columnCountByBreakpoint")
computeStyle() {
this.computedStyle = cx(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export class AmplifySidebarLayoutSidebar {
ref?: HTMLElement | null;
setRef = (ref: HTMLElement | null) => (this.ref = ref);

// @ts-ignore
@Listen("mousedown", {target: "window"})
// @ts-ignore
@Listen("touchstart", {target: "window"})
clickListener(e: Event) {
if (this.inView) {
Expand Down
2 changes: 1 addition & 1 deletion client/src/amplify-ui/toc/toc-content/toc-content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {SetContent} from "../toc.types";

@Component({tag: "amplify-toc-contents", shadow: false})
export class AmplifyTOCContent {
@Element() content?: HTMLAmplifyTocContentsElement;
@Element() content?: HTMLElement;
/**
* Sets `content` prop within parent `amplify-toc-provider`,
* which propogates into the provider's child `amplify-toc` instances
Expand Down
1 change: 1 addition & 0 deletions client/src/amplify-ui/toc/toc-provider/toc-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export class AmplifyTOCProvider {
this.content.querySelectorAll("h2, h3"),
).filter((e) => headingIsVisible(e)) as HTMLElement[]);

// @ts-ignore
@Watch("content")
bindToContent() {
this.setElements();
Expand Down
2 changes: 2 additions & 0 deletions client/src/amplify-ui/toc/toc/toc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export class AmplifyTOC {
@State() activeLinkI?: number;
previous?: number;

// @ts-ignore
@Listen("scroll", {target: "window"})
// @ts-ignore
@Listen("resize", {target: "window"})
setActiveLink() {
if (this.elements) {
Expand Down
Loading

0 comments on commit 0d8a0ec

Please sign in to comment.