Skip to content

Commit 231cc01

Browse files
committed
fix(marketing): Safari gets the arm64 Mac download
1 parent 324ddda commit 231cc01

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

‎apps/marketing/src/lib/macArch.test.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ describe("macArchFromGpuRenderer", () => {
1313
);
1414
});
1515

16-
it("uses x64 for ambiguous Safari and unavailable renderer values", () => {
17-
expect(macArchFromGpuRenderer("Apple GPU")).toBe("x64");
16+
it("detects Safari's generic Apple Silicon renderer", () => {
17+
expect(macArchFromGpuRenderer("Apple GPU")).toBe("arm64");
18+
});
19+
20+
it("uses x64 when the renderer is unavailable", () => {
1821
expect(macArchFromGpuRenderer("")).toBe("x64");
1922
});
2023
});

‎apps/marketing/src/lib/macArch.ts‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const INTEL_GPU_PATTERN = /intel|amd|radeon|nvidia|geforce/i;
2-
const APPLE_SILICON_GPU_PATTERN = /\bapple\s+m\d/i;
2+
const APPLE_SILICON_GPU_PATTERN = /\bapple\s+(?:m\d|gpu)\b/i;
33

44
export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" {
55
if (INTEL_GPU_PATTERN.test(renderer)) {
@@ -9,8 +9,6 @@ export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" {
99
return "arm64";
1010
}
1111

12-
// Generic "Apple GPU" renderers are ambiguous on Safari. x64 is the safe
13-
// fallback because Apple Silicon can run it through Rosetta, while Intel
14-
// Macs cannot run an arm64 build.
12+
// Keep the fallback compatible with Intel Macs when WebGL is unavailable.
1513
return "x64";
1614
}

0 commit comments

Comments
 (0)