Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions apps/sim/blocks/registry-maps.minimal.ts

This file was deleted.

42 changes: 0 additions & 42 deletions apps/sim/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,6 @@ import {
getWorkflowExecutionCSPPolicy,
} from './lib/core/security/csp'

/**
* Dev-only escape hatch: when `SIM_DEV_MINIMAL_REGISTRY=1` (`bun run dev:minimal`),
* swap the heavy block and tool registries for tiny curated variants via a
* Turbopack/webpack resolve alias.
*
* The tool registry (4,351 entries across 261 service dirs) pulls ~5,907 modules
* and is 68-78% of every workspace route's module graph; aliasing it away takes
* `app/workspace/layout.tsx` from 5,916 modules to 1,255. Blocks are NOT a
* co-equal cost - `blocks/registry-maps` alone accounts for ~349 modules and
* mostly rides in behind the tool registry.
*
* It is reached through ONE choke point (`tools/utils.ts` → `@/tools/registry`)
* fed by four redundant client-reachable edges: providers/utils → tools/params,
* lib/workflows/blocks/block-outputs, lib/workflows/sanitization/validation, and
* serializer/index. All four must be severed for any of them to matter, which is
* why cutting only the providers/utils edge buys a single module.
*
* Only the curated core blocks/tools work in this mode. Never enabled in
* production - the minimal variants genuinely drop ~250 services and ~280 blocks.
*/
const useMinimalRegistry = isDev && process.env.SIM_DEV_MINIMAL_REGISTRY === '1'
const minimalRegistryAlias: Record<string, string> = useMinimalRegistry
? {
'@/tools/registry': './tools/registry.minimal.ts',
'@/blocks/registry-maps': './blocks/registry-maps.minimal.ts',
}
: {}

/**
* Marketing routes (`app/(landing)/**`, plus the root) exempted from COEP.
*
Expand Down Expand Up @@ -77,20 +49,6 @@ const nextConfig: NextConfig = {
productionBrowserSourceMaps: true,
turbopack: {
root: path.join(import.meta.dirname, '../..'),
resolveAlias: minimalRegistryAlias,
},
webpack: (config) => {
if (useMinimalRegistry) {
config.resolve.alias = {
...config.resolve.alias,
'@/tools/registry$': path.resolve(import.meta.dirname, 'tools/registry.minimal.ts'),
'@/blocks/registry-maps$': path.resolve(
import.meta.dirname,
'blocks/registry-maps.minimal.ts'
),
}
}
return config
},
images: {
formats: ['image/avif', 'image/webp'],
Expand Down
1 change: 0 additions & 1 deletion apps/sim/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"scripts": {
"dev": "bun run dev:cache:cap && next dev --port 3000",
"dev:minimal": "bun run dev:cache:cap && SIM_DEV_MINIMAL_REGISTRY=1 next dev --port 3000",
"dev:capped": "bun run dev:cache:cap && NODE_OPTIONS='--max-old-space-size=4096' next dev --port 3000",
"dev:cache:cap": "bun run ../../scripts/prune-turbopack-cache.ts",
"dev:clean": "rm -rf .next/dev/cache",
Expand Down
190 changes: 0 additions & 190 deletions apps/sim/tools/registry.minimal.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"dev": "turbo run dev",
"dev:sockets": "cd apps/realtime && bun run dev",
"dev:full": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev\" \"cd apps/realtime && bun run dev\"",
"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\"",
"dev:full:capped": "bunx concurrently -n \"App,Realtime\" -c \"cyan,magenta\" \"cd apps/sim && bun run dev:capped\" \"cd apps/realtime && bun run dev\"",
"test": "turbo run test",
"format": "turbo run format",
Expand Down
12 changes: 6 additions & 6 deletions scripts/setup/modes/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,17 +163,17 @@ export async function runDevMode(
message: `Low RAM detected (${detection.specs.hostMemGb}GB) — which dev server?`,
options: [
{
value: 'dev:full:minimal-registry',
label: 'Minimal block registry (recommended)',
hint: 'much lower memory — loads fewer integration blocks in dev',
value: 'dev:full:capped',
label: 'Capped heap (recommended)',
hint: 'caps Node at 4GB — every integration still available',
},
{
value: 'dev:full',
label: 'Full registry',
hint: 'every block available — can use 4-5GB+ on its own',
label: 'Uncapped',
hint: 'lets the dev server take what it needs (~4GB typical)',
},
],
initialValue: 'dev:full:minimal-registry',
initialValue: 'dev:full:capped',
})
}
return {
Expand Down
Loading