Skip to content

Feature/playground example#1115

Merged
gangtao merged 11 commits intodevelopfrom
feature/playground-example
Mar 4, 2026
Merged

Feature/playground example#1115
gangtao merged 11 commits intodevelopfrom
feature/playground-example

Conversation

@gangtao
Copy link
Copy Markdown
Contributor

@gangtao gangtao commented Feb 25, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a self-contained “Proton Query Playground” example that serves a static HTML UI and proxies browser requests to a local Proton instance, enabling streaming query + visualization without a frontend build step.

Changes:

  • Introduce a Node/TypeScript static server + Proton proxy (server.ts) with /api/config and /api/ping.
  • Add a single-file HTML playground UI (index.html) using UMD builds of @timeplus/proton-javascript-driver and @timeplus/vistral.
  • Add example-local Node tooling (package.json / lockfile) and usage docs (README.md).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
examples/playground/server.ts Implements the static file server + Proton reverse proxy and small JSON APIs for UI configuration/ping.
examples/playground/index.html Provides the browser UI for running queries and visualizing streaming results.
examples/playground/package.json Adds example-local scripts to run/build the TypeScript server.
examples/playground/package-lock.json Locks dev-tooling dependencies for the playground server.
examples/playground/README.md Documents architecture, setup steps, and environment variables for the playground.
Files not reviewed (1)
  • examples/playground/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

gangtao and others added 7 commits February 25, 2026 11:47
Copy link
Copy Markdown
Collaborator

@yokofly yokofly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — examples/playground/

Reviewed the full PR diff (6 original files + 2 follow-up fix commits). Overall this is a solid, self-contained example.

What's good

  • Zero impact on core engine — all changes are net-new files under examples/playground/, no modifications to any existing code.
  • Clean architecture — proxy-based design avoids CORS issues; single server.ts handles static serving + Proton forwarding.
  • Security hardening — path traversal protection, 10MB body size limit, 127.0.0.1 binding, scoped CORS origin, escapeHTML() for user-controlled output, password field masked, no credential leakage in /api/config.
  • Good README — architecture diagram, quick-start steps, env var table, example queries.
  • Copilot review feedback addressed — 10 of 12 automated review comments were resolved in follow-up commits (unbounded rawLines, password field, STATIC_ROOT, body size limit, pinned CDN versions, unused import, CORS/binding, credential exposure, server URL consistency).
  • All CDN dependencies pinned to specific versions (React 18.3.1, lodash 4.17.21, vistral 0.1.4, proton-driver 0.1.3, etc.).

Fixes applied (2 commits)

  1. ts-nodetsxts-node does not support ESM on Node 22+ (ERR_UNKNOWN_FILE_EXTENSION). Replaced with tsx which handles "type": "module" natively. Verified server starts successfully.
  2. .gitignore + trailing newlines — added .gitignore for node_modules/ and dist/; fixed missing final newlines in package.json, index.html, server.ts.

Minor note (not blocking)

  • server.ts line 15 still says npx ts-node server.ts in the doc comment — should be npx tsx server.ts. Trivial, can be fixed in a follow-up.

LGTM — approving.

@gangtao gangtao merged commit 9792deb into develop Mar 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants