diff --git a/app/assets/btcpay-logo.svg b/app/assets/btcpay-logo.svg new file mode 100644 index 000000000..5d8592b71 --- /dev/null +++ b/app/assets/btcpay-logo.svg @@ -0,0 +1 @@ +btcpay3 \ No newline at end of file diff --git a/app/assets/shopify-logo.svg b/app/assets/shopify-logo.svg new file mode 100755 index 000000000..551074c35 --- /dev/null +++ b/app/assets/shopify-logo.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/square-logo.svg b/app/assets/square-logo.svg new file mode 100644 index 000000000..50468c551 --- /dev/null +++ b/app/assets/square-logo.svg @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/app/entry.server.tsx b/app/entry.server.tsx index a893ab879..96c4eb50f 100644 --- a/app/entry.server.tsx +++ b/app/entry.server.tsx @@ -13,6 +13,7 @@ import type { RenderToPipeableStreamOptions } from 'react-dom/server'; import { renderToPipeableStream } from 'react-dom/server'; import type { EntryContext, RouterContextProvider } from 'react-router'; import { ServerRouter } from 'react-router'; +import { PRERENDERED_PATHS } from './prerender-paths'; export const streamTimeout = 5_000; @@ -31,6 +32,20 @@ function handleRequest( let shellRendered = false; const userAgent = request.headers.get('user-agent'); + // react-router's prerender constructs requests with no user-agent header. + const isBuildTimePrerender = !userAgent; + + // Vercel currently doesn't serve prerendered HTML as static files when + // ssr:true (remix-run/react-router#14281) — requests for these paths + // fall through to the SSR function. Match them here so the outlining + // override below applies at runtime SSR too. Once the upstream adapter + // bug is fixed, this path-list check can be dropped; the no-UA check + // alone will cover real prerender invocations. + const pathname = new URL(request.url).pathname.replace(/\/+$/, '') || '/'; + const isPrerenderRoute = PRERENDERED_PATHS.includes(pathname); + + const shouldDisableOutlining = isBuildTimePrerender || isPrerenderRoute; + // Ensure requests from bots and SPA Mode renders wait for all content to load before responding // https://react.dev/reference/react-dom/server/renderToPipeableStream#waiting-for-all-content-to-load-for-crawlers-and-static-generation const readyOption: keyof RenderToPipeableStreamOptions = @@ -41,6 +56,29 @@ function handleRequest( const { pipe, abort } = renderToPipeableStream( , { + // React's streaming SSR uses progressiveChunkSize (default 12.8 KB) to + // optimize first paint: when the rendered HTML exceeds this threshold, + // React "outlines" the next Suspense boundary — it writes the fallback + // into the initial shell and emits the actual content later as a + // hidden