diff --git a/src/Server/__tests__/getWebpackEarlyHints.jest.ts b/src/Server/__tests__/getWebpackEarlyHints.jest.ts index 3f4c99ad983..014862461a9 100644 --- a/src/Server/__tests__/getWebpackEarlyHints.jest.ts +++ b/src/Server/__tests__/getWebpackEarlyHints.jest.ts @@ -1,13 +1,13 @@ import fs from "fs" import path from "path" -import { getWebpackEalyHints } from "Server/getWebpackEarlyHints" +import { getWebpackEarlyHints } from "Server/getWebpackEarlyHints" jest.mock("fs") jest.mock("Server/config", () => ({ CDN_URL: "https://cdn.example.com" })) const HINTS_PATH = path.join(process.cwd(), "public/assets", "early-hints.json") -describe("getWebpackEalyHints", () => { +describe("getWebpackEarlyHints", () => { const mockReadFileSync = fs.readFileSync as jest.Mock afterEach(() => { @@ -20,7 +20,7 @@ describe("getWebpackEalyHints", () => { mockReadFileSync.mockReturnValueOnce(JSON.stringify(mockChunkFiles)) - const result = getWebpackEalyHints() + const result = getWebpackEarlyHints() expect(fs.readFileSync).toHaveBeenCalledWith(HINTS_PATH, "utf-8") expect(result.linkHeaders).toEqual([ @@ -39,7 +39,7 @@ describe("getWebpackEalyHints", () => { mockReadFileSync.mockReturnValueOnce(JSON.stringify(mockChunkFiles)) - const result = getWebpackEalyHints() + const result = getWebpackEarlyHints() expect(fs.readFileSync).toHaveBeenCalledWith(HINTS_PATH, "utf-8") expect(result.linkHeaders).toEqual([ diff --git a/src/Server/getWebpackEarlyHints.ts b/src/Server/getWebpackEarlyHints.ts index 4474bac53bd..60de6c0aa4a 100644 --- a/src/Server/getWebpackEarlyHints.ts +++ b/src/Server/getWebpackEarlyHints.ts @@ -4,7 +4,7 @@ import fs from "fs" const HINTS_PATH = path.join(process.cwd(), "public/assets", "early-hints.json") -export const getWebpackEalyHints = (): { +export const getWebpackEarlyHints = (): { linkHeaders: string[] linkPreloadTags: string[] } => { diff --git a/src/Server/middleware/linkHeadersMiddleware.ts b/src/Server/middleware/linkHeadersMiddleware.ts index 5a961c904fb..bc6ad6bc448 100644 --- a/src/Server/middleware/linkHeadersMiddleware.ts +++ b/src/Server/middleware/linkHeadersMiddleware.ts @@ -1,7 +1,7 @@ import type { NextFunction } from "express" import type { ArtsyRequest, ArtsyResponse } from "./artsyExpress" import { CDN_URL, GEMINI_CLOUDFRONT_URL, WEBFONT_URL } from "Server/config" -import { getWebpackEalyHints } from "Server/getWebpackEarlyHints" +import { getWebpackEarlyHints } from "Server/getWebpackEarlyHints" /** * Link headers allow 103: Early Hints to be sent to the client (by Cloudflare). @@ -13,7 +13,7 @@ export function linkHeadersMiddleware( res: ArtsyResponse, next: NextFunction ) { - const { linkHeaders } = getWebpackEalyHints() + const { linkHeaders } = getWebpackEarlyHints() if (!res.headersSent) { res.header("Link", [ diff --git a/src/System/Router/renderServerApp.tsx b/src/System/Router/renderServerApp.tsx index 2c40563ae34..682e9d323c5 100644 --- a/src/System/Router/renderServerApp.tsx +++ b/src/System/Router/renderServerApp.tsx @@ -7,7 +7,7 @@ import { getENV } from "Utils/getENV" import { ServerAppResults } from "System/Router/serverRouter" import { Transform } from "stream" import { ENABLE_SSR_STREAMING } from "Server/config" -import { getWebpackEalyHints } from "Server/getWebpackEarlyHints" +import { getWebpackEarlyHints } from "Server/getWebpackEarlyHints" // TODO: Use the same variables as the asset middleware. Both config and sharify // have a default CDN_URL while this does not. @@ -50,7 +50,7 @@ export const renderServerApp = ({ const scripts = extractScriptTags?.() - const { linkPreloadTags } = getWebpackEalyHints() + const { linkPreloadTags } = getWebpackEarlyHints() const options = { cdnUrl: NODE_ENV === "production" ? CDN_URL : "",