Skip to content

Commit 5f2541d

Browse files
authored
feat(webapp): make native build server the default in build settings (#3980)
Switches the native build server from opt-in to opt-out in project build settings. - It's now enabled by default, stored as a new \`disableNativeBuildServer\` opt-out key so previously-saved \`useNativeBuildServer: false\` values aren't treated as deliberate opt-outs. - The "Use native build server" checkbox is checked by default; unchecking it persists the opt-out. - Brief wording: clarifies build settings apply to GitHub-triggered and native build server deployments, and the native build server hint no longer says "in the future".
1 parent fda8e77 commit 5f2541d

3 files changed

Lines changed: 28 additions & 8 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
area: webapp
3+
type: improvement
4+
---
5+
6+
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.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.settings.integrations/route.tsx

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { json } from "@remix-run/server-runtime";
55
import React, { useCallback, useEffect, useRef, useState } from "react";
66
import { typedjson, useTypedFetcher, useTypedLoaderData } from "remix-typedjson";
77
import { z } from "zod";
8+
import { InlineCode } from "~/components/code/InlineCode";
89
import { MainHorizontallyCenteredContainer } from "~/components/layout/AppLayout";
910
import { Button } from "~/components/primitives/Buttons";
1011
import { CheckboxWithLabel } from "~/components/primitives/Checkbox";
@@ -130,6 +131,8 @@ const UpdateBuildSettingsFormSchema = z.object({
130131
.refine((val) => !val || val.length <= 500, {
131132
message: "Pre-build command must not exceed 500 characters",
132133
}),
134+
// Positive checkbox in the UI ("Use native build server"). It is checked by
135+
// default; we store the inverse as `disableNativeBuildServer`.
133136
useNativeBuildServer: z
134137
.string()
135138
.optional()
@@ -177,7 +180,8 @@ export const action = dashboardAction(
177180
installCommand: installCommand || undefined,
178181
preBuildCommand: preBuildCommand || undefined,
179182
triggerConfigFilePath: triggerConfigFilePath || undefined,
180-
useNativeBuildServer: useNativeBuildServer,
183+
// Native build server is the default, so we only persist the opt-out.
184+
disableNativeBuildServer: useNativeBuildServer ? undefined : true,
181185
});
182186

183187
if (resultOrFail.isErr()) {
@@ -379,6 +383,11 @@ export default function IntegrationsSettingsPage() {
379383

380384
<div>
381385
<Header2 spacing>Build settings</Header2>
386+
<Hint className="mb-2">
387+
These settings apply to deployments triggered from GitHub and to CLI deployments
388+
run with the <InlineCode variant="extra-small">--native-build-server</InlineCode>{" "}
389+
flag.
390+
</Hint>
382391
<div className="w-full rounded-sm border border-grid-dimmed p-4">
383392
<BuildSettingsForm buildSettings={buildSettings ?? {}} />
384393
</div>
@@ -426,21 +435,24 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
426435
const navigation = useNavigation();
427436

428437
const [hasBuildSettingsChanges, setHasBuildSettingsChanges] = useState(false);
438+
// The native build server is enabled by default; it's only off when the
439+
// project has explicitly opted out via `disableNativeBuildServer`.
440+
const nativeBuildServerEnabled = buildSettings?.disableNativeBuildServer !== true;
429441
const [buildSettingsValues, setBuildSettingsValues] = useState({
430442
preBuildCommand: buildSettings?.preBuildCommand || "",
431443
installCommand: buildSettings?.installCommand || "",
432444
triggerConfigFilePath: buildSettings?.triggerConfigFilePath || "",
433-
useNativeBuildServer: buildSettings?.useNativeBuildServer || false,
445+
useNativeBuildServer: nativeBuildServerEnabled,
434446
});
435447

436448
useEffect(() => {
437449
const hasChanges =
438450
buildSettingsValues.preBuildCommand !== (buildSettings?.preBuildCommand || "") ||
439451
buildSettingsValues.installCommand !== (buildSettings?.installCommand || "") ||
440452
buildSettingsValues.triggerConfigFilePath !== (buildSettings?.triggerConfigFilePath || "") ||
441-
buildSettingsValues.useNativeBuildServer !== (buildSettings?.useNativeBuildServer || false);
453+
buildSettingsValues.useNativeBuildServer !== nativeBuildServerEnabled;
442454
setHasBuildSettingsChanges(hasChanges);
443-
}, [buildSettingsValues, buildSettings]);
455+
}, [buildSettingsValues, buildSettings, nativeBuildServerEnabled]);
444456

445457
const [buildSettingsForm, fields] = useForm({
446458
id: "update-build-settings",
@@ -529,7 +541,7 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
529541
{...getInputProps(fields.useNativeBuildServer, { type: "checkbox" })}
530542
label="Use native build server"
531543
variant="simple/small"
532-
defaultChecked={buildSettings?.useNativeBuildServer || false}
544+
defaultChecked={nativeBuildServerEnabled}
533545
onChange={(isChecked) => {
534546
setBuildSettingsValues((prev) => ({
535547
...prev,
@@ -538,8 +550,8 @@ function BuildSettingsForm({ buildSettings }: { buildSettings: BuildSettings })
538550
}}
539551
/>
540552
<Hint>
541-
Native build server builds do not rely on external build providers and will become the
542-
default in the future. Version 4.2.0 or newer is required.
553+
Native build server builds don't rely on external build providers and are used by
554+
default. Requires version 4.2.0 or newer.
543555
</Hint>
544556
<FormError id={fields.useNativeBuildServer.errorId}>
545557
{fields.useNativeBuildServer.errors}

apps/webapp/app/v3/buildSettings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export const BuildSettingsSchema = z.object({
44
triggerConfigFilePath: z.string().optional(),
55
installCommand: z.string().optional(),
66
preBuildCommand: z.string().optional(),
7-
useNativeBuildServer: z.boolean().optional(),
7+
// Opt-out flag: the native build server is used by default. Only set when a
8+
// project explicitly disables it. Absence means native build server enabled.
9+
disableNativeBuildServer: z.boolean().optional(),
810
});
911

1012
export type BuildSettings = z.infer<typeof BuildSettingsSchema>;

0 commit comments

Comments
 (0)