fix(marketing): Safari gets the arm64 Mac download (#7473)

This commit is contained in:
Theo Browne authored and GitHub committed 2026-08-18 23:47:39 -04:00
1 parent 324ddda314
commit 5ea5a80a83
2 files changed
+7 -6

No files matched your search

+5 -2
View File
@@ -13,8 +13,11 @@ describe("macArchFromGpuRenderer", () => {
);
});
it("uses x64 for ambiguous Safari and unavailable renderer values", () => {
expect(macArchFromGpuRenderer("Apple GPU")).toBe("x64");
it("detects Safari's generic Apple Silicon renderer", () => {
expect(macArchFromGpuRenderer("Apple GPU")).toBe("arm64");
});
it("uses x64 when the renderer is unavailable", () => {
expect(macArchFromGpuRenderer("")).toBe("x64");
});
});
+2 -4
View File
@@ -1,5 +1,5 @@
const INTEL_GPU_PATTERN = /intel|amd|radeon|nvidia|geforce/i;
const APPLE_SILICON_GPU_PATTERN = /\bapple\s+m\d/i;
const APPLE_SILICON_GPU_PATTERN = /\bapple\s+(?:m\d|gpu)\b/i;
export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" {
if (INTEL_GPU_PATTERN.test(renderer)) {
@@ -9,8 +9,6 @@ export function macArchFromGpuRenderer(renderer: string): "arm64" | "x64" {
return "arm64";
}
// Generic "Apple GPU" renderers are ambiguous on Safari. x64 is the safe
// fallback because Apple Silicon can run it through Rosetta, while Intel
// Macs cannot run an arm64 build.
// Keep the fallback compatible with Intel Macs when WebGL is unavailable.
return "x64";
}