Summary
Extract the multi-line editor family (currently packages/ui/src/editor/) out of @jsvision/ui
into a dedicated @jsvision/editor package. This isolates a heavy, optional subsystem, gives
the forthcoming code-grade editor work (RD-08, #18) a clean home, and lets ui-only consumers avoid
carrying an editor they don't use.
Decision made 2026-07-18 (discussion under #18).
Motivation
Current coupling (measured)
The editor imports from nine ui subsystems — view (11×), reactive (6×), dialog, status,
layout, controls, window, scroll, dropdown — plus two internal-file reaches:
controls/measure.js (stringWidth/glyphWidth) and dialog/message-box.js
(runDialog/messageBox/ModalDialogHost). And @jsvision/files depends on the editor
(FileEditor). So extraction is a real refactor, not a lift-out.
Work
Related decision (feeds RD-08 #18)
- The
Tokenizer/FoldProvider seam interfaces will live in @jsvision/core (pure zero-dep type
declarations), so the future @jsvision/lang (Lezer) depends only on core + @lezer/*, not on
ui/editor.
core/ui keep {} runtime deps; the Lezer dependency is isolated in the opt-in @jsvision/lang
package (mirrors the @jsvision/forms → zod peer-dep precedent).
Sequencing
Recommended to land before the RD-08 build so the new highlighting/folding/gutter code is authored
in @jsvision/editor from the start. Not a hard blocker — RD-08 could be built in ui and
extracted later, at higher cost.
Acceptance criteria
Summary
Extract the multi-line editor family (currently
packages/ui/src/editor/) out of@jsvision/uiinto a dedicated
@jsvision/editorpackage. This isolates a heavy, optional subsystem, givesthe forthcoming code-grade editor work (RD-08, #18) a clean home, and lets
ui-only consumers avoidcarrying an editor they don't use.
Decision made 2026-07-18 (discussion under #18).
Motivation
the small current editor than the big future one, so this should land before RD-08's build.
ui → editor → lang, where the planned@jsvision/lang(Lezer) depends on theeditor's seam rather than on all of
ui.Current coupling (measured)
The editor imports from nine
uisubsystems —view(11×),reactive(6×),dialog,status,layout,controls,window,scroll,dropdown— plus two internal-file reaches:controls/measure.js(stringWidth/glyphWidth) anddialog/message-box.js(
runDialog/messageBox/ModalDialogHost). And@jsvision/filesdepends on the editor(
FileEditor). So extraction is a real refactor, not a lift-out.Work
packages/editor/(@jsvision/editor); movepackages/ui/src/editor/**into it.@jsvision/ui's public API to export everything the editor consumes — notablystringWidth/glyphWidth(measure) andrunDialog/messageBox/ModalDialogHost(message-box) if not already public.
@jsvision/filesfromui's editor exports to@jsvision/editor.@jsvision/editorto the lockstep-version set (sync-package-versions).yarn verify+yarn gategreen.Related decision (feeds RD-08 #18)
Tokenizer/FoldProviderseam interfaces will live in@jsvision/core(pure zero-dep typedeclarations), so the future
@jsvision/lang(Lezer) depends only oncore+@lezer/*, not onui/editor.core/uikeep{}runtime deps; the Lezer dependency is isolated in the opt-in@jsvision/langpackage (mirrors the
@jsvision/forms→zodpeer-dep precedent).Sequencing
Recommended to land before the RD-08 build so the new highlighting/folding/gutter code is authored
in
@jsvision/editorfrom the start. Not a hard blocker — RD-08 could be built inuiandextracted later, at higher cost.
Acceptance criteria
@jsvision/editorexports the full editor family;@jsvision/uino longer contains editor source.@jsvision/filesbuilds against@jsvision/editor.yarn verifygreen; lockstep versions synced.