Make site runtime a global feature flag#3456
Conversation
📊 Performance Test ResultsComparing 5aa66fe vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
fredrikekelund
left a comment
There was a problem hiding this comment.
I think we can do away with SiteProcessDescription for a smaller diff, but functionally, this works great 👍 The logic is clear
| // @ts-expect-error If `BetaFeatures` is empty, `key` will be `never`, and we cannot use it to | ||
| // assign to`betaFeatures`.That's fine. Just rely on type checking when this function is called. |
There was a problem hiding this comment.
Can we keep this comment, but just remove the @ts-expect-error part? This will become troublesome again once we remove this beta feature.
| export type SiteProcessDescription = ProcessDescription & { | ||
| runtime: SiteRuntime; | ||
| }; |
There was a problem hiding this comment.
I don't believe we need this separate type. ProcessDescription is inferred from processDescriptionSchemaBase, which already has a runtime prop. Yes, that prop can be undefined, which this type doesn't allow, but that doesn't appear to be an issue.
…ture-flag' into rsm-1689-make-runtime-global-feature-flag
fredrikekelund
left a comment
There was a problem hiding this comment.
Splendid! Clean and understandable 👍
| scriptPath: string; | ||
| args: string[]; | ||
| env: NodeJS.ProcessEnv; | ||
| runtime: SiteRuntime; |
There was a problem hiding this comment.
We could leave a comment to highlight that this is only needed to know where WP-CLI commands should be executed.
Related issues
How AI was used in this PR
AI helped trace the existing runtime storage and startup paths, implement the env-driven behavior, and update focused tests. I reviewed the changes and adjusted them based on review feedback so runtime is no longer treated as site data.
Proposed Changes
nativePhpRuntimebeta feature to the existing app menu beta-features flow.STUDIO_RUNTIMEbefore Studio fetches sites or spawns CLI commands.runtime.runtimeas site metadata.Testing Instructions
runtimeprop and confirm it uses the native PHP path.STUDIO_RUNTIME=native-phpand confirm existing sites use the native PHP runtime without requiring stored site metadata.STUDIO_RUNTIMEand confirm existing sites default to Playground.runtime.Pre-merge Checklist