Skip to content

fix: restore httpgd plot and local help rendering with EJS 7 - #1911

Merged
renkun-ken merged 2 commits into
mainfrom
codex/fix-ejs-viewer-rendering
Oct 26, 2026
Merged

renkun-ken merged 2 commits into
mainfrom
codex/fix-ejs-viewer-rendering

Conversation

@renkun-ken

@renkun-ken renkun-ken commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

The EJS 7 upgrade makes the namespace imports in the httpgd viewer and local help previewer resolve render to undefined when bundled. Plot refreshes and added thumbnails fail, and local package index previews cannot render. Use EJS's default export in both viewers to restore these paths while retaining EJS 7.

Non-watch builds now fail if any of the four esbuild contexts reports a warning. All contexts are disposed after rebuilding, including when a build fails. Watch mode continues to report warnings without treating them as build failures.

Fixes #1910.

Validation:

  • Development and production builds, TypeScript checking, TypeScript and changed JavaScript lint, formatting, and diff checks pass.
  • Temporary warning injection confirmed that both build modes fail for a general warning in each of the four contexts, while watch mode allows warnings in all four.
  • Temporarily restoring the original EJS namespace imports during bundling makes both build modes fail. The final production extension bundle contains zero (void 0)(...) calls.

@renkun-ken
renkun-ken requested a review from eitsupi October 26, 2026 11:27

@eitsupi eitsupi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ChatGPT review — Approved

The EJS import fix addresses #1910. I have two non-blocking suggestions:

  1. Fail builds on all esbuild warnings. The underlying CI issue was that warnings did not cause build failures. Rather than promoting only "import-is-undefined" to an error, I suggest treating any esbuild warning as a build failure across all four build contexts (excluding watch mode).

  2. Simplify the regression tests. The 135-line test harness introduces custom bundling, VM execution, and extensive mocking. Given that esbuild already detected the original problem, enforcing zero warnings should provide sufficient protection against this specific regression without the additional maintenance burden.

Neither suggestion needs to block this urgent fix.

@renkun-ken

Copy link
Copy Markdown
Member Author

Thanks for the review. Both suggestions are addressed in da213c8:

  • Non-watch builds now fail on any esbuild warning from the extension, session agent, Interactive renderer, or webview context. The contexts are disposed in finally; watch mode continues to report warnings without failing the build.
  • Removed the 135-line bundling/VM regression harness and restored the existing Node test command.

Local development and production builds, TypeScript checking, lint, formatting, and diff checks pass. Temporary probes confirmed that a general warning in each of the four contexts fails both build modes, that restoring the original EJS namespace imports also fails both modes, and that watch mode allows warnings across all four contexts. The final production bundle contains zero (void 0)(...) calls.

For this revision, hosted build and formatting checks have passed; lint and the three platform test jobs are still running.

@renkun-ken
renkun-ken merged commit 692336c into main Oct 26, 2026
6 checks passed
@renkun-ken
renkun-ken deleted the codex/fix-ejs-viewer-rendering branch October 26, 2026 12:23
@eitsupi

eitsupi commented Oct 26, 2026

Copy link
Copy Markdown
Member

@renkun-ken Thanks for working on this.
Will you create a new release?

@eitsupi

eitsupi commented Oct 26, 2026

Copy link
Copy Markdown
Member

#1913

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.

3.2.1: plot viewer and help viewer broken — EJS render resolves to undefined ("Plot refresh failed: TypeError: (void 0) is not a function")

2 participants