Skip to content

Commit 46f2062

Browse files
committed
Merge remote-tracking branch 'origin/main' into v2-merge-main
2 parents d7daca3 + 3e6ae16 commit 46f2062

File tree

19 files changed

+1277
-1095
lines changed

19 files changed

+1277
-1095
lines changed

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 (!pkgName || pkgName === '/jsx-runtime' || pkgName === '/jsx-dev-runtime') {
7374
return resolveQwik('/dist/core.mjs');
@@ -108,8 +109,8 @@ export const replResolver = (
108109
if (input && typeof input.code === 'string') {
109110
return input.code;
110111
}
111-
if (id.startsWith('/node_modules/@qwik.dev/core/')) {
112-
const path = id.slice('/node_modules/@qwik.dev/core'.length);
112+
if (id.startsWith('/qwik/')) {
113+
const path = id.slice('/qwik'.length);
113114
if (path === '/build') {
114115
// Virtual module for Qwik build
115116
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/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
@@ -251,7 +251,7 @@ export default defineConfig(() => {
251251
},
252252
},
253253
worker: {
254-
format: 'es',
254+
format: 'es' as const,
255255
},
256256
clearScreen: false,
257257
server: {

packages/insights/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"devDependencies": {
1616
"@builder.io/qwik": "npm:@qwik.dev/core@*",
1717
"@builder.io/qwik-city": "npm:@qwik.dev/router@*",
18-
"@builder.io/vite-plugin-macro": "0.0.7",
1918
"@eslint/js": "9.33.0",
2019
"@netlify/edge-functions": "2.17.0",
2120
"@qwik.dev/core": "workspace:*",

packages/insights/vite.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { macroPlugin } from '@builder.io/vite-plugin-macro';
21
import { qwikInsights } from '@qwik.dev/core/insights/vite';
32
import { qwikVite } from '@qwik.dev/core/optimizer';
43
import { qwikRouter } from '@qwik.dev/router/vite';
@@ -23,7 +22,6 @@ export default defineConfig({
2322
},
2423
},
2524
plugins: [
26-
macroPlugin({ preset: 'pandacss' }),
2725
qwikRouter(),
2826
qwikVite({
2927
experimental: ['insights'],

packages/qwik/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"dependencies": {
1111
"csstype": "^3.1.3",
1212
"launch-editor": "^2.11.1",
13-
"rollup": ">= ^4.52.0"
13+
"rollup": "^4.52.3"
1414
},
1515
"devDependencies": {
1616
"@croct/json5-parser": "0.2.0",

0 commit comments

Comments
 (0)