Skip to content

fix(kirari): keep private class names as one token - #16

Merged
ugi-dev merged 2 commits into
mainfrom
fix/4-private-class-names
Oct 22, 2026
Merged

ugi-dev merged 2 commits into
mainfrom
fix/4-private-class-names

Conversation

@ugi-dev

@ugi-dev ugi-dev commented Oct 22, 2026

Copy link
Copy Markdown
Member

What and why

JavaScript and TypeScript private class names were split: class C { #p = 1; m() { this.#p } } produced " #":text p:variable at the declaration and #:text p:property at the access.

#name is now one token in JavaScript-like languages (JavaScript, TypeScript, JSX, TSX, and scripts in Vue/Svelte/HTML). Private names are always class members, so they are highlighted as properties, or as functions where a public member would be:

Source Tokens
#p = 1 / this.#p / #p in o #p:property
#m() {}, get #a() {}, #g = () => 1 #m:function, #a:function, #g:function
this.#m() #m:property (as this.m())

A lone # stays text, and #! shebangs stay comments. Svelte {#if} blocks are unchanged.

Also refreshes the documented bundle sizes for the top of the stack.

Stacked on #14.

Closes #4

Validation

  • bun run check passes.
  • New tests in script-accuracy.test.ts (declaration, access, static, getters, methods, arrow fields, brand checks, escaped names), a corpus fixture, and streaming prefix/fuzz sources.
  • Golden comparison against main: only #name tokens in JavaScript-like inputs change.
Gzip bytes Before After
highlight() wrapper 4,153 4,197
Core 3,735 3,774
JavaScript 4,252 4,294

Checklist

  • bun run check passes
  • Tests cover the change
  • Changeset added (bunx changeset), or not needed for docs, tests, or internal changes
  • Docs updated if behavior or APIs changed

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T05:17:46.681002Z ea33960 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 10 billable files and costs up to $2.50.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 25 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used all 5 included reviews currently available. Your 12 included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository YAML (base), Organization UI (inherited)
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 2102e0aa-78a2-4054-9d06-6168bab5eb0c
📥 Commits

Reviewing files that changed from the base of the PR and between 8ef9385 and dddbe67.

📒 Files selected for processing: 10
  • .changeset/fix-private-class-names.md
  • docs/comparison.md
  • packages/kirari/README.md
  • packages/kirari/src/tokenize.ts
  • packages/kirari/test/corpus/fixtures.ts
  • packages/kirari/test/script-accuracy.test.ts
  • packages/kirari/test/stream-fuzz.test.ts
  • sites/docs/changelog/kirari/1.1.3.md
  • sites/docs/content/limitations.md
  • sites/docs/src/lib/site.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@ugi-dev
ugi-dev force-pushed the fix/4-private-class-names branch from 8c5d999 to ce18b14 Compare October 22, 2026 05:21
@ugi-dev

ugi-dev commented Oct 22, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ugi-dev
ugi-dev added this pull request to stack #15 October 22, 2026 05:23
@ugi-dev
ugi-dev force-pushed the fix/4-private-class-names branch from ce18b14 to 89eea7c Compare October 22, 2026 05:23
@ugi-dev
ugi-dev force-pushed the fix/4-private-class-names branch 2 times, most recently from d4238ed to 5c040a5 Compare October 22, 2026 05:29
Scan `#name` in JavaScript-like languages as a single name token. Private names are always class members, so they are highlighted as properties, or as functions where a public member would be.

The documented bundle sizes are refreshed for the top of the stack: core 3,774, JavaScript 4,294, all languages 23,273, highlight() wrapper 4,197 bytes gzip.

Closes #4
List the switch from interfaces to type aliases under Breaking changes, with migration steps for code that relied on declaration merging.
@ugi-dev
ugi-dev force-pushed the fix/4-private-class-names branch from 5c040a5 to dddbe67 Compare October 22, 2026 05:31
Base automatically changed from docs/barrel-language-imports to main October 22, 2026 05:33
@ugi-dev
ugi-dev merged commit 8135775 into main Oct 22, 2026
4 of 5 checks passed
@ugi-dev
ugi-dev deleted the fix/4-private-class-names branch October 22, 2026 05:34
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.

JS/TS private class fields are split into # text and a separate name token

1 participant