Skip to content

Commit 472e702

Browse files
committed
refactor(dev): remove the minimal-registry escape hatch
`dev:minimal` existed because the tool registry was 71-82% of every workspace route's module graph and aliasing it away was the only way to make dev bearable. The metadata work removed that reason, so the hatch now buys almost nothing: before this stack 31.7s -> 20.0s cold (-37%) after this stack 22.9s -> 20.7s cold (-10%) A 10% cold-compile win, on the run that happens once — restarts are ~4.2s either way — is not worth what it costs. `tools/registry.minimal.ts` and `blocks/registry-maps.minimal.ts` are 283 lines of hand-curated duplicates of the real registries that **nothing keeps in sync** (no lint, no CI check, no test); they are correct today only because someone remembered. And the mode is actively misleading: it silently drops ~250 services and ~280 blocks, so anything reproduced under it may not reproduce for real. Removes both files, the `SIM_DEV_MINIMAL_REGISTRY` branch from `next.config.ts` (including the whole `webpack()` hook, which existed only for this), and the `dev:minimal` / `dev:full:minimal-registry` scripts. Verified after removal: `tsc` clean, boundary + metadata + skills + monorepo gates pass, and `next dev` starts and serves the canvas at 22.6s cold / HTTP 200.
1 parent 71c5a2a commit 472e702

5 files changed

Lines changed: 0 additions & 327 deletions

File tree

apps/sim/blocks/registry-maps.minimal.ts

Lines changed: 0 additions & 93 deletions
This file was deleted.

apps/sim/next.config.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,6 @@ import {
88
getWorkflowExecutionCSPPolicy,
99
} from './lib/core/security/csp'
1010

11-
/**
12-
* Dev-only escape hatch: when `SIM_DEV_MINIMAL_REGISTRY=1` (`bun run dev:minimal`),
13-
* swap the heavy block and tool registries for tiny curated variants via a
14-
* Turbopack/webpack resolve alias.
15-
*
16-
* The tool registry (4,351 entries across 261 service dirs) pulls ~5,907 modules
17-
* and is 68-78% of every workspace route's module graph; aliasing it away takes
18-
* `app/workspace/layout.tsx` from 5,916 modules to 1,255. Blocks are NOT a
19-
* co-equal cost - `blocks/registry-maps` alone accounts for ~349 modules and
20-
* mostly rides in behind the tool registry.
21-
*
22-
* It is reached through ONE choke point (`tools/utils.ts` → `@/tools/registry`)
23-
* fed by four redundant client-reachable edges: providers/utils → tools/params,
24-
* lib/workflows/blocks/block-outputs, lib/workflows/sanitization/validation, and
25-
* serializer/index. All four must be severed for any of them to matter, which is
26-
* why cutting only the providers/utils edge buys a single module.
27-
*
28-
* Only the curated core blocks/tools work in this mode. Never enabled in
29-
* production - the minimal variants genuinely drop ~250 services and ~280 blocks.
30-
*/
31-
const useMinimalRegistry = isDev && process.env.SIM_DEV_MINIMAL_REGISTRY === '1'
32-
const minimalRegistryAlias: Record<string, string> = useMinimalRegistry
33-
? {
34-
'@/tools/registry': './tools/registry.minimal.ts',
35-
'@/blocks/registry-maps': './blocks/registry-maps.minimal.ts',
36-
}
37-
: {}
38-
3911
/**
4012
* Marketing routes (`app/(landing)/**`, plus the root) exempted from COEP.
4113
*
@@ -77,20 +49,6 @@ const nextConfig: NextConfig = {
7749
productionBrowserSourceMaps: true,
7850
turbopack: {
7951
root: path.join(import.meta.dirname, '../..'),
80-
resolveAlias: minimalRegistryAlias,
81-
},
82-
webpack: (config) => {
83-
if (useMinimalRegistry) {
84-
config.resolve.alias = {
85-
...config.resolve.alias,
86-
'@/tools/registry$': path.resolve(import.meta.dirname, 'tools/registry.minimal.ts'),
87-
'@/blocks/registry-maps$': path.resolve(
88-
import.meta.dirname,
89-
'blocks/registry-maps.minimal.ts'
90-
),
91-
}
92-
}
93-
return config
9452
},
9553
images: {
9654
formats: ['image/avif', 'image/webp'],

apps/sim/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"scripts": {
1111
"dev": "bun run dev:cache:cap && next dev --port 3000",
12-
"dev:minimal": "bun run dev:cache:cap && SIM_DEV_MINIMAL_REGISTRY=1 next dev --port 3000",
1312
"dev:capped": "bun run dev:cache:cap && NODE_OPTIONS='--max-old-space-size=4096' next dev --port 3000",
1413
"dev:cache:cap": "bun run ../../scripts/prune-turbopack-cache.ts",
1514
"dev:cache:prune": "bun run ../../scripts/prune-turbopack-cache.ts --force",

apps/sim/tools/registry.minimal.ts

Lines changed: 0 additions & 190 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"dev": "turbo run dev",
1717
"dev:sockets": "cd apps/realtime && bun run dev",
1818
"dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev\" \"cd apps/realtime && bun run dev\"",
19-
"dev:full:minimal-registry": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev:minimal\" \"cd apps/realtime && bun run dev\"",
2019
"dev:full:capped": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev:capped\" \"cd apps/realtime && bun run dev\"",
2120
"test": "turbo run test",
2221
"format": "turbo run format",

0 commit comments

Comments
 (0)