Update website API execution endpoints#444
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (11)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThis PR refactors the API request handling by replacing the Changes
Sequence DiagramsequenceDiagram
participant Client
participant Execute as /api/execute Route
participant Handler as goccia-api Handler
participant Loader as Loader Binary
participant Env as Environment
Client->>Execute: POST request with code
Execute->>Handler: handleExecuteRequest(req)
Handler->>Handler: Validate & parse JSON payload
Handler->>Handler: Check code size limits
Handler->>Env: Resolve loader binary path
Handler->>Loader: Spawn process with code via stdin
Loader->>Loader: Execute code
Loader-->>Handler: Return stdout/stderr
Handler->>Handler: Truncate output if needed
Handler->>Handler: Capture PostHog events
Handler-->>Execute: Return structured JSON response
Execute-->>Client: Send response with results
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Suite Timing
Measured on ubuntu-latest x64. |
Benchmark Results386 benchmarks Interpreted: 🟢 40 improved · 🔴 54 regressed · 292 unchanged · avg -0.1% arraybuffer.js — Interp: 🟢 1, 🔴 1, 12 unch. · avg -0.7% · Bytecode: 🔴 9, 5 unch. · avg -7.0%
arrays.js — Interp: 🔴 4, 15 unch. · avg -1.4% · Bytecode: 🔴 17, 2 unch. · avg -9.7%
async-await.js — Interp: 6 unch. · avg +0.5% · Bytecode: 🔴 5, 1 unch. · avg -13.4%
base64.js — Interp: 10 unch. · avg -0.2% · Bytecode: 🔴 9, 1 unch. · avg -9.6%
classes.js — Interp: 🔴 1, 30 unch. · avg -0.4% · Bytecode: 🔴 22, 9 unch. · avg -5.9%
closures.js — Interp: 🔴 1, 10 unch. · avg -0.2% · Bytecode: 🔴 10, 1 unch. · avg -8.2%
collections.js — Interp: 🔴 1, 11 unch. · avg +0.0% · Bytecode: 🔴 12 · avg -9.6%
csv.js — Interp: 🔴 1, 12 unch. · avg -1.1% · Bytecode: 🔴 13 · avg -9.5%
destructuring.js — Interp: 🟢 1, 21 unch. · avg +0.6% · Bytecode: 🔴 22 · avg -7.8%
fibonacci.js — Interp: 8 unch. · avg -0.1% · Bytecode: 🔴 8 · avg -10.6%
float16array.js — Interp: 🟢 2, 🔴 6, 24 unch. · avg -1.0% · Bytecode: 🟢 4, 🔴 23, 5 unch. · avg -3.0%
for-of.js — Interp: 🔴 1, 6 unch. · avg -0.8% · Bytecode: 🔴 7 · avg -12.1%
helpers/bench-module.js — Interp: 0 · Bytecode: 0
iterators.js — Interp: 🟢 5, 🔴 1, 36 unch. · avg +0.7% · Bytecode: 🔴 39, 3 unch. · avg -7.7%
json.js — Interp: 🟢 4, 🔴 1, 15 unch. · avg +2.0% · Bytecode: 🔴 20 · avg -9.5%
jsx.jsx — Interp: 🟢 1, 🔴 6, 14 unch. · avg -1.3% · Bytecode: 🔴 21 · avg -8.8%
modules.js — Interp: 9 unch. · avg -0.9% · Bytecode: 🔴 9 · avg -12.3%
numbers.js — Interp: 🔴 2, 9 unch. · avg -2.5% · Bytecode: 🔴 11 · avg -8.0%
objects.js — Interp: 🟢 6, 1 unch. · avg +3.5% · Bytecode: 🔴 7 · avg -7.8%
promises.js — Interp: 🟢 1, 🔴 2, 9 unch. · avg +0.7% · Bytecode: 🔴 12 · avg -13.6%
regexp.js — Interp: 🟢 1, 🔴 1, 9 unch. · avg +0.5% · Bytecode: 🔴 11 · avg -7.5%
strings.js — Interp: 🟢 14, 5 unch. · avg +17.9% · Bytecode: 🔴 18, 1 unch. · avg -7.7%
tsv.js — Interp: 🟢 1, 🔴 1, 7 unch. · avg -0.2% · Bytecode: 🔴 9 · avg -5.4%
typed-arrays.js — Interp: 🟢 1, 🔴 16, 5 unch. · avg -2.8% · Bytecode: 🟢 6, 🔴 13, 3 unch. · avg -1.8%
uint8array-encoding.js — Interp: 🟢 2, 🔴 8, 8 unch. · avg -15.6% · Bytecode: 🟢 4, 🔴 10, 4 unch. · avg -8.0%
Measured on ubuntu-latest x64. Benchmark ranges compare cached main-branch min/max ops/sec with the PR run; overlapping ranges are treated as unchanged noise. Percentage deltas are secondary context. |
Summary
/api/runto/api/executeand update callers, tracing, and deploy config./api/test, backed byGocciaTestRunner, with the same request limits, rate limiting, spawn handling, telemetry, and output caps as execution.Testing
bunx biome check next.config.ts vercel.ts scripts/fetch-nightly-binary.mjs src/app/api/execute/route.ts src/app/api/test/route.ts src/components/landing.tsx src/components/playground.tsx src/components/sandbox.tsx src/lib/goccia-api.ts src/lib/posthog-server.tsbunx tsc --noEmitbun test./build.pas loader testrunnerSKIP_VENDOR_FETCH=1 bun run build/api/executeand/api/test