Repository navigation
refactor: replace httpgd-js with built-in transports - #1855
Conversation
renkun-ken
left a comment
There was a problem hiding this comment.
Found one supported-version compatibility regression to address; see the inline comment.
Validation: TypeScript compilation and all 27 focused HTTP/httpgd/CRAN tests passed. Live WebSocket updates, SVG rendering, and PNG export also worked against R httpgd 2.1.4. A separate fixture using the actual httpgd 1.2.0 renderer schema reproduced the failure in the new client while the existing httpgd-js client loaded both renderers and plots successfully. All reported PR CI checks are green.
| if (!record(renderer) || typeof renderer.id !== 'string' || typeof renderer.name !== 'string' | ||
| || typeof renderer.ext !== 'string' || typeof renderer.descr !== 'string') { | ||
| throw new Error('Invalid httpgd renderer'); |
There was a problem hiding this comment.
[P2] Accept renderer records without descr for httpgd 1.2.0
The extension still supports R httpgd >= 1.2.0, but that version's /renderers response has no descr field. This new check rejects its otherwise valid renderer records. On extension hosts without native WebSocket, connect() consequently never reaches /plots, and every poll fails in loadRenderers() before requesting /state, so the plot viewer never loads. With WebSocket available, plots can recover but the export format picker remains empty. I reproduced this with the 1.2.0 response schema: the new client repeatedly requested only /renderers and retained zero plots, while the existing httpgd-js client loaded both successfully. Please allow an absent description and normalize it to an empty string (with a legacy-schema test), so these supported servers continue working.
|
@renkun-ken Thanks for pointing out the version requirements. |
renkun-ken
left a comment
There was a problem hiding this comment.
The explicit httpgd >= 2.0.1 requirement, backend-selection gate, and standard-viewer fallback address my earlier renderer-schema compatibility finding. I verified that 2.0.1 includes the required renderer description field. The warning gives users an actionable upgrade path when httpgd is explicitly selected, while auto falls back quietly.
No additional actionable issues found in the latest changes. Validation: TypeScript compilation and all 27 focused HTTP/httpgd/CRAN tests passed; the new R version-gate test and related native-plot, plot-notification, and reconnect tests passed with 127 assertions. I also checked backend selection using the real installed httpgd namespace version. All reported PR CI checks are green.
Replace httpgd-js with an in-tree client using Node’s HTTP(S) transport and native WebSocket notifications, with HTTP polling when WebSocket is unavailable or fails.
Set the minimum VS Code version to 1.98.2, following the discussion in #1850.
Preserve the existing viewer, token authentication and binary exports.
Add TODOs for a future Node 22 baseline and viewer unification.