@matrajs/mcp 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/benchmarks-full.md +2 -2
- package/docs/changelog.md +45 -0
- package/docs/contributing.md +3 -0
- package/docs/engine.md +19 -2
- package/docs/readme.md +3 -2
- package/package.json +1 -1
package/docs/benchmarks-full.md
CHANGED
|
@@ -9,10 +9,10 @@ minified, gzipped:
|
|
|
9
9
|
|
|
10
10
|
| | minified | gzipped |
|
|
11
11
|
|---|---|---|
|
|
12
|
-
| **Matra** |
|
|
12
|
+
| **Matra** | 94.6 kB | **31 kB** |
|
|
13
13
|
| Tiptap 3.30 | 370.5 kB | 117.2 kB |
|
|
14
14
|
|
|
15
|
-
**3.
|
|
15
|
+
**3.8× smaller.** Matra has no runtime dependencies; Tiptap brings ProseMirror,
|
|
16
16
|
which is 51 packages in `node_modules`. The figure was 25 kB at 0.16; 1.0
|
|
17
17
|
spent 3.6 kB on the engine doing more — attributes one extension adds to
|
|
18
18
|
another's nodes, paste and drop hooks, files and text dropped from outside,
|
package/docs/changelog.md
CHANGED
|
@@ -2,6 +2,51 @@
|
|
|
2
2
|
|
|
3
3
|
All packages share one version number and are released together.
|
|
4
4
|
|
|
5
|
+
## 1.0.1 — 2026-09-05
|
|
6
|
+
|
|
7
|
+
Three bugs a person meets in the first minute, found by driving every
|
|
8
|
+
extension through the built package in every framework, and the harness that
|
|
9
|
+
found them.
|
|
10
|
+
|
|
11
|
+
**The caret stays put through a change of structure.** Select a word, press
|
|
12
|
+
the heading button, press bold: the word is bold. Press Tab in a list item:
|
|
13
|
+
the caret is still in the word it was in. Both failed, because a structural
|
|
14
|
+
change — a paragraph made a heading, blocks wrapped in a list or a quote, an
|
|
15
|
+
item nested or lifted, a block split — was a plain replacement whose position
|
|
16
|
+
map sent every position inside it to the end. A replace step can now carry
|
|
17
|
+
the finer story (`[start, oldSize, newSize]` triples over the tokens that
|
|
18
|
+
actually moved), `Transform.rebuild` writes it from the runs of content an
|
|
19
|
+
operation keeps in place, and every structural operation in the engine uses
|
|
20
|
+
it. Carets, markers, decorations and collaborators' positions all follow.
|
|
21
|
+
The JSON is backwards compatible: a 1.0.0 client applies the same
|
|
22
|
+
replacement and maps the old, coarser way.
|
|
23
|
+
|
|
24
|
+
**The list button works.** Toggling a bullet, ordered or task list off did
|
|
25
|
+
nothing at all: there was no wrapper to lift a paragraph out of, so the
|
|
26
|
+
command was refused. Turning two selected paragraphs into a list made one
|
|
27
|
+
item holding both. The three toggles now share one command: outside a list
|
|
28
|
+
the selected blocks become a list, one item each; in a list of that kind the
|
|
29
|
+
selected items leave it, one level out when nested and out to plain blocks at
|
|
30
|
+
the top; in a list of another kind the list changes kind where it stands.
|
|
31
|
+
Shift-Tab on a top-level item leaves the list the same way.
|
|
32
|
+
|
|
33
|
+
**What is drawn on an element is what the document says.** A node
|
|
34
|
+
decoration — the focus class, a search highlight — whose whole range an edit
|
|
35
|
+
replaced was forgotten by the renderer's comparison, so the element it was
|
|
36
|
+
drawn on was patched and kept its class: after `setContent` two paragraphs
|
|
37
|
+
could both claim the caret. The renderer now remembers what it drew on each
|
|
38
|
+
element and inside it, and compares against that.
|
|
39
|
+
|
|
40
|
+
**`pnpm exercise`.** Every extension the package exports, built into one
|
|
41
|
+
editor and driven the way a person drives it — every command run, every
|
|
42
|
+
input rule typed, paste pasted, menus waited for — against the built package
|
|
43
|
+
in a DOM. The install matrix runs the same file inside each of the five
|
|
44
|
+
framework apps, so a framework proves three things at once: the package
|
|
45
|
+
installs, every extension works in it, and the binding relays what happened.
|
|
46
|
+
CI runs both.
|
|
47
|
+
|
|
48
|
+
**Bundle.** The starter kit is 31 kB gzipped, from 30. The budget is 32.
|
|
49
|
+
|
|
5
50
|
## 1.0.0 — 2026-09-04
|
|
6
51
|
|
|
7
52
|
The engine got faster everywhere it was measured, thirty-six extensions
|
package/docs/contributing.md
CHANGED
|
@@ -25,6 +25,9 @@ pnpm build # tsup, all packages
|
|
|
25
25
|
|
|
26
26
|
CI runs those plus `pnpm size`, `pnpm bench:check`, `pnpm links`,
|
|
27
27
|
`pnpm wiring`, `pnpm packaging`, `pnpm facts --check` and, in its own job,
|
|
28
|
+
`pnpm exercise` — every extension driven through the built package: every
|
|
29
|
+
command run, every input rule typed, paste pasted, in a DOM.
|
|
30
|
+
|
|
28
31
|
`pnpm install:matrix` — every package packed and installed with plain npm
|
|
29
32
|
into a fresh React, Vue, Svelte, Solid and vanilla Vite app, built and run.
|
|
30
33
|
Running the first four locally catches almost everything. Run the benchmark
|
package/docs/engine.md
CHANGED
|
@@ -49,7 +49,7 @@ honest:
|
|
|
49
49
|
| Phase | Layer | Lines | gz | Status |
|
|
50
50
|
|---|---|---|---|---|
|
|
51
51
|
| 1 | keymap, input rules, history, list commands | ~1,700 | 21 kB | **done** |
|
|
52
|
-
| 2 | model — nodes, marks, fragments, schema, content expressions, DOM parse/serialize | ~3,500 |
|
|
52
|
+
| 2 | model — nodes, marks, fragments, schema, content expressions, DOM parse/serialize | ~3,500 | 31 kB | **done** |
|
|
53
53
|
| 3 | transform — steps, position mapping, rebasing | ~2,200 | 19 kB | **done** |
|
|
54
54
|
| 4 | state — transactions, selection, plugins | ~1,000 | 9 kB | **done** |
|
|
55
55
|
| 5 | view — contenteditable, IME, selection sync | ~6,000 | 59 kB | **done** |
|
|
@@ -177,9 +177,26 @@ user is the last row: an app ships a fraction of what it did, because nothing
|
|
|
177
177
|
is pulled in that the editor does not use.
|
|
178
178
|
|
|
179
179
|
Extensions have landed since, so that last number is not today's. The current
|
|
180
|
-
figure is whatever `pnpm size` prints — **
|
|
180
|
+
figure is whatever `pnpm size` prints — **31 kB** for the starter kit as of
|
|
181
181
|
1.0 — and it is checked in CI rather than quoted from here.
|
|
182
182
|
|
|
183
|
+
## What 1.0.1 changed underneath
|
|
184
|
+
|
|
185
|
+
- **A replace step can say what it kept.** `ReplaceStep` takes optional
|
|
186
|
+
`ranges` — `[start, oldSize, newSize]` triples over the old document — and
|
|
187
|
+
its map tells that story instead of treating the whole range as gone.
|
|
188
|
+
`Transform.rebuild(from, to, content, kept)` derives the triples from the
|
|
189
|
+
runs of content an operation leaves in place. Retyping a block, wrapping,
|
|
190
|
+
lifting, splitting, nesting and un-nesting list items all go through it,
|
|
191
|
+
which is why a caret now survives every one of them.
|
|
192
|
+
- **Lists are one command.** `toggleList` in `list-commands.ts` wraps blocks
|
|
193
|
+
one item each, takes items out of a top-level list, outdents from a nested
|
|
194
|
+
one, and changes a list's kind in place.
|
|
195
|
+
- **The renderer remembers what it drew.** Two weak maps — node decorations
|
|
196
|
+
written onto an element, decorations drawn inside a content element — are
|
|
197
|
+
what a patch is compared against, rather than last render's set mapped
|
|
198
|
+
through the edit, which loses a decoration whose range the edit replaced.
|
|
199
|
+
|
|
183
200
|
## What 1.0 changed underneath
|
|
184
201
|
|
|
185
202
|
Measured first, then changed; the numbers are in BENCHMARKS.md. The shape of
|
package/docs/readme.md
CHANGED
|
@@ -442,6 +442,7 @@ pnpm bench:check # the performance ratchet, against the recorded baseline
|
|
|
442
442
|
pnpm links # no dead internal links on the site
|
|
443
443
|
pnpm packaging # every built package imports and requires (run after build)
|
|
444
444
|
pnpm wiring # every script on the site finds the markup it asks for
|
|
445
|
+
pnpm exercise # drive every extension through the built package in a DOM: every command, rule and paste
|
|
445
446
|
pnpm install:matrix # pack every package, npm-install it into fresh Vite apps for each framework, build and run them
|
|
446
447
|
pnpm facts # the counts the site prints — tests, adversarial tests, extensions
|
|
447
448
|
```
|
|
@@ -454,7 +455,7 @@ mapping, editor state and the editable view are written from scratch, with
|
|
|
454
455
|
package is installed with plain npm into a fresh React, Vue, Svelte, Solid
|
|
455
456
|
and vanilla Vite app and built there before a release (`pnpm install:matrix`).
|
|
456
457
|
|
|
457
|
-
An app on the starter kit bundles **
|
|
458
|
+
An app on the starter kit bundles **31 kB gzipped**, because nothing arrives
|
|
458
459
|
that the editor does not use — seventy-nine extensions ship in the package
|
|
459
460
|
and none of them is in the bundle until it is in the array. The whole ladder,
|
|
460
461
|
from an empty extension array upwards, is measured by `pnpm size` and checked
|
|
@@ -547,7 +548,7 @@ what the numbers are not.
|
|
|
547
548
|
|
|
548
549
|
| | Matra | Tiptap | Lexical | Slate |
|
|
549
550
|
|---|---|---|---|---|
|
|
550
|
-
| Bundle, gzipped | **
|
|
551
|
+
| Bundle, gzipped | **31 kB** | 117 kB | ~35 kB | ~50 kB |
|
|
551
552
|
| Runtime dependencies | **0** | 51 packages | few | several |
|
|
552
553
|
| Engine types in your code | **none** | ProseMirror | Lexical | Slate |
|
|
553
554
|
| Command types | **inferred** | module augmentation | manual | manual |
|
package/package.json
CHANGED