Skip to content

Drop Unused @kerebron/extension-automerge Dependency - #550

Merged
Dharp02 merged 1 commit into
mainfrom
chore/drop-unused-automerge-dep
Sep 21, 2026
Merged

Dharp02 merged 1 commit into
mainfrom
chore/drop-unused-automerge-dep

Conversation

@Dharp02

@Dharp02 Dharp02 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator

Overview

@kerebron/extension-automerge is declared in package.json but nothing in the repo uses it. This removes it and the ~20 transitive packages that came with it. No application code changes.

Carried forward from #475, which is otherwise obsolete — the vendor/mieweb-ui.tgz tarball and vendor/ui submodule that PR targeted were removed in 8ea7377, and @mieweb/ui now resolves ^0.7.3 from the public registry. This was the one live item left in it.

Is this related to co-editing being switched off? No — but here is why that question comes up

Live co-editing is currently disabled in the app, and this PR deletes a package with "collaborative editing" written all over it. Those two facts are unrelated, and it is worth being explicit about that so nobody reads this as part of the outage or part of the fix.

There are two different collaborative-editing libraries. Automerge and Yjs solve the same problem — two people typing in one document, both seeing each other's keystrokes — using different underlying algorithms. They are alternatives, not layers. You pick one.

This project picked Yjs. That choice is visible throughout: @kerebron/extension-yjs, yjs and y-protocols in package.json, the /yjs relay in meteor-backend, collabRoom on the composer, tests/e2e/huddle/yjs-collab-editing.spec.ts. Automerge was evaluated at some point and not chosen. Nobody removed the dependency line afterwards, so it has been installed on every npm install and CI run since, feeding nothing. That is what this PR deletes — the un-chosen option, which no code has ever imported.

Why co-editing is off is a Yjs problem, entirely separate. In RichEditor, passing a collab prop makes the component lazy-load a chunk containing the Yjs pieces, deliberately, so they stay optional peers. If that import rejects, the rejection escapes into a handler that only logs it, CoreEditor.create() is never reached, and no editor is created at all. TimeHuddle passes collab only when editing an existing post, so "Edit post" opened to an empty 18px strip with no toolbar while writing a new post worked perfectly — the same component behaving oppositely depending on one prop. #547 shipped the stopgap: detect the editor that never appeared, remount without collab. That trades live co-editing for an editor that opens, which is the right trade, but it is a workaround, not a fix.

The real fix is upstream in mieweb/ui#480, which makes the library fall back to a local editor when the collaborative kit fails instead of failing to mount anything, and tells the host through a new onUnavailable callback. When that lands and ships, #547 comes out and co-editing goes back on.

So: removing Automerge does not affect co-editing, because no code path has ever touched it. Restoring co-editing does not need Automerge, because the app's collaboration runs on Yjs. And nothing upstream needs changing for this PR — mieweb/ui's own package.json contains no reference to Automerge anywhere, in any dependency block.

The four PRs, in one place:

PR What it is Status
#475 Original @mieweb/ui tarball upgrade that first spotted the unused dependency Closed — superseded by 8ea7377
#547 Stopgap: turn co-editing off so "Edit post" always opens Merged, temporary
mieweb/ui#480 Upstream fix: editor survives a failed collab kit Open, 8/8 checks green, awaiting review
#550 (this one) Delete the never-used Automerge dependency Open

Only #547 and mieweb/ui#480 are about the outage. This PR is housekeeping that happened to surface alongside them.

Current State

  • @kerebron/extension-automerge is pinned at ^0.2.1 while the rest of the kerebron stack is on ^0.8.9 — it reads like a leftover from an experiment that concluded in favour of Yjs.
  • A repo-wide grep for automerge outside node_modules hits exactly one line: the package.json entry itself.
  • It is not a peer dependency @mieweb/ui asks for. Its kerebron peers are editor, editor-kits, extension-yjs and wasm.
  • Collaborative editing in the app runs on Yjs (@kerebron/extension-yjs, yjs, y-protocols), which is untouched here.

Proposed Changes

  1. Remove @kerebron/extension-automerge from package.json dependencies.
  2. Re-resolve package-lock.json — 17 insertions, 285 deletions. Pruned:
    • @automerge/automerge 2.2.4 and @automerge/automerge-repo 1.1.9
    • cbor-x, cbor-extract and its six @cbor-extract/* platform binaries
    • bs58, bs58check, base-x, @noble/hashes, fast-sha256, tiny-typed-emitter, node-gyp-build-optional-packages
    • xstate and prosemirror-keymap, which were reachable only through this package (xstate via @automerge/automerge-repo, prosemirror-keymap via @kerebron/extension-automerge itself)

prosemirror-model and uuid lost only their nested copies; both still resolve at top level (1.25.9 and 7.0.3). Neither prosemirror-keymap nor xstate is imported anywhere in src/, meteor-backend/, packages/ or tests/.

Acceptance Criteria

  • npm run typecheck passes
  • npm run lint passes
  • npm run format clean
  • npm run test:unit — 149/149 across 16 files
  • npm run build succeeds (remaining warnings are pre-existing: onnxruntime-web direct eval, ineffective dynamic imports)
  • No source file references automerge, prosemirror-keymap or xstate

Out of Scope (for Now)

  • Yjs collab end-to-end verification. This PR removes a package the collab path never touched; the Yjs stack is unchanged. The existing tests/e2e/huddle/yjs-collab-editing.spec.ts covers that path and is not modified here.
  • The rest of Upgrade @mieweb/ui to 0.7.1 and Prune Unused Editor Dependencies #475. Superseded by 8ea7377; that PR is closed with a note.
  • @kerebron/extension-codecrock. Installed transitively via editor-kits, unpatched, with a known production-build Illegal invocation crash upstream. Pre-existing and unrelated to this change — see the Kerebron 0.8.12 note in #520.

Copilot AI balanced review requested due to automatic review settings September 21, 2026 16:22
@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

🗑️ Preview Environment Cleaned Up

The preview container for this PR has been deleted.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Dharp02 Dharp02 self-assigned this Sep 21, 2026
The app never imported it: a repo-wide grep for "automerge" outside
node_modules hits only the package.json line itself. It is not a peer
dependency @mieweb/ui asks for either — it wants editor, editor-kits,
extension-yjs and wasm — and it sat pinned at 0.2.1 while the rest of
the kerebron stack moved to 0.8.9, which reads like a leftover from an
experiment that concluded in favour of Yjs.

Removing it prunes @automerge/automerge 2.2.4, @automerge/automerge-repo
1.1.9 and their trees (cbor-x, bs58, xstate, prosemirror-keymap and the
six @cbor-extract native builds) — 285 lines out of the lockfile.
prosemirror-keymap and xstate were reachable only through this package;
prosemirror-model and uuid stay, resolved at top level.

Carried forward from #475, which is otherwise obsolete: the tarball and
vendor/ui submodule it targeted were removed in 8ea7377.
@Dharp02
Dharp02 force-pushed the chore/drop-unused-automerge-dep branch from 0d804b8 to 1e3e3fe Compare September 21, 2026 16:58
@Dharp02
Dharp02 merged commit 8a55af4 into main Sep 21, 2026
8 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Done in Scrum Team Jerry Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants