Skip to content

15.x.x-alpha.1: Minimize API Surface - #66

Merged
varrockbank merged 50 commits into
mainfrom
15.0.0-alpha.1
Jan 14, 2026
Merged

15.x.x-alpha.1: Minimize API Surface#66
varrockbank merged 50 commits into
mainfrom
15.0.0-alpha.1

Conversation

@varrockbank

@varrockbank varrockbank commented Jan 13, 2026

Copy link
Copy Markdown
Owner
Change Migration
Remove automatic tab expansion Use BuffeeSanitize extension or sanitize text before passing to Model._ or Span.ins()
Span.ins() takes array of lines Span.ins('text') → Span.ins(['text'])Span.ins('line1\nline2') → Span.ins(['line1', 'line2'])
buffee-clip textarea removed Remove <textarea class="buffee-clip"> from HTML template
Model.s = "text" removed Use Model._ = ["text"]; View.render();

New APIs

API Description
Model.end Returns last coordinate {y, x} in document
Span.select(pos) Accepts optional position to set head when starting selection
Mode.mx Max column for vertical cursor movement (was internal maxCol)
Mode.ext Array of registered extension names in order
BuffeeSanitize extension Opt-in text sanitization (tabs→spaces, zero-width removal)

Renamed APIs

Old New
View.set(x) View.first = x (setter)
View.set(x, n) View.first = x, View.n = x (setter)
View.size() View.n (getter/setter)
View.start View.first
View.end View.last
render() View.render()
RENDER() View.RENDER()
Config cols Config w
Config rows Config h

Removed APIs

API Reason
View._ getter Unused, reduces API surface
Model.s setter Delegate Model._ update and rendering to user

varrockbank and others added 30 commits January 12, 2026 23:42
- Remove expandTabs function from core - text inserted as-is
- Add BuffeeSanitize extension for opt-in sanitization:
  - Converts tabs to spaces based on Mode.s
  - Removes zero-width chars (ZWSP, ZWNJ, ZWJ, BOM)
  - Normalizes multi-width Unicode spaces
  - API: Sanitize.line(), text(), lines()
- Update docs with sanitization guidance
- Add navigation link to API docs
- Add ext array to Mode for tracking extension registration order
- All extensions now push their name to Mode.ext on initialization
- Add unit tests for extension registration and chaining patterns
- `Span.ins('text')` → `Span.ins(['text'])`
- `Span.ins('line1\nline2')` → `Span.ins(['line1', 'line2'])`
- Client handles newline splitting, not buffee core
- FileLoader: removed expandTabs from appendLines helper
- sample-loader.html: wrap with BuffeeSanitize for tab handling
- Update API docs for Span.ins and Mode.ext
- Public API changed: editor.View.render() and editor.View.RENDER()
- Internal implementation unchanged (render/RENDER remain as const)
- Updated all extensions to destructure render from editor.View
- Converted docs/api.md to docs/api.txt (ASCII plaintext format)
- Updated all references to api.md throughout codebase
- Bump version to 15.6.0-alpha.1
- Rename extensions/ directory to combinators/
- Rename web/extensions.html to web/combinators.html
- Rename test/lib/test-extensions.js to test/lib/test-combinators.js
- Update all path references across codebase
- Update wrapper props: extensions → combinators
- Update documentation and navigation
- Bump wrapper versions to 1.3.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Tue Jan 13 11:10:29 2026 +0100
#
# On branch 15.0.0-alpha.1
# Changes to be committed:
#	modified:   README.md
#	modified:   index.html
#	modified:   samples/sample-tui.html
#	modified:   themes/theme-hn.css
#	modified:   web/combinators.html
#

# Please enter the commit message for your changes. Lines starting
# with '#' will be kept; you may remove them yourself if you want to.
# An empty message aborts the commit.
#
# Date:      Tue Jan 13 11:10:29 2026 +0100
#
# On branch 15.0.0-alpha.1
# Changes to be committed:
#	modified:   README.md
#	modified:   index.html
#	modified:   samples/sample-tui.html
#	modified:   themes/theme-hn.css
#	modified:   web/combinators.html
#
- api: remove View._ getter (unused, reduces API surface)
- docs: remove View._ from README
- View.first = n replaces View.set(n)
- View.n = n replaces View.size(n)
- Removed resize helper function
Modern browsers fire copy/cut events on any focused element,
so the hidden textarea workaround is no longer needed.

Breaking: buffee-clip textarea no longer required in HTML template.
Empty clipboard paste is a no-op, no need for conditional check.
Optional chaining ?.() already handles missing keys as no-ops.
Only z (undo/redo) remains, so inline directly in keydown handler.
- Model.end returns last coordinate {y, x} (replaces Model.last)
- Span.select() accepts optional position to set head
- Update api.txt documentation
@varrockbank
varrockbank force-pushed the 15.0.0-alpha.1 branch 3 times, most recently from 3cb7dc4 to 122c5a0 Compare January 14, 2026 00:38
- Update StatusLine and UltraHighCapacity for Model.end API
- Remove obsolete View.N from api.txt
- Handle UltraHighCapacity mode in computeByteCount
- Fix sample-loader.html to use View.render()
- Fix ios.js to use Model.end.y
- Default original counts to 0, always show "XL, originally: YL Z bytes"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@varrockbank
varrockbank merged commit bb64f9d into main Jan 14, 2026
2 of 3 checks passed
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.

1 participant