From b070c28f97d29e51e35cf0ede2c472b76f760d28 Mon Sep 17 00:00:00 2001 From: Kun Ren Date: Mon, 26 Oct 2026 20:23:27 +0800 Subject: [PATCH 1/2] fix: restore httpgd plot and local help rendering with EJS 7 (#1911) * fix: restore viewer rendering with EJS 7 * build: fail non-watch builds on all esbuild warnings --- esbuild.js | 24 ++++++++++-------------- src/helpViewer/helpPreviewer.ts | 2 +- src/plotViewer/httpgdViewer.ts | 2 +- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/esbuild.js b/esbuild.js index 5bdef1db0..4b7efbf50 100644 --- a/esbuild.js +++ b/esbuild.js @@ -115,23 +115,19 @@ async function main() { logLevel: 'info', }); + const contexts = [extensionCtx, agentCtx, interactiveRendererCtx, webviewCtx]; if (watch) { - await Promise.all([ - extensionCtx.watch(), - agentCtx.watch(), - interactiveRendererCtx.watch(), - webviewCtx.watch() - ]); + await Promise.all(contexts.map(context => context.watch())); console.log('Watching for changes...'); } else { - await extensionCtx.rebuild(); - await agentCtx.rebuild(); - await interactiveRendererCtx.rebuild(); - await webviewCtx.rebuild(); - await extensionCtx.dispose(); - await agentCtx.dispose(); - await interactiveRendererCtx.dispose(); - await webviewCtx.dispose(); + try { + const results = await Promise.all(contexts.map(context => context.rebuild())); + if (results.some(result => result.warnings.length > 0)) { + throw new Error('Build failed because esbuild reported warnings.'); + } + } finally { + await Promise.all(contexts.map(context => context.dispose())); + } } } diff --git a/src/helpViewer/helpPreviewer.ts b/src/helpViewer/helpPreviewer.ts index 462f1f990..c8d53cd69 100644 --- a/src/helpViewer/helpPreviewer.ts +++ b/src/helpViewer/helpPreviewer.ts @@ -2,7 +2,7 @@ import * as path from 'path'; import * as fs from 'fs'; import * as vscode from 'vscode'; import * as rHelp from './index'; -import * as ejs from 'ejs'; +import ejs from 'ejs'; import { isDirSafe, isFileSafe, readFileSyncSafe, config, spawnAsync } from '../util'; import { Topic, TopicType } from './packages'; diff --git a/src/plotViewer/httpgdViewer.ts b/src/plotViewer/httpgdViewer.ts index 2e28d4f32..257ac279d 100644 --- a/src/plotViewer/httpgdViewer.ts +++ b/src/plotViewer/httpgdViewer.ts @@ -3,7 +3,7 @@ import { HttpgdClient, HttpgdIdResponse, HttpgdPlotId, HttpgdRendererId } from ' import { HttpgdPlot, IHttpgdViewer, HttpgdViewerOptions } from './httpgdTypes'; import * as path from 'path'; import * as fs from 'fs'; -import * as ejs from 'ejs'; +import ejs from 'ejs'; import { asViewColumn, config, setContext, UriIcon, makeWebviewCommandUriString } from '../util'; import { extensionContext } from '../extension'; From 426f0144fe6fcbc27181771ec570ce5f89f76ed1 Mon Sep 17 00:00:00 2001 From: eitsupi Date: Mon, 26 Oct 2026 14:16:23 +0000 Subject: [PATCH 2/2] chore: prepare 3.2.2 release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 14df82f56..40281e62e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "r", "displayName": "R", "description": "R Extension for Visual Studio Code", - "version": "3.2.1", + "version": "3.2.2", "packageManager": "pnpm@11.27.1", "author": "REditorSupport", "license": "SEE LICENSE IN LICENSE",