This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// view at: https://stackblitz.com/edit/vitejs-vite-8s3guc?file=src%2FEditor.tsx&terminal=dev | |
import React, { useRef, useEffect } from 'react'; | |
import { EditorView, ViewUpdate } from '@codemirror/view'; | |
import { EditorState, Extension } from '@codemirror/state'; | |
import { basicSetup } from '@codemirror/basic-setup'; | |
import { javascript } from '@codemirror/lang-javascript'; | |
import { oneDark } from '@codemirror/theme-one-dark'; | |
interface EditorProps { | |
value?: string; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Sandbox } from "@vercel/sandbox"; | |
import z from "zod"; | |
import { retryWithBackoff } from "./utils"; | |
import { chromium } from 'playwright' | |
const cdpVersionSchema = z.object({ | |
webSocketDebuggerUrl: z.string(), | |
}); | |
const BROWSERS_DIR = "browsers"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Sandbox } from "@vercel/sandbox"; | |
import z from 'zod'; | |
import { chromium } from 'playwright' | |
export async function retryWithBackoff<T>(fn: () => Promise<T>, retries = 3) { | |
let delay = 1000; | |
for (let i = 0; i < retries; i++) { | |
try { | |
return await fn(); | |
} catch { |