Skip to content

Commit b1d99a6

Browse files
authored
Merge pull request #8025 from QwikDev/v2-merge-main
chore: merge main into v2
2 parents 3ed9cd0 + dd0db9b commit b1d99a6

32 files changed

+1428
-1148
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ jobs:
258258
- host: macos-latest
259259
target: aarch64-apple-darwin
260260

261-
- host: windows-latest
261+
# Note: 2025 image breaks rollup
262+
- host: windows-2022
262263
target: x86_64-pc-windows-msvc
263264

264265
name: Build optimizer ${{ matrix.settings.target }}
@@ -665,8 +666,9 @@ jobs:
665666
# browser: firefox
666667
- host: macos-latest
667668
browser: webkit
668-
- host: windows-latest
669-
browser: chromium
669+
# flaky. Updating node version or sharp/sqlite3 related deps might help.
670+
# - host: windows-2022
671+
# browser: chromium
670672

671673
runs-on: ${{ matrix.settings.host }}
672674

@@ -712,7 +714,7 @@ jobs:
712714
run: pnpm run test.e2e.qwik-react.${{ matrix.settings.browser }} --timeout 60000 --retries 7 --workers 1
713715

714716
- name: Validate Create Qwik Cli
715-
if: matrix.settings.host != 'windows-latest'
717+
if: matrix.settings.host != 'windows-2022'
716718
run: pnpm cli.validate
717719

718720
############ E2E CLI TEST ############
@@ -730,7 +732,7 @@ jobs:
730732
settings:
731733
- host: ubuntu-latest
732734
- host: macos-latest
733-
- host: windows-latest
735+
- host: windows-2022
734736

735737
runs-on: ${{ matrix.settings.host }}
736738

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"prettier-plugin-tailwindcss": "0.6.14",
144144
"pretty-quick": "4.2.2",
145145
"prompts": "2.4.2",
146-
"rollup": ">= 4.52.0",
146+
"rollup": "4.52.3",
147147
"semver": "7.7.2",
148148
"simple-git-hooks": "2.13.1",
149149
"snoop": "1.0.4",

packages/docs/src/repl/bundler/rollup-plugins.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const replResolver = (
4242
}
4343
return {
4444
// Make sure this matches the regexes in manifest.ts
45-
id: `/node_modules/@qwik.dev/core${id}`,
45+
id: `/qwik${id}`,
4646
sideEffects: false,
4747
// It would be nice to load qwik as external, but
4848
// we import core and core/build so we need processing
@@ -59,15 +59,16 @@ export const replResolver = (
5959
if (id.startsWith('http')) {
6060
return { id, external: true };
6161
}
62-
if (id.startsWith('/node_modules/@qwik.dev/core/')) {
62+
// re-resolve
63+
if (id.startsWith('/qwik/')) {
6364
return id;
6465
}
6566
const match = id.match(/(@builder\.io\/qwik|@qwik\.dev\/core)(.*)/);
6667
if (match) {
6768
const pkgName = match[2];
6869

6970
if (pkgName === '/build') {
70-
return `/node_modules/@qwik.dev/core/build`;
71+
return `/qwik/build`;
7172
}
7273
if (
7374
!pkgName ||
@@ -113,8 +114,8 @@ export const replResolver = (
113114
if (input && typeof input.code === 'string') {
114115
return input.code;
115116
}
116-
if (id.startsWith('/node_modules/@qwik.dev/core/')) {
117-
const path = id.slice('/node_modules/@qwik.dev/core'.length);
117+
if (id.startsWith('/qwik/')) {
118+
const path = id.slice('/qwik'.length);
118119
if (path === '/build') {
119120
// Virtual module for Qwik build
120121
const isDev = options.buildMode === 'development';

packages/docs/src/repl/ui/repl-output-segments.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { CodeBlock } from '../../components/code-block/code-block';
33
import { $, component$, useSignal } from '@qwik.dev/core';
44
const FILE_MODULE_DIV_ID = 'file-modules-symbol';
55

6+
type TransformModuleV2 = TransformModule & {
7+
segment?: { canonicalFilename: string; paramNames: string[]; captureNames: string[] };
8+
};
9+
610
export const ReplOutputSymbols = component$(({ outputs }: ReplOutputSymbolsProps) => {
711
const selectedPath = useSignal(outputs.length ? outputs[0].path : '');
812
const pathInView$ = $((path: string) => {
@@ -38,7 +42,7 @@ export const ReplOutputSymbols = component$(({ outputs }: ReplOutputSymbolsProps
3842
</div>
3943
</div>
4044
<div class="file-modules" id={FILE_MODULE_DIV_ID}>
41-
{segments.map((o, i) => (
45+
{(segments as TransformModuleV2[]).map((o, i) => (
4246
<div class="file-item" data-symbol-item={i} key={o.path}>
4347
<div class="file-info">
4448
<span>{o.segment?.canonicalFilename}</span>

packages/docs/src/routes/api/qwik-server/api.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@
151151
"id": "qwikloaderoptions"
152152
}
153153
],
154-
"kind": "Interface",
155-
"content": "```typescript\nexport interface QwikLoaderOptions \n```\n\n\n<table><thead><tr><th>\n\nProperty\n\n\n</th><th>\n\nModifiers\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[include?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n'always' \\| 'never' \\| 'auto'\n\n\n</td><td>\n\n_(Optional)_ Whether to include the qwikloader script in the document. Normally you don't need to worry about this, but in case of multi-container apps using different Qwik versions, you might want to only enable it on one of the containers.\n\nDefaults to `'auto'`<!-- -->.\n\n\n</td></tr>\n<tr><td>\n\n[position?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n'top' \\| 'bottom'\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>",
154+
"kind": "TypeAlias",
155+
"content": "```typescript\nexport type QwikLoaderOptions = 'module' | 'inline' | 'never' | {\n include?: 'always' | 'never' | 'auto';\n position?: 'top' | 'bottom';\n};\n```",
156156
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts",
157157
"mdFile": "core.qwikloaderoptions.md"
158158
},
@@ -180,7 +180,7 @@
180180
}
181181
],
182182
"kind": "Interface",
183-
"content": "```typescript\nexport interface RenderOptions extends SerializeDocumentOptions \n```\n**Extends:** [SerializeDocumentOptions](#serializedocumentoptions)\n\n\n<table><thead><tr><th>\n\nProperty\n\n\n</th><th>\n\nModifiers\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[base?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\n\n\n</td><td>\n\n_(Optional)_ Specifies the root of the JS files of the client build. Setting a base, will cause the render of the `q:base` attribute in the `q:container` element.\n\n\n</td></tr>\n<tr><td>\n\n[containerAttributes?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[containerTagName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_ When set, the app is serialized into a fragment. And the returned html is not a complete document. Defaults to `html`\n\n\n</td></tr>\n<tr><td>\n\n[locale?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\n\n\n</td><td>\n\n_(Optional)_ Language to use when rendering the document.\n\n\n</td></tr>\n<tr><td>\n\n[prefetchStrategy?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[PrefetchStrategy](#prefetchstrategy) \\| null\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[preloader?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[PreloaderOptions](#preloaderoptions) \\| false\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[qwikLoader?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[QwikLoaderOptions](#qwikloaderoptions)\n\n\n</td><td>\n\n_(Optional)_ Specifies if the Qwik Loader script is added to the document or not.\n\nDefaults to `{ include: true }`<!-- -->.\n\n\n</td></tr>\n<tr><td>\n\n[serverData?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n\n</td><td>\n\n_(Optional)_ Metadata that can be retrieved during SSR with `useServerData()`<!-- -->.\n\n\n</td></tr>\n<tr><td>\n\n[snapshot?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_ Defaults to `true`\n\n\n</td></tr>\n</tbody></table>",
183+
"content": "```typescript\nexport interface RenderOptions extends SerializeDocumentOptions \n```\n**Extends:** [SerializeDocumentOptions](#serializedocumentoptions)\n\n\n<table><thead><tr><th>\n\nProperty\n\n\n</th><th>\n\nModifiers\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\n[base?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\n\n\n</td><td>\n\n_(Optional)_ Specifies the root of the JS files of the client build. Setting a base, will cause the render of the `q:base` attribute in the `q:container` element.\n\n\n</td></tr>\n<tr><td>\n\n[containerAttributes?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nRecord&lt;string, string&gt;\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[containerTagName?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring\n\n\n</td><td>\n\n_(Optional)_ When set, the app is serialized into a fragment. And the returned html is not a complete document. Defaults to `html`\n\n\n</td></tr>\n<tr><td>\n\n[locale?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nstring \\| ((options: [RenderOptions](#renderoptions)<!-- -->) =&gt; string)\n\n\n</td><td>\n\n_(Optional)_ Language to use when rendering the document.\n\n\n</td></tr>\n<tr><td>\n\n[prefetchStrategy?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[PrefetchStrategy](#prefetchstrategy) \\| null\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n<tr><td>\n\n[preloader?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[PreloaderOptions](#preloaderoptions) \\| false\n\n\n</td><td>\n\n_(Optional)_ Specifies how preloading is handled. This ensures that code is instantly available when needed.\n\n\n</td></tr>\n<tr><td>\n\n[qwikLoader?](#)\n\n\n</td><td>\n\n\n</td><td>\n\n[QwikLoaderOptions](#qwikloaderoptions)\n\n\n</td><td>\n\n_(Optional)_ Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy loading.\n\n`module`<!-- -->: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the script cached and instantly running.\n\n`inline`<!-- -->: This embeds the Qwik Loader script directly in the document. This adds about 3kB before compression, which typically is reduced to about 1.6kB with gzip.\n\n`never`<!-- -->: Do not include the Qwik Loader script. This is mostly useful when embedding multiple containers on the same page.\n\nDefaults to `module`<!-- -->.\n\nNote that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of it loaded for any interactivity to happen.\n\n\n</td></tr>\n<tr><td>\n\n[serverData?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nRecord&lt;string, any&gt;\n\n\n</td><td>\n\n_(Optional)_ Metadata that can be retrieved during SSR with `useServerData()`<!-- -->.\n\n\n</td></tr>\n<tr><td>\n\n[snapshot?](#)\n\n\n</td><td>\n\n\n</td><td>\n\nboolean\n\n\n</td><td>\n\n_(Optional)_ Defaults to `true`\n\n\n</td></tr>\n</tbody></table>",
184184
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts",
185185
"mdFile": "core.renderoptions.md"
186186
},

packages/docs/src/routes/api/qwik-server/index.mdx

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -589,60 +589,16 @@ Defaults to `5`
589589
## QwikLoaderOptions
590590

591591
```typescript
592-
export interface QwikLoaderOptions
592+
export type QwikLoaderOptions =
593+
| "module"
594+
| "inline"
595+
| "never"
596+
| {
597+
include?: "always" | "never" | "auto";
598+
position?: "top" | "bottom";
599+
};
593600
```
594601

595-
<table><thead><tr><th>
596-
597-
Property
598-
599-
</th><th>
600-
601-
Modifiers
602-
603-
</th><th>
604-
605-
Type
606-
607-
</th><th>
608-
609-
Description
610-
611-
</th></tr></thead>
612-
<tbody><tr><td>
613-
614-
[include?](#)
615-
616-
</td><td>
617-
618-
</td><td>
619-
620-
'always' \| 'never' \| 'auto'
621-
622-
</td><td>
623-
624-
_(Optional)_ Whether to include the qwikloader script in the document. Normally you don't need to worry about this, but in case of multi-container apps using different Qwik versions, you might want to only enable it on one of the containers.
625-
626-
Defaults to `'auto'`.
627-
628-
</td></tr>
629-
<tr><td>
630-
631-
[position?](#)
632-
633-
</td><td>
634-
635-
</td><td>
636-
637-
'top' \| 'bottom'
638-
639-
</td><td>
640-
641-
_(Optional)_
642-
643-
</td></tr>
644-
</tbody></table>
645-
646602
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/server/types.ts)
647603

648604
## Render
@@ -767,7 +723,7 @@ _(Optional)_
767723
768724
</td><td>
769725
770-
_(Optional)_
726+
_(Optional)_ Specifies how preloading is handled. This ensures that code is instantly available when needed.
771727
772728
</td></tr>
773729
<tr><td>
@@ -782,9 +738,17 @@ _(Optional)_
782738
783739
</td><td>
784740
785-
_(Optional)_ Specifies if the Qwik Loader script is added to the document or not.
741+
_(Optional)_ Specifies how the Qwik Loader is included in the document. This enables interactivity and lazy loading.
742+
743+
`module`: Use a `<script>` tag to load the Qwik Loader. Subsequent page loads will have the script cached and instantly running.
744+
745+
`inline`: This embeds the Qwik Loader script directly in the document. This adds about 3kB before compression, which typically is reduced to about 1.6kB with gzip.
746+
747+
`never`: Do not include the Qwik Loader script. This is mostly useful when embedding multiple containers on the same page.
748+
749+
Defaults to `module`.
786750
787-
Defaults to `{ include: true }`.
751+
Note that the Qwik Loader is absolutely required for Qwik to work. There must be an instance of it loaded for any interactivity to happen.
788752
789753
</td></tr>
790754
<tr><td>

packages/docs/src/routes/api/qwik-testing/api.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
}
179179
],
180180
"kind": "Function",
181-
"content": "```typescript\nexport declare function ssrRenderToDom(jsx: JSXOutput, opts?: {\n debug?: boolean;\n raw?: boolean;\n}): Promise<{\n container: _DomContainer;\n document: Document;\n vNode: _VNode | null;\n getStyles: () => Record<string, string | string[]>;\n}>;\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\njsx\n\n\n</td><td>\n\nJSXOutput\n\n\n</td><td>\n\n\n</td></tr>\n<tr><td>\n\nopts\n\n\n</td><td>\n\n{ debug?: boolean; raw?: boolean; }\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;{ container: \\_DomContainer; document: Document; vNode: \\_VNode \\| null; getStyles: () =&gt; Record&lt;string, string \\| string\\[\\]&gt;; }&gt;",
181+
"content": "```typescript\nexport declare function ssrRenderToDom(jsx: JSXOutput, opts?: {\n debug?: boolean;\n raw?: boolean;\n qwikLoader?: boolean;\n}): Promise<{\n container: _DomContainer;\n document: Document;\n vNode: _VNode | null;\n getStyles: () => Record<string, string | string[]>;\n}>;\n```\n\n\n<table><thead><tr><th>\n\nParameter\n\n\n</th><th>\n\nType\n\n\n</th><th>\n\nDescription\n\n\n</th></tr></thead>\n<tbody><tr><td>\n\njsx\n\n\n</td><td>\n\nJSXOutput\n\n\n</td><td>\n\n\n</td></tr>\n<tr><td>\n\nopts\n\n\n</td><td>\n\n{ debug?: boolean; raw?: boolean; qwikLoader?: boolean; }\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>\n\n**Returns:**\n\nPromise&lt;{ container: \\_DomContainer; document: Document; vNode: \\_VNode \\| null; getStyles: () =&gt; Record&lt;string, string \\| string\\[\\]&gt;; }&gt;",
182182
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/testing/rendering.unit-util.tsx",
183183
"mdFile": "core.ssrrendertodom.md"
184184
},

packages/docs/src/routes/api/qwik-testing/index.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ export declare function ssrRenderToDom(
435435
opts?: {
436436
debug?: boolean;
437437
raw?: boolean;
438+
qwikLoader?: boolean;
438439
},
439440
): Promise<{
440441
container: _DomContainer;
@@ -474,7 +475,7 @@ opts
474475

475476
</td><td>
476477

477-
\{ debug?: boolean; raw?: boolean; }
478+
\{ debug?: boolean; raw?: boolean; qwikLoader?: boolean; }
478479

479480
</td><td>
480481

packages/docs/src/routes/docs/labs/insights/index.mdx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ contributors:
55
- gioboa
66
- mrhoodz
77
- thejackshelton
8-
updated_at: '2023-10-11T22:12:12Z'
8+
- maiieul
9+
updated_at: '2025-09-29T22:12:12Z'
910
created_at: '2023-06-22T22:13:24Z'
1011
---
1112

@@ -19,16 +20,12 @@ Insights allow your application to collect real user usage information to optimi
1920
## Architecture
2021

2122
The optimization consists of these parts:
22-
- A `<Insights>` component which collects real user usage data.
23+
- A `<Insights>` component which collects time based bundle execution data.
24+
- A `qwikInsights` Vite Plugin to apply the usage data during the build process.
2325
- A registered application inside the builder.io database.
24-
- A `qwikInsights` Vite Plugin to load and save real user usage data during the build process.
2526

26-
> NOTE:
27-
> To try this new feature please drop a message inside the [Qwik Discord server](https://qwik.dev/chat)
2827
> Currently Insights info is hosted in the Builder database. This information is about the execution of symbols/chunks in the application.
2928
> The implementation of the service is open-source and you have the choice to use ours or host your own.
30-
> (Please note, that this may become a paid service in the future.)
31-
3229
3330
## `<Insights>` component
3431

@@ -87,9 +84,10 @@ The `<Insights>` component collects this data:
8784
- The `pathname` part of the URL.
8885
- Random sessionID which identifies which symbol loads came from the same browser session.
8986
90-
NOTE: The `<Insights>` component does not collect any user-identifiable information.
87+
> The `<Insights>` component does not collect any user-identifiable information.
88+
89+
The data collected being based on the frequency bundles are being grouped together at the same time, it is **not** advised to share the same API key between your preview and production environments. During preview, developers might use the application in 3G throttling and click around, which can put unrelated bundles together. After that the import graph would be wrong, leading to over-preloading, and Insights would then base its future data collection based on those corrupted bundles. If that happened to you, we recommend creating a new API key for your production environment. In normal usage, you will release a new version of your application and there will be a long enough window for Insights to collect the data. In case you face over-preloading in your app, you can always re-create a new API key. Drop us a message in the [Qwik Discord server](https://qwik.dev/chat) if this becomes a recurrent issue for you.
9190
92-
The information collected is sent to builder.io database for storage.
9391
9492
## Vite integration
9593

packages/docs/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ export default defineConfig(() => {
254254
},
255255
},
256256
worker: {
257-
format: 'es',
257+
format: 'es' as const,
258258
},
259259
clearScreen: false,
260260
server: {

0 commit comments

Comments
 (0)