From 2aaf5244da219bc56ca013e785247a2cc205e949 Mon Sep 17 00:00:00 2001 From: maiieul Date: Wed, 4 Sep 2024 21:47:52 +0200 Subject: [PATCH] chore: start the experiment with modulepreload on qwik.dev --- packages/docs/src/entry.ssr.tsx | 11 +++++++++++ packages/docs/src/root.tsx | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/docs/src/entry.ssr.tsx b/packages/docs/src/entry.ssr.tsx index b88f9909ae5..9c52a04b6eb 100644 --- a/packages/docs/src/entry.ssr.tsx +++ b/packages/docs/src/entry.ssr.tsx @@ -14,5 +14,16 @@ export default function (opts: RenderToStreamOptions) { lang: 'en', ...opts.containerAttributes, }, + // Core Web Vitals experiment until October 1: Do not remove and do not bring back any SW until then! Reach out to @maiieul first if you believe you have a good reason to change this. + prefetchStrategy: { + implementation: { + linkInsert: 'html-append', + linkRel: 'modulepreload', + }, + }, + // Core Web Vitals experiment until October 1: Do not remove and do not bring back any SW until then! Reach out to @maiieul first if you believe you have a good reason to change this. + qwikPrefetchServiceWorker: { + include: false, + }, }); } diff --git a/packages/docs/src/root.tsx b/packages/docs/src/root.tsx index 4e1863e46e6..6632be0ff7e 100644 --- a/packages/docs/src/root.tsx +++ b/packages/docs/src/root.tsx @@ -1,5 +1,5 @@ import { component$, useContextProvider, useStore } from '@builder.io/qwik'; -import { QwikCityProvider, RouterOutlet, ServiceWorkerRegister } from '@builder.io/qwik-city'; +import { QwikCityProvider, RouterOutlet } from '@builder.io/qwik-city'; import RealMetricsOptimization from './components/real-metrics-optimization/real-metrics-optimization'; import { RouterHead } from './components/router-head/router-head'; import { GlobalStore, type SiteStore } from './context'; @@ -54,7 +54,8 @@ export default component$(() => {