diff --git a/.server-changes/native-build-server-opt-out.md b/.server-changes/native-build-server-opt-out.md
new file mode 100644
index 00000000000..2e43b143480
--- /dev/null
+++ b/.server-changes/native-build-server-opt-out.md
@@ -0,0 +1,6 @@
+---
+area: webapp
+type: improvement
+---
+
+Make the native build server the default in project build settings. It's now opt-out, stored as a new `disableNativeBuildServer` key. Also clarifies in the UI that build settings apply to GitHub-triggered and native build server deployments.
diff --git a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx
index 2178d19f99b..644dcc18f87 100644
--- a/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx
+++ b/apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx
@@ -112,6 +112,8 @@ const UpdateBuildSettingsFormSchema = z.object({
.refine((val) => !val || val.length <= 500, {
message: "Pre-build command must not exceed 500 characters",
}),
+ // Positive checkbox in the UI ("Use native build server"). It is checked by
+ // default; we store the inverse as `disableNativeBuildServer`.
useNativeBuildServer: z
.string()
.optional()
@@ -152,7 +154,8 @@ export const action: ActionFunction = async ({ request, params }) => {
installCommand: installCommand || undefined,
preBuildCommand: preBuildCommand || undefined,
triggerConfigFilePath: triggerConfigFilePath || undefined,
- useNativeBuildServer: useNativeBuildServer,
+ // Native build server is the default, so we only persist the opt-out.
+ disableNativeBuildServer: useNativeBuildServer ? undefined : true,
});
if (resultOrFail.isErr()) {
@@ -321,6 +324,10 @@ export default function IntegrationsSettingsPage() {
Build settings
+
+ These settings apply to GitHub-triggered deployments and deployments built with
+ the native build server.
+
@@ -362,11 +369,14 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
const navigation = useNavigation();
const [hasBuildSettingsChanges, setHasBuildSettingsChanges] = useState(false);
+ // The native build server is enabled by default; it's only off when the
+ // project has explicitly opted out via `disableNativeBuildServer`.
+ const nativeBuildServerEnabled = buildSettings?.disableNativeBuildServer !== true;
const [buildSettingsValues, setBuildSettingsValues] = useState({
preBuildCommand: buildSettings?.preBuildCommand || "",
installCommand: buildSettings?.installCommand || "",
triggerConfigFilePath: buildSettings?.triggerConfigFilePath || "",
- useNativeBuildServer: buildSettings?.useNativeBuildServer || false,
+ useNativeBuildServer: nativeBuildServerEnabled,
});
useEffect(() => {
@@ -374,9 +384,9 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
buildSettingsValues.preBuildCommand !== (buildSettings?.preBuildCommand || "") ||
buildSettingsValues.installCommand !== (buildSettings?.installCommand || "") ||
buildSettingsValues.triggerConfigFilePath !== (buildSettings?.triggerConfigFilePath || "") ||
- buildSettingsValues.useNativeBuildServer !== (buildSettings?.useNativeBuildServer || false);
+ buildSettingsValues.useNativeBuildServer !== nativeBuildServerEnabled;
setHasBuildSettingsChanges(hasChanges);
- }, [buildSettingsValues, buildSettings]);
+ }, [buildSettingsValues, buildSettings, nativeBuildServerEnabled]);
const [buildSettingsForm, fields] = useForm({
id: "update-build-settings",
@@ -462,7 +472,7 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
{...conform.input(fields.useNativeBuildServer, { type: "checkbox" })}
label="Use native build server"
variant="simple/small"
- defaultChecked={buildSettings?.useNativeBuildServer || false}
+ defaultChecked={nativeBuildServerEnabled}
onChange={(isChecked) => {
setBuildSettingsValues((prev) => ({
...prev,
@@ -471,8 +481,8 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
}}
/>
- Native build server builds do not rely on external build providers and will become the
- default in the future. Version 4.2.0 or newer is required.
+ Native build server builds don't rely on external build providers and are used by
+ default. Requires version 4.2.0 or newer.
{fields.useNativeBuildServer.error}
diff --git a/apps/webapp/app/v3/buildSettings.ts b/apps/webapp/app/v3/buildSettings.ts
index 1ff88caa9d1..0735de9f337 100644
--- a/apps/webapp/app/v3/buildSettings.ts
+++ b/apps/webapp/app/v3/buildSettings.ts
@@ -4,7 +4,9 @@ export const BuildSettingsSchema = z.object({
triggerConfigFilePath: z.string().optional(),
installCommand: z.string().optional(),
preBuildCommand: z.string().optional(),
- useNativeBuildServer: z.boolean().optional(),
+ // Opt-out flag: the native build server is used by default. Only set when a
+ // project explicitly disables it. Absence means native build server enabled.
+ disableNativeBuildServer: z.boolean().optional(),
});
export type BuildSettings = z.infer;