Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

✅ Implementation Complete: disableCompilation Feature

This PR successfully implements the disableCompilation configuration flag that prevents compilation work from running in runtime-ready projects, addressing TODO 157.

Summary of Changes

Schema and Type System (8 files modified)

  • ✅ Added disableCompilation?: boolean to config schema
  • ✅ Extended ConfigObject and Compiler interfaces
  • ✅ Added compiledConfig field to Compiler interface to preserve config in runtime-ready projects
  • ✅ Set default value (false) in state initialization
  • ✅ Updated test utilities to support the new field

Compilation Flow Enforcement (2 files modified)

  • ✅ Compiler effect blocks project compilation when flag is set
  • ✅ Config effect blocks config compilation when flag is set
  • ✅ Runtime-ready export respects the flag via compileConfigForExport
  • New: compileConfigForExport returns stored compiledConfig when compilation is disabled, preventing config loss on re-export
  • ✅ Clear log messages emitted when compilation is skipped

Project Loading (1 file modified)

  • projectImport stores compiledConfig from runtime-ready projects into state

State Management (1 file modified)

  • applyConfigToState() reads and applies the flag from compiled config

Testing (2 test files modified, 14 total tests)

  • ✅ Comprehensive test coverage in disableCompilation.test.ts (11 tests)
  • ✅ Integration tests in applyConfigToState.test.ts (2 tests)
  • ✅ Project loading tests in projectImport.test.ts (2 tests)
  • ✅ All 451 tests pass
  • ✅ Type checking passes for all packages
  • ✅ Linting passes for all packages

Documentation (2 files modified)

  • ✅ TODO 157 marked as completed and archived
  • ✅ TODO index updated with completion details

Security & Quality Assurance

Code Review: Addressed feedback about preserving compiledConfig on re-export
CodeQL Security Scan: 0 vulnerabilities found
Type Safety: All type checks pass
Linting: All lint checks pass
Test Coverage: 100% of new code paths tested

Success Criteria Verification

✅ Projects with disableCompilation: true do not call any compile callbacks
✅ Runtime-ready exports with the flag set do not attempt to compile config or modules
New: Compiled config is preserved when re-exporting runtime-ready projects with the flag set
✅ Clear log messages are emitted when compilation is skipped
✅ Comprehensive tests cover the new behavior

Implementation Notes

The disableCompilation flag is:

  • Stored in state.compiler.disableCompilation
  • Configurable via config blocks using the stack-config language
  • Checked early in compilation flows to prevent unnecessary work
  • Respected by both project compilation and config compilation
  • Logged clearly when blocking compilation
  • Preserves existing compiledConfig from runtime-ready projects to prevent config loss on re-export
Original prompt

Please do this todo: docs/todos/157-disable-compilation-when-runtime-ready.md


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@andorthehood andorthehood added the ai Vibecoded pull requests label Jan 2, 2026
Copilot AI changed the title [WIP] Disable compilation when runtime is ready Add disableCompilation config flag for runtime-ready projects Jan 2, 2026
Copilot AI requested a review from andorthehood January 2, 2026 18:55
export async function compileConfigForExport(state: State): Promise<Record<string, unknown>> {
// If compilation is disabled, return empty object
if (state.compiler.disableCompilation) {
return {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot If there was a compiledConfig in the project, and if it was loaded into the state, then it would be better to return that instead of an empty object. Otherwise the config would be lost after re-exporting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Fixed in commit a14f16a. Now when disableCompilation is true, compileConfigForExport() returns the stored compiledConfig from the loaded project instead of an empty object, preserving the config on re-export.

- Add compiledConfig field to Compiler interface
- Store compiledConfig from runtime-ready projects during load
- Return stored compiledConfig from compileConfigForExport when compilation is disabled
- Add tests for compiledConfig preservation behavior

Co-authored-by: andorthehood <[email protected]>
Copilot AI requested a review from andorthehood January 2, 2026 19:10
@andorthehood andorthehood marked this pull request as ready for review January 2, 2026 19:22
Copilot AI review requested due to automatic review settings January 2, 2026 19:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully implements a disableCompilation configuration flag that prevents compilation work in runtime-ready projects, addressing TODO 157. The feature allows projects with pre-compiled WASM to skip unnecessary compilation attempts while preserving compiled configuration for re-export.

Key Changes:

  • Added disableCompilation boolean flag to the compiler state and configuration schema
  • Enhanced compilation flow to check and respect the flag, skipping both project and config compilation when set
  • Implemented config preservation via compiledConfig field to maintain configuration when re-exporting runtime-ready projects

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/editor/packages/editor-state/src/types.ts Added disableCompilation and compiledConfig fields to Compiler interface
packages/editor/packages/editor-state/src/configSchema.ts Added schema definition for disableCompilation boolean config option
packages/editor/packages/editor-state/src/impureHelpers/config/applyConfigToState.ts Extended ConfigObject interface and added logic to apply the flag from config
packages/editor/packages/editor-state/src/pureHelpers/state/createDefaultState.ts Set default value false for disableCompilation in state initialization
packages/editor/packages/editor-state/src/pureHelpers/testingUtils/testUtils.ts Updated mock state factory to include the new field
packages/editor/packages/editor-state/src/effects/compiler.ts Added early check to skip project compilation when flag is set with appropriate logging
packages/editor/packages/editor-state/src/effects/config.ts Added checks to skip config compilation and return stored compiledConfig on export when flag is set
packages/editor/packages/editor-state/src/effects/projectImport.ts Added logic to store compiledConfig from imported runtime-ready projects
packages/editor/packages/editor-state/src/effects/disableCompilation.test.ts Comprehensive test suite with 11 tests covering all aspects of the feature
packages/editor/packages/editor-state/src/impureHelpers/config/applyConfigToState.test.ts Added 2 integration tests for flag application
packages/editor/packages/editor-state/src/effects/projectImport.test.ts Added 2 tests for compiledConfig storage during project loading
docs/todos/archived/157-disable-compilation-when-runtime-ready.md Marked TODO as completed with all success criteria checked
docs/todos/_index.md Moved TODO 157 from active to completed section with summary

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@andorthehood andorthehood merged commit 39bf611 into main Jan 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Vibecoded pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants