Skip to content

Latest commit

 

History

History
49 lines (42 loc) · 3 KB

File metadata and controls

49 lines (42 loc) · 3 KB

ReScript / TypeScript / npm → AffineScript + Rust + Deno — Migration Plan

Status: PLAN (inventory + strategy). Execution is per-app, tracked separately. Baseline: main @ e473bcf.

Why

Per the Hyperpolymath Standard, ReScript and TypeScript are banned estate-wide and npm/bun are replaced by Deno. The governance gates Trusted-base reduction policy and Language / package anti-pattern policy fail on nextgen-databases because its subprojects still carry these. Target mapping: UI → AffineScript (TEA); systems / perf → Rust; npm → Deno (deno.json).

Inventory (main @ e473bcf)

143 .res/.resi/.ts/.tsx files + 4 package.json, by subproject:

Area Effort Notes / target

lithoglyph/glyphbase/ui (AirTable-like app)

HIGHEST (~30 .res)

Grid/Kanban/Calendar/Form/Gallery + stores + bindings (Yjs/Jotai/Webapi/Fetch). → AffineScript TEA, mirroring quandledb/frontend + nqc. Binding layer blocked on affinescript#56.

lithoglyph core: clients/rescript, analytics, distributed, normalizer, perf, stability, studio, gql-dt, tools/sdk-gen

HIGH

UI → AffineScript; systems/perf → Rust.

lithoglyph/integrations (Directus / Ghost / Payload / Strapi)

MEDIUM

CMS adapters bridging JS-only systems — candidate for a documented exception or thin Deno-ESM shim rather than full rewrite. Needs a decision.

verisimdb (admin, connectors/clients/rescript, playground)

MEDIUM

admin → AffineScript; connectors → Rust/AffineScript; playground → Deno.

typeql-experimental

LOW

Experimental — assess keep vs drop before migrating.

4 × package.json (glyphbase/ui, gql-dt/vscode-extension, studio, verisimdb/playground)

→ deno.json where Deno-runnable; vscode-extension may need an exception.

Strategy

  1. Leaf-first. Migrate modules with no dependents first to establish the pattern, then the apps. Glyphbase UI last (largest, binding-blocked).

  2. Per-app ADR + PR. Never a big-bang; each app/subproject is its own change.

  3. Language mapping. UI → AffineScript TEA; systems/perf/connectors → Rust; package.json → deno.json.

  4. Exceptions. The CMS integrations and the VSCode extension bridge JS-only ecosystems; record an explicit exception rather than force a rewrite.

Blockers (must clear before the UI layers can land)

  1. AffineScript toolchain: no compiler in CI / this container; affinescript#56 (DOM/fetch bindings) still pending — required for the glyphbase/ui/bindings/* and api/Client layers.

  2. Until the toolchain is ready, migrate the non-UI surface first (systems → Rust, package.json → deno.json), leaving UI rewrites staged.

Next concrete steps

  1. Decide the integrations/vscode-extension exception vs rewrite question.

  2. Confirm AffineScript CI availability; if absent, sequence Rust/systems work first.

  3. Pick the first leaf module for a proof-of-pattern PR.