Skip to content

17.0.0 alpha.1: Decouple Buffe (model-view, text buffer core) from Buffee (MVC) - #70

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

17.0.0 alpha.1: Decouple Buffe (model-view, text buffer core) from Buffee (MVC)#70
varrockbank merged 14 commits into
mainfrom
17.0.0-alpha.1

Conversation

@varrockbank

@varrockbank varrockbank commented Jan 14, 2026

Copy link
Copy Markdown
Owner
  1. Mode.ext includes Buffe, and Buffee, as well as their version.
  2. Buffe.v is removed
  3. Buffee has a BuffeeNativeController which is the previous keyboard handler
  4. Controllers return a function that when invoked unregister the callback
  5. Buffe now exclusively deals with text buffer management
  6. Buffee looks the same as before, even tho it uses Buffe the hood. Things programmed against Buffee still work
  7. Add code to Buffe so it's not necessary to call new Buffe, and can just do Buffe(..)

- buffe.js: Buffe function - core rendering engine without keyboard handling
- buffee.js: Buffee function - extends Buffe, adds clipboard and keyboard controller
- Update all HTML files to import both scripts
- Update docs and wrapper comments
- Update pre-commit hook to handle split files
- Buffe.plug(ctrl) registers controller, auto-unplugs previous
- Buffe.unplug() removes current controller
- Controller returns cleanup function for event handler removal
- Buffee.controller extracted as static, plugged in constructor
- Accepts Buffe instance (combinator style) or element (shorthand)
- Registers in Mode.ext like other combinators
- Buffee(editor) or Buffee(el, opts) both work
- api: Buffe callable without new for consistent function chaining
- fix: use instanceof for robust Buffe detection in Buffee
- api: version string is now Mode.ext[0] instead of instance.v
- Updated docs, tests, and pre-commit hook
# 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:      Wed Jan 14 09:46:01 2026 +0100
#
# On branch 17.0.0-alpha.1
# Changes to be committed:
#	modified:   index.html
#
# Changes not staged for commit:
#	modified:   docs/api.txt
#	modified:   index.html
#
- Remove plug/unplug from Buffe core
- Controller is now convention: editor.Ctrl = Controller(editor)
- Call editor.Ctrl() to unregister (cleanup function)
- index.html: add quote, syntax-highlighted code examples
- Add buffeeVersion constant to buffee.js
- Mode.ext now includes version: 'Buffee@17.6.0-alpha.1'
- Pre-commit hook tracks buffee.js version
- Docs: add versioning section to api.txt
- Add createBareEditor() helper for testing Buffe without Buffee
- Add test for bare Buffe Mode.ext having core version only
- Add test for Buffee@version in Mode.ext
- Update existing tests to slice(2) since Buffee now adds version
@varrockbank
varrockbank force-pushed the 17.0.0-alpha.1 branch 2 times, most recently from 41c3abb to e8406d4 Compare January 14, 2026 09:54
@varrockbank
varrockbank merged commit 3fff432 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