Skip to content

Commit 1eaf7bb

Browse files
Merge branch 'production' into patricia/pcx14461-session-id-req
2 parents 0a55e9f + 3f507f2 commit 1eaf7bb

File tree

74 files changed

+675
-365
lines changed

Some content is hidden

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

74 files changed

+675
-365
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
# Browser Rendering API
4343

44-
/src/content/docs/browser-rendering/ @mchenco @cloudflare/pcx-technical-writing @celso @meddulla
44+
/src/content/docs/browser-rendering/ @mchenco @cloudflare/pcx-technical-writing @celso @meddulla @danielgek
4545

4646
# Changelogs
4747

astro.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ import starlightLinksValidator from "starlight-links-validator";
88
import icon from "astro-icon";
99
import sitemap from "@astrojs/sitemap";
1010
import react from "@astrojs/react";
11+
1112
import { readdir } from "fs/promises";
13+
import { fileURLToPath } from "url";
1214

1315
import rehypeTitleFigure from "rehype-title-figure";
1416
import rehypeMermaid from "./src/plugins/rehype/mermaid.ts";
1517
import rehypeAutolinkHeadings from "./src/plugins/rehype/autolink-headings.ts";
1618
import rehypeExternalLinks from "./src/plugins/rehype/external-links.ts";
1719
import rehypeHeadingSlugs from "./src/plugins/rehype/heading-slugs.ts";
18-
import { fileURLToPath } from "url";
1920

2021
async function autogenSections() {
2122
const sections = (

package-lock.json

Lines changed: 141 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,19 @@
4343
"@stoplight/json-schema-tree": "4.0.0",
4444
"@types/hast": "3.0.4",
4545
"@types/he": "1.2.3",
46-
"@types/node": "22.12.0",
46+
"@types/node": "22.13.1",
4747
"@types/react": "19.0.7",
4848
"@types/react-dom": "19.0.3",
49-
"@typescript-eslint/parser": "8.21.0",
50-
"algoliasearch": "5.19.0",
49+
"@typescript-eslint/parser": "8.23.0",
50+
"algoliasearch": "5.20.1",
5151
"astro": "5.2.1",
5252
"astro-breadcrumbs": "3.3.1",
5353
"astro-icon": "1.1.5",
5454
"astro-live-code": "0.0.5",
5555
"codeowners-utils": "1.0.2",
5656
"date-fns": "4.1.0",
5757
"dedent": "1.5.3",
58-
"dompurify": "3.2.3",
58+
"dompurify": "3.2.4",
5959
"dot-prop": "9.0.0",
6060
"eslint": "9.18.0",
6161
"eslint-plugin-astro": "1.3.1",
@@ -94,7 +94,7 @@
9494
"solarflare-theme": "0.0.2",
9595
"starlight-image-zoom": "0.10.1",
9696
"starlight-links-validator": "0.14.2",
97-
"starlight-package-managers": "0.9.0",
97+
"starlight-package-managers": "0.10.0",
9898
"strip-markdown": "6.0.0",
9999
"svgo": "3.3.2",
100100
"tailwindcss": "3.4.17",

public/changelog-preview.png

249 KB
Loading

public/core-services-preview.png

325 KB
Loading

public/dev-products-preview.png

116 KB
Loading

public/zt-preview.png

129 KB
Loading

src/components/PublicStats.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { zodEnumFromObjKeys } from "~/util/helpers";
55
type Props = z.infer<typeof props>;
66
77
const mappings = {
8-
data_center_cities: "over 330 cities",
9-
total_bandwidth: "over 321 Tbps network capacity",
8+
data_center_cities: "over 335 cities",
9+
total_bandwidth: "over 348 Tbps network capacity",
1010
network_peers: "over 13,000 network peers",
1111
} as const satisfies Record<string, string>;
1212

src/components/Render.astro

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,49 @@ const props = z.object({
1313
let { file, product, params } = props.parse(Astro.props);
1414
1515
if (!product) {
16-
product = Astro.params.slug?.split("/")[0];
17-
}
16+
const fromSlug = Astro.params.slug?.split("/")[0];
1817
19-
if (!product) {
20-
throw new Error(
21-
`[Render] Unable to infer which folder ${file} is in, please provide a "product" input with your "file" input.`,
22-
);
18+
if (!fromSlug) {
19+
throw new Error(
20+
`[Render] Unable to infer which folder ${file} is in, please provide a "product" input with your "file" input.`,
21+
);
22+
}
23+
24+
product = fromSlug;
2325
}
2426
25-
const partial = await getEntry("partials", `${product}/${file}`);
27+
const id = `${product}/${file}`;
28+
const partial = await getEntry("partials", id);
2629
2730
if (!partial) {
2831
throw new Error(
29-
`[Render] Couldn't find partial: ${file}. Included on ${Astro.params.slug}`,
32+
`[Render] Couldn't find "${id}" included on "${Astro.url.pathname}"`,
3033
);
3134
}
3235
36+
// We currently only enforce parameters if `params` is set in the frontmatter,
37+
// until we can migrate existing `inputParameters` frontmatter to `params`.
3338
if (partial.data.params) {
34-
const expected = partial.data.params;
35-
if (!params)
39+
const expected = partial.data.params.sort();
40+
const optional = expected.filter((p) => p.endsWith("?"));
41+
const received = Object.keys(params ?? {}).sort();
42+
43+
const maximum = expected.length;
44+
const minimum = maximum - optional.length;
45+
46+
if (
47+
received.length < minimum ||
48+
received.length > maximum ||
49+
expected.some((p: string) => {
50+
if (p.endsWith("?")) return false;
51+
52+
return !received.includes(p);
53+
})
54+
) {
3655
throw new Error(
37-
`${file} included on ${Astro.params.slug} expected parameters: ${expected}, got none`,
56+
`[Render] Expected parameters ${JSON.stringify(expected)} but received parameters ${JSON.stringify(received)} for "${file}" included on "${Astro.url.pathname}"`,
3857
);
58+
}
3959
}
4060
4161
const { Content } = await render(partial);

0 commit comments

Comments
 (0)