You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(platform): shrink the convex push further — jsdom→linkedom, lodash subpath imports #2581
The self-hosted backend caps a function push at 42.92 MiB zipped (hard const, see #2579). PR #2548 brought a fresh-backend push from 42.97 to 35.38 MiB, but the total includes the external-deps package the backend re-resolves from npm on every fresh backend, so headroom erodes on its own as upstream transitive versions grow — the margin is structural, not static.
external-deps package 20.2 MiB zipped — dominated by mssql→tedious→@azure/* (~12 MiB, SQL-Server integration feature weight, not trimmable) and jsdom (~5 MiB closure incl. tldts/css-tree/@bramus)
app modules 13.0 MiB zipped (roughly half source maps, which the CLI always uploads)
component packages ~2.1 MiB
Proposed change
jsdom → linkedom (biggest lever, ~4–5 MiB zipped): only three crawler helpers import jsdom (crawler/helpers/structured_data.ts, crawler/helpers/content_filter.ts, crawler/lib/discovery.ts), all querySelector/textContent-level usage — no Readability, no layout. linkedom bundles tree-shaken (external entry disappears entirely). Needs fixture-page tests around the three helpers since HTML-parser edge behaviour (malformed markup recovery, entity handling) differs.
lodash CJS → per-method subpath imports (~0.3–0.5 MiB zipped): import { get } from 'lodash' sites (~15 files under convex/) pull the full non-tree-shakeable CJS build into BOTH the isolate and node bundles. lodash/get-style imports (or lodash-es) shrink it; mechanical change.
Isolate _deps audit (opportunistic): largest isolate chunks (~600 KB each) haven't been attributed; check for accidental heavy imports into the default runtime.
Status after PR #2674: jsdom→linkedom swap landed (three crawler helpers, fixture tests for malformed-markup/entity behaviour before+after; stale jsdom externalPackages entry removed) and the lodash CJS→subpath imports were already on main via #2587. Remaining, deliberately open: the ≤30 MiB fresh-backend push AC (scratch-backend/CI-observable only) and the isolate _deps audit (static inspection found no clear culprit — xlsx/jszip are node-bundle-only, pdfjs already lazy; needs a bundle visualizer or scratch push).
Closing as obsolete. 0.5.0 (#3107) moved the platform off Convex: services/platform/convex/ no longer exists and no package.json depends on Convex, so there is no function push left to shrink. The two concrete changes had already landed (linkedom in #2674, the lodash subpaths in #2587), and the 30 MiB push criterion has nothing left to measure.
Activity
yannickmonney commentedon Jul 11, 2026
Status after PR #2674: jsdom→linkedom swap landed (three crawler helpers, fixture tests for malformed-markup/entity behaviour before+after; stale
jsdomexternalPackages entry removed) and the lodash CJS→subpath imports were already on main via #2587. Remaining, deliberately open: the ≤30 MiB fresh-backend push AC (scratch-backend/CI-observable only) and the isolate_depsaudit (static inspection found no clear culprit — xlsx/jszip are node-bundle-only, pdfjs already lazy; needs a bundle visualizer or scratch push).yannickmonney commentedon Sep 27, 2026
Closing as obsolete. 0.5.0 (#3107) moved the platform off Convex:
services/platform/convex/no longer exists and nopackage.jsondepends on Convex, so there is no function push left to shrink. The two concrete changes had already landed (linkedom in #2674, the lodash subpaths in #2587), and the 30 MiB push criterion has nothing left to measure.