Skip to content

Move the portable half of version history and the Yjs document into core - #19

Merged
playforge-coding merged 1 commit into
core-dedupe-wikimediafrom
core-extract-git-ydoc
Aug 5, 2026
Merged

Move the portable half of version history and the Yjs document into core#19
playforge-coding merged 1 commit into
core-dedupe-wikimediafrom
core-extract-git-ydoc

Conversation

@playforge-coding

@playforge-coding playforge-coding commented Aug 5, 2026

Copy link
Copy Markdown
Owner

Third extraction layer. Stacked on #17.

Moves git/doc, git/ops, git/merge, git/layout, git/repo, git/pack and ydoc (plus its 15 tests) into core — 2,109 lines, all pure renames.

The seam already existed

repo.js and friends never open a filesystem themselves; they take one through repoCtx. That is what already let the same commit/merge/restore logic run against LightningFS in the browser and node:fs in tests, so they port untouched.

What stays in apps/web is everything that names a concrete runtime:

Stays Why
fs.js LightningFS over IndexedDB
remote.js reads import.meta.env.VITE_API_URL at module scope
engine.js the Buffer polyfill browsers need, and the chunk boundary
load.js the memoised dynamic import
sync.js composes the two halves

The bundle split was verified, not assumed

load.js's dynamic import is what keeps isomorphic-git out of the bundle every homepage visitor downloads, and moving its dependencies into a workspace package could plausibly have broken that. It didn't — isomorphic-git internals appear only in the ~181 KB async chunk, in none of the four main chunks, and the build total is unchanged at 4096.0 kB.

One thing to flag

ydoc.test.js moves with ydoc.js, which gives core its own vitest setup and leaves apps/web with no test files at all. Its test script would now exit 1, so it gains --passWithNoTests to keep the harness in place for tests added later.

CI doesn't currently run tests on any workspace (deploy.yml only builds), so nothing was masked by this — but it does mean the 56 tests across core/api/mcp are only ever run locally. Probably worth a CI step, out of scope here.

Verification

pnpm run lint, pnpm run build, pnpm run build:docs pass; core 15, api 27, mcp 14.

Docs updated: the version-history page now documents the portable/browser-bound split explicitly, since that page's whole "Where it lives" table was the old single-location layout.

Stack created with GitHub Stacks CLIGive Feedback 💬

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 18048670-f821-4537-8062-4d88be1c617f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Third extraction layer: git/doc, git/ops, git/merge, git/layout, git/repo,
git/pack and ydoc (plus its 15 tests). 2,109 lines, all pure renames.

The split falls along an existing seam rather than a new one. repo.js and
friends never open a filesystem themselves — they take one through repoCtx,
which is what already let the same commit/merge/restore logic run against
LightningFS in the browser and node:fs in tests. So they port untouched.

What stays in apps/web is everything that names a concrete runtime:

  fs.js       LightningFS over IndexedDB
  remote.js   reads import.meta.env.VITE_API_URL at module scope
  engine.js   the Buffer polyfill browsers need, and the chunk boundary
  load.js     the memoised dynamic import
  sync.js     composes the two halves

That boundary is load-bearing for bundle size, so it was verified rather than
assumed: isomorphic-git internals still appear only in the ~181 KB async chunk,
not in any of the four main chunks, and the build total is unchanged.

ydoc.test.js moves with ydoc.js, which gives core its own vitest setup and
leaves apps/web with no test files — its test script gains --passWithNoTests so
the harness stays in place for tests added later.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@playforge-coding
playforge-coding merged commit cde68dc into master Aug 5, 2026
2 of 3 checks passed
@playforge-coding
playforge-coding deleted the core-extract-git-ydoc branch August 5, 2026 23:31
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