-
Notifications
You must be signed in to change notification settings - Fork 15
add ensureCompiledOnStartup config flag to opt-out of auto-compilation #499
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
add ensureCompiledOnStartup config flag to opt-out of auto-compilation #499
Conversation
🦋 Changeset detectedLatest commit: 0b84bb0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
View your CI Pipeline Execution ↗ for commit 0b84bb0
☁️ Nx Cloud last updated this comment at |
Merge activity
|
#499) ### TL;DR Add automatic flow compilation at worker startup with the ability to opt-out. ### What changed? - Added a new `ensureCompiledOnStartup` configuration option to `FlowWorkerConfig` (defaults to `true`) - When enabled (default), workers call `pgflow.ensure_flow_compiled()` at startup to verify flows are up-to-date - In development mode, mismatched flows are automatically recompiled - In production mode, mismatches cause errors - Added comprehensive tests for the new configuration option ### How to test? 1. Create a flow worker with default settings to see automatic compilation: ```typescript const worker = createFlowWorker(MyFlow, { /* config */ }); ``` 2. Opt-out of automatic compilation: ```typescript const worker = createFlowWorker(MyFlow, { ensureCompiledOnStartup: false, // other config }); ``` 3. Run tests to verify behavior: ``` deno test pkgs/edge-worker/tests/integration/flow/compilationAtStartup.test.ts deno test pkgs/edge-worker/tests/unit/FlowWorkerLifecycle.compilation.test.ts ``` ### Why make this change? This change improves the developer experience by ensuring flows are properly compiled at worker startup. It helps catch flow definition mismatches early, automatically recompiling in development environments while failing fast in production. The opt-out option provides flexibility for environments where flows are pre-compiled via CLI or other means.
bcc4f76 to
cf8811b
Compare
e4cea89 to
0b84bb0
Compare
🚀 Production Deployment: Website✅ Successfully deployed to production! 🔗 Production URL: https://pgflow.dev 📝 Details:
Deployed at: 2025-12-04T11:09:29Z |

TL;DR
Add automatic flow compilation at worker startup with the ability to opt-out.
What changed?
ensureCompiledOnStartupconfiguration option toFlowWorkerConfig(defaults totrue)pgflow.ensure_flow_compiled()at startup to verify flows are up-to-dateHow to test?
Create a flow worker with default settings to see automatic compilation:
Opt-out of automatic compilation:
Run tests to verify behavior:
Why make this change?
This change improves the developer experience by ensuring flows are properly compiled at worker startup. It helps catch flow definition mismatches early, automatically recompiling in development environments while failing fast in production. The opt-out option provides flexibility for environments where flows are pre-compiled via CLI or other means.