Skip to content

Move the last React-free modules out of apps/web - #27

Open
playforge-coding wants to merge 1 commit into
core-auth-configfrom
core-remaining-lib
Open

Move the last React-free modules out of apps/web#27
playforge-coding wants to merge 1 commit into
core-auth-configfrom
core-remaining-lib

Conversation

@playforge-coding

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

Copy link
Copy Markdown
Owner

Stacked on #25. Phase 1C — the six modules that never needed React but were sitting in the app.

richText (the DOMPurify render pass), wikimedia (the browser Commons client), presence, summarizer, git/fs and git/sync. All land in the browser tier: DOMPurify, DOMParser, the Summarizer API and LightningFS-over-IndexedDB are browser things — framework-agnostic, but not runtime-neutral.

Two renames, deliberately

Both would otherwise have been a second module with the same basename in a different tier — the thing I avoided with image/imageFile in the browser-tier PR:

From To Because
richText.js browser/sanitizeRichText ../richText.js holds the policy
wikimedia.js browser/commonsImages ../wikimedia.js holds the plumbing

Dropping an indirection

sanitizeRichText carried a re-export block so components could get all their rich-text helpers from one import. With the module in core that buys nothing — so the five consumers that only wanted the neutral helpers (richTextLength, richTextToLine, isRichTextEmpty, isRichTextHtml) now take them from core/richText directly, and only RichText.jsx — which actually sanitizes — imports the browser module.

The bundle split, re-checked

git/fs and git/sync crossing into a workspace package could plausibly have broken the lazy git chunk, so I verified rather than assumed: isomorphic-git internals still appear only in the ~181 KB async chunk and in none of the four main ones.

Phase 1 is now done

apps/web/src/lib is 1,892 lines; packages/core is 7,504 (+635 tests).

What's left in the app, and why it should stay:

File Why
i18n.js, languages.js bound to react-i18next
git/engine.js, git/load.js the dynamic-import boundary and the Buffer polyfill — bundler concerns
utils.js cn(), the shadcn/Tailwind helper
everything else React hooks and contexts

That is the state the SvelteKit plan assumed: the rewrite surface is the view layer, not the product.

Verification

pnpm lint, pnpm test (core 41, api 27, mcp 14), pnpm build, pnpm build:docs all pass.

Phase 1C. Six modules that never needed React but were sitting in the app:
richText (the DOMPurify render pass), wikimedia (the browser Commons client),
presence, summarizer, git/fs and git/sync.

All land in the browser tier — DOMPurify, DOMParser, the Summarizer API and
LightningFS-over-IndexedDB are browser things, framework-agnostic but not
runtime-neutral.

Two are renamed rather than moved as-is, to avoid a second module with the same
basename in a different tier:

  richText.js  -> browser/sanitizeRichText   (../richText.js holds the policy)
  wikimedia.js -> browser/commonsImages      (../wikimedia.js holds the plumbing)

sanitizeRichText also drops the re-export block it carried so components could
get their rich-text helpers from one import. With the module in core that
indirection buys nothing, so the five consumers that only wanted the neutral
helpers now take them from core/richText directly, and only RichText.jsx —
which actually sanitizes — imports the browser module.

The lazy git chunk was re-checked after the move, since git/fs and git/sync
crossing into a workspace package could plausibly have broken it: isomorphic-git
internals still appear only in the ~181 KB async chunk and in none of the main
ones.

What stays in apps/web/src/lib and why:

  i18n.js, languages.js     bound to react-i18next
  git/engine.js, load.js    the dynamic-import boundary and the Buffer polyfill
  utils.js                  cn(), the shadcn/Tailwind helper
  everything else           React hooks and contexts

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 6, 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: f1736f0e-740e-47b7-a19c-6385b64dec38

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.

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