Skip to content

Add JSG_TS_DEFINE_LITERAL#6433

Merged
vickykont merged 1 commit intomainfrom
vasiliki/add-macro
Mar 26, 2026
Merged

Add JSG_TS_DEFINE_LITERAL#6433
vickykont merged 1 commit intomainfrom
vasiliki/add-macro

Conversation

@vickykont
Copy link
Copy Markdown
Contributor

In some corner cases, this is needed to avoid the preprocessor from parsing the TypeScript content as C++ tokens, which may confuse Clang.

In some corner cases, this is needed to avoid the preprocessor from
parsing the TypeScript content as C++ tokens, which may confuse Clang.
@vickykont vickykont requested review from a team as code owners March 26, 2026 19:51
@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk bot commented Mar 26, 2026

The changes are clean and focused. Let me verify if the README.md / AGENTS.md documentation references the macro catalog:

The JSG AGENTS.md code review rule says I should check if README.md needs updating when adding macros. The new JSG_TS_DEFINE_LITERAL is not in the TypeScript Generation macro table in README.md (line 154). This is a documentation gap, though minor.

Let me now assess:

Technical correctness: The macro is correct. It properly creates a static const char[] from the string literal and passes it as a non-type template parameter, matching the pattern of JSG_TS_DEFINE.

Potential issues:

  1. The README.md macro table doesn't include the new macro - this is a minor documentation gap per JSG AGENTS.md review rules.
  2. No other issues - the approach is sound, the comment explains the rationale, and the whitespace is handled by .trim() downstream.

This is a clean, well-motivated change. The only actionable item is the missing documentation entry.

LGTM

github run

@vickykont vickykont enabled auto-merge March 26, 2026 20:04
@vickykont vickykont merged commit 526c821 into main Mar 26, 2026
49 of 51 checks passed
@vickykont vickykont deleted the vasiliki/add-macro branch March 26, 2026 22:39
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 participants