-
Notifications
You must be signed in to change notification settings - Fork 0
feat(editor-state): add manual compilation #220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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 adds manual compilation functionality by renaming compilation-related functions and flags to differentiate between automatic and manual compilation modes. The changes enable users to manually trigger code and config compilation even when auto-compilation is disabled.
- Renamed
compileProjecttocompileCodeanddisableCompilationtodisableAutoCompilationfor clarity - Added manual compilation menu items and event handler for 'compileCode'
- Removed deprecated sample rate functionality and Project Settings menu
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/editor.ts | Updated import and reference from compileProject to compileCode |
| src/compiler-callback.ts | Renamed function compileProject to compileCode |
| packages/editor/packages/editor-state/src/types.ts | Updated type definitions: compileProject → compileCode and disableCompilation → disableAutoCompilation |
| packages/editor/packages/editor-state/src/effects/compiler.ts | Refactored to separate auto-compilation (onRecompile) from manual compilation (onForceCompile), added 'compileCode' event listener |
| packages/editor/packages/editor-state/src/effects/config.ts | Updated to use disableAutoCompilation flag |
| packages/editor/packages/editor-state/src/effects/menu/menus.ts | Added 'Compile Config' and 'Compile Code' menu items, removed Project Settings menu |
| packages/editor/packages/editor-state/src/configSchema.ts | Updated schema property from disableCompilation to disableAutoCompilation |
| packages/editor/packages/editor-state/src/impureHelpers/config/applyConfigToState.ts | Updated to handle disableAutoCompilation config property |
| packages/editor/packages/editor-state/src/pureHelpers/state/createDefaultState.ts | Updated default state to use disableAutoCompilation |
| packages/editor/packages/editor-state/src/pureHelpers/testingUtils/testUtils.ts | Updated mock state to use disableAutoCompilation |
| packages/editor/packages/editor-state/src/index.ts | Removed import and initialization of deprecated sampleRate effect |
| packages/editor/packages/editor-state/src/effects/sampleRate.ts | Deleted file - removed sample rate effect entirely |
| packages/editor/packages/editor-state/src/effects/disableCompilation.test.ts | Renamed test suite and updated all references to use new naming |
| packages/editor/packages/editor-state/src/effects/runtimeReadyProject.test.ts | Updated test mocks to use compileCode |
| packages/editor/packages/editor-state/src/effects/projectImport.test.ts | Updated test assertions to use disableAutoCompilation |
| packages/editor/packages/editor-state/src/impureHelpers/config/applyConfigToState.test.ts | Updated tests for disableAutoCompilation |
| packages/editor/packages/web-ui/screenshot-tests/utils/generateContextMenuMock.ts | Removed Project Settings menu mock item |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Check if compilation is disabled by config | ||
| if (state.compiler.disableCompilation) { | ||
| log(state, 'Config compilation skipped: disableCompilation flag is set', 'Config'); | ||
| if (state.compiler.disableAutoCompilation) { | ||
| log(state, 'Config compilation skipped: disableAutoCompilation flag is set', 'Config'); | ||
| return; | ||
| } |
Copilot
AI
Jan 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the disableAutoCompilation check is correctly implemented here, the config effect is missing a handler for the 'compileConfig' event that would allow manual config compilation (as introduced in the menu). Similar to how compiler.ts implements onForceCompile for the 'compileCode' event, you should add a function that bypasses this check and register it as an event listener for 'compileConfig'. Without this, the 'Compile Config' menu item added in menus.ts will not function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 42 out of 42 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This PR adds manual compilation functionality by renaming compilation-related functions and flags to differentiate between automatic and manual compilation modes. The changes enable users to manually trigger code and config compilation even when auto-compilation is disabled.
Renamed compileProject to compileCode and disableCompilation to disableAutoCompilation for clarity
Added manual compilation menu items and event handler for 'compileCode'
Removed deprecated sample rate functionality and Project Settings menu