🎥 Make videos programmatically with React
bugs: main page and add some real bugs
Jonny Burger075e01d50b28
diff --git a/packages/bugs/api/[v].ts b/packages/bugs/api/[v].tsindex 7f0f1dc662..d1db3691d8 100644--- a/packages/bugs/api/[v].ts+++ b/packages/bugs/api/[v].ts@@ -1,19 +1,46 @@+type Bug = {+ title: string;+ description: string;+ link: string;+ versions: string[];+};++const bugs: Bug[] = [+ {+ title: "OffthreadVideo could crash",+ description:+ "On some videos, OffthreadVideo could crash without proper error handling.",+ link: "https://github.com/remotion-dev/remotion/pull/2882",+ versions: ["4.0.36", "4.0.37", "4.0.38"],+ },+ {+ title: "Slow OffthreadVideo performance",+ description:+ "Without an explicit cache size, the OffthreadVideo component would run with no cache.",+ link: "https://github.com/remotion-dev/remotion/pull/2882",+ versions: ["4.0.33", "4.0.34", "4.0.35", "4.0.36"],+ },+];++const getVersionBugs = (version: string) => {+ const selectedVersionBugs = bugs.filter((bug) => {+ return bug.versions.includes(version);+ });+ return selectedVersionBugs;+};+export default async function handler(request: Request) {const urlParams = new URL(request.url).searchParams;+const query = Object.fromEntries(urlParams);- const cookies = request.headers.get("cookie");- let body;- try {- body = await request.json();- } catch (e) {- body = null;- }+ const v = query["v"].replace("v", "") as string;++ const bugs = getVersionBugs(v);return new Response(JSON.stringify({- body,- query,- cookies,+ version: v,+ bugs,}),{status: 200,diff --git a/packages/bugs/api/index.ts b/packages/bugs/api/index.tsindex 0dcc78aae6..fda3014ac1 100644--- a/packages/bugs/api/index.ts+++ b/packages/bugs/api/index.ts@@ -1,6 +1,6 @@-export default async function handler(request: Request) {+export default async function handler() {return new Response(- `<h1>Remotion Bugs</h1><p>Add a version to query bugs, e.g <a href="https://bugs.remotion.dev/v4.0.33"></a></p>`,+ `<h1>Remotion Bugs</h1><p>Add a version to query bugs, e.g <a href="https://bugs.remotion.dev/v4.0.36">https://bugs.remotion.dev/v4.0.36</a></p>`,{status: 200,headers: {