Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quiet-zebras-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@qwik.dev/router': patch
---

fix: preserve tree-shaking for the exported zod namespace
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,7 @@ export default component$(() => {
if (action1.value) {
if (action1.value.failed) {
action1.value satisfies { failed: true } & (
| TypedDataValidatorError
| DataValidatorError
| ActionFailedObject
TypedDataValidatorError | DataValidatorError | ActionFailedObject
);
} else {
action1.value satisfies ActionSuccessObject;
Expand Down Expand Up @@ -116,9 +114,7 @@ export default component$(() => {
if (action4.value) {
if (action4.value.failed) {
action4.value satisfies { failed: true } & (
| TypedDataValidatorError
| DataValidatorError
| ActionFailedObject
TypedDataValidatorError | DataValidatorError | ActionFailedObject
);
} else {
action4.value satisfies ActionSuccessObject;
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"@clack/prompts": "0.11.0",
"@eslint/js": "9.39.2",
"@mdx-js/mdx": "3.1.1",
"@microsoft/api-documenter": "7.29.6",
"@microsoft/api-extractor": "7.57.6",
"@microsoft/api-documenter": "7.30.10",
"@microsoft/api-extractor": "7.58.12",
"@napi-rs/cli": "2.18.4",
"@napi-rs/triples": "1.2.0",
"@node-rs/helper": "1.6.0",
Expand All @@ -130,7 +130,7 @@
"@types/tmp": "0.2.6",
"@types/which-pm-runs": "1.0.2",
"@vitejs/plugin-basic-ssl": "2.1.4",
"@vitest/coverage-v8": "4.0.18",
"@vitest/coverage-v8": "4.1.10",
"all-contributors-cli": "6.26.1",
"brotli": "1.3.3",
"create-qwik": "workspace:*",
Expand All @@ -150,9 +150,9 @@
"monaco-editor": "0.54.0",
"mri": "1.2.0",
"path-browserify": "1.0.1",
"prettier": "3.7.4",
"prettier-plugin-jsdoc": "1.8.0",
"prettier-plugin-tailwindcss": "0.7.2",
"prettier": "3.9.6",
"prettier-plugin-jsdoc": "1.8.1",
"prettier-plugin-tailwindcss": "0.8.1",
"pretty-quick": "4.2.2",
"prompts": "2.4.2",
"rollup": "4.61.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser-extension/public/qwikloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const l = (e, t) => Array.from(e.querySelectorAll(t)),
p = (t) => {
if (void 0 === t._qwikjson_) {
let n = (t === e.documentElement ? e.body : t).lastElementChild;
for (; n; ) {
for (; n;) {
if ('SCRIPT' === n.tagName && 'qwik/json' === n.getAttribute('type')) {
t._qwikjson_ = JSON.parse(n.textContent.replace(/\\x3C(\/?script)/gi, '<$1'));
break;
Expand Down Expand Up @@ -105,7 +105,7 @@ const l = (e, t) => Array.from(e.querySelectorAll(t)),
const t = g(e.type),
n = 'e:' + t;
let o = e.target;
for (; o && o.getAttribute; ) {
for (; o && o.getAttribute;) {
const r = w(o, e, n, t),
s = e.bubbles && !e.cancelBubble;
(f(r) && (await r), (o = s && e.bubbles && !e.cancelBubble ? o.parentElement : null));
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools/kit/src/client-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ function getPageWindow(isBrowser: boolean): Window | null {

function getHook(pageWindow: Window | null): QwikDevtoolsHookExtended | undefined {
return getQwikDevtoolsGlobal(pageWindow)?.[QWIK_DEVTOOLS_GLOBAL.props.hook] as
| QwikDevtoolsHookExtended
| undefined;
QwikDevtoolsHookExtended | undefined;
}

export function createInPageBridge(options: InPageBridgeOptions): InPageBridge {
Expand Down
6 changes: 1 addition & 5 deletions packages/devtools/kit/src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ export type QwikPreloadOriginKind =
| 'unknown';
export type QwikPreloadPhase = 'csr' | 'ssr' | 'unknown';
export type QwikPreloadMatchMode =
| 'href'
| 'normalized-href'
| 'chunk-hash'
| 'resource-name'
| 'none';
'href' | 'normalized-href' | 'chunk-hash' | 'resource-name' | 'none';
export type QwikPreloadLoadMatchQuality = 'best-effort' | 'none';

export interface QwikPreloadQrlRequestRemembered {
Expand Down
4 changes: 2 additions & 2 deletions packages/devtools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"nodemon": "3.1.14",
"np": "11.0.2",
"postcss": "8.5.18",
"prettier": "3.7.4",
"prettier-plugin-tailwindcss": "0.7.2",
"prettier": "3.9.6",
"prettier-plugin-tailwindcss": "0.8.1",
"react": "19.2.4",
"react-dom": "19.2.4",
"shiki": "4.0.2",
Expand Down
8 changes: 1 addition & 7 deletions packages/devtools/ui/src/components/Tree/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ export type StoreTarget = Record<string | symbol, StoreValue>;
export type TreeNodePropValue = string | number | boolean | null | undefined | object;

export type ElementType =
| 'null'
| 'boolean'
| 'number'
| 'string'
| 'function'
| 'array'
| 'object';
'null' | 'boolean' | 'number' | 'string' | 'function' | 'array' | 'object';

export interface TreeNode {
name?: string;
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools/ui/src/devtools/page-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,7 @@ const defaultSource = new InPageDataSource();
export function getPageDataSource(): PageDataSource {
const source = isBrowser
? (getQwikDevtoolsGlobal(window)?.[QWIK_DEVTOOLS_GLOBAL.props.pageDataSource] as
| PageDataSource
| undefined)
PageDataSource | undefined)
: undefined;
if (source) {
return source;
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools/ui/src/devtools/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ const viteDataProvider: DataProvider = {
export async function loadDevtoolsData(state: DevtoolsState) {
const provider =
(getQwikDevtoolsGlobal(window)?.[QWIK_DEVTOOLS_GLOBAL.props.dataProvider] as
| DataProvider
| undefined) ?? viteDataProvider;
DataProvider | undefined) ?? viteDataProvider;
await provider.loadData(state);
}
3 changes: 1 addition & 2 deletions packages/devtools/ui/src/features/HookTree/HookTree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ export const HookTree = component$(() => {
}

const qrlChunk = (node.props as Record<string, unknown> | undefined)?.__qrlChunk as
| string
| undefined;
string | undefined;
selectedNode.value = { name, nodeId: node.id, qrlChunk };

// Read hooks from global state AND VNode props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ export function toTreeNodes(vnodes: VNodeTreeNode[]): TreeNode[] {
name: v.name,
label: v.name,
props: v.props as
| Record<string, string | number | boolean | null | undefined | object>
| undefined,
Record<string, string | number | boolean | null | undefined | object> | undefined,
children: v.children ? toTreeNodes(v.children) : undefined,
}));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ export class HookStore {

findScopeVariables(item: HookDataEntry): string {
const targets = (item.data as Record<string, unknown>)?.[QWIK_VNODE_PROTOCOL.qrl.captureRef] as
| unknown[]
| undefined;
unknown[] | undefined;

if (!targets) {
return 'Scope []';
Expand Down
3 changes: 1 addition & 2 deletions packages/devtools/ui/src/runtime/preloads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ const syncLoadDuration = (entry: QwikPreloadEntryRemembered, loadDuration?: numb
const createStore = (): MutablePreloadStore => {
const devtoolsGlobal = getOrCreateQwikDevtoolsGlobal(window);
const existing = devtoolsGlobal[QWIK_DEVTOOLS_GLOBAL.props.preloads] as
| MutablePreloadStore
| undefined;
MutablePreloadStore | undefined;
if (existing) {
return existing;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"magic-string": "0.30.21",
"pagefind": "1.4.0",
"playwright": "1.61.0",
"prettier": "3.7.4",
"prettier": "3.9.6",
"prism-themes": "1.9.0",
"prismjs": "1.30.0",
"qwik-image": "0.0.16",
Expand Down
5 changes: 1 addition & 4 deletions packages/docs/src/repl/bundler/repl-ssr-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ export interface SSRErrorMessage extends MessageBase {

type IncomingMessage = InitSSRMessage;
export type OutgoingMessage =
| SSRReadyMessage
| SSRResultMessage
| SSRChunkMessage
| SSRErrorMessage;
SSRReadyMessage | SSRResultMessage | SSRChunkMessage | SSRErrorMessage;

let replId: string;

Expand Down
7 changes: 1 addition & 6 deletions packages/docs/src/repl/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ export interface SSRErrorMessage {
}

export type OutputPanel =
| 'app'
| 'html'
| 'segments'
| 'clientBundles'
| 'serverModules'
| 'diagnostics';
'app' | 'html' | 'segments' | 'clientBundles' | 'serverModules' | 'diagnostics';

export type OutputDetail = 'options' | 'console';
3 changes: 1 addition & 2 deletions packages/docs/src/routes/api/qwik-optimizer/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,7 @@ registerBundleGraphAdder

```typescript
export type QwikVitePluginOptions =
| QwikVitePluginCSROptions
| QwikVitePluginSSROptions;
QwikVitePluginCSROptions | QwikVitePluginSSROptions;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-vite/src/plugins/vite.ts)
Expand Down
28 changes: 11 additions & 17 deletions packages/docs/src/routes/api/qwik-router/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,7 @@ Note: valid cacheKeys are non-empty strings.

```typescript
export type CacheKeyFn =
| true
| ((requestEv: RequestEvent, eTag: string) => string | null);
true | ((requestEv: RequestEvent, eTag: string) => string | null);
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/types.ts)
Expand Down Expand Up @@ -360,8 +359,7 @@ When set (and a value is produced), the server includes an `ETag` header and ret

```typescript
export type ContentModuleETag =
| string
| ((props: DocumentHeadProps) => string | null);
string | ((props: DocumentHeadProps) => string | null);
```

**References:** [DocumentHeadProps](#documentheadprops)
Expand Down Expand Up @@ -459,8 +457,7 @@ export type DataValidator<T extends Record<string, any> = {}> = {

```typescript
export type DocumentHead =
| DocumentHeadValue
| ((props: DocumentHeadProps) => DocumentHeadValue);
DocumentHeadValue | ((props: DocumentHeadProps) => DocumentHeadValue);
```

**References:** [DocumentHeadValue](#documentheadvalue), [DocumentHeadProps](#documentheadprops)
Expand Down Expand Up @@ -2162,8 +2159,7 @@ When a module exports `routeConfig`, the separate `head`, `eTag`, and `cacheKey`

```typescript
export type RouteConfig =
| RouteConfigValue
| ((props: DocumentHeadProps) => RouteConfigValue);
RouteConfigValue | ((props: DocumentHeadProps) => RouteConfigValue);
```

**References:** [RouteConfigValue](#routeconfigvalue), [DocumentHeadProps](#documentheadprops)
Expand Down Expand Up @@ -2674,7 +2670,7 @@ export type ServerData = {
};
```

**References:** [Q_ROUTE](#q_route), [QwikRouterEnvData](#qwikrouterenvdata)
**References:** [Q\_ROUTE](#q_route), [QwikRouterEnvData](#qwikrouterenvdata)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/types.ts)

Expand Down Expand Up @@ -3086,9 +3082,8 @@ export type ValidatorErrorKeyDotNotation<T, Prefix extends string = ""> =
? IsAny<U> extends true
? never
: U extends object
?
| `${Prefix}${K}[]`
| ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`>
? | `${Prefix}${K}[]`
| ValidatorErrorKeyDotNotation<U, `${Prefix}${K}[].`>
: `${Prefix}${K}[]`
: T[K] extends object
? ValidatorErrorKeyDotNotation<T[K], `${Prefix}${K}.`>
Expand All @@ -3107,9 +3102,9 @@ export type ValidatorErrorKeyDotNotation<T, Prefix extends string = ""> =
export type ValidatorErrorType<T, U = string> = {
formErrors: U[];
fieldErrors: Partial<{
[K in ValidatorErrorKeyDotNotation<T>]: K extends `${infer _Prefix}[]${infer _Suffix}`
? U[]
: U;
[
K in ValidatorErrorKeyDotNotation<T>
]: K extends `${infer _Prefix}[]${infer _Suffix}` ? U[] : U;
}>;
};
```
Expand All @@ -3122,8 +3117,7 @@ export type ValidatorErrorType<T, U = string> = {

```typescript
export type ValidatorReturn<T extends Record<string, any> = {}> =
| ValidatorReturnSuccess
| ValidatorReturnFail<T>;
ValidatorReturnSuccess | ValidatorReturnFail<T>;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/types.ts)
Expand Down
31 changes: 9 additions & 22 deletions packages/docs/src/routes/api/qwik/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ Description
</th></tr></thead>
<tbody><tr><td>

\_\_brand_context_type\_\_
\_\_brand\_context\_type\_\_

</td><td>

Expand Down Expand Up @@ -2543,13 +2543,7 @@ Any valid output for a component

```typescript
export type JSXOutput =
| JSXNode
| string
| number
| boolean
| null
| undefined
| JSXOutput[];
JSXNode | string | number | boolean | null | undefined | JSXOutput[];
```

**References:** [JSXNode](#jsxnode), [JSXOutput](#jsxoutput)
Expand Down Expand Up @@ -2656,8 +2650,7 @@ _(Optional)_

```typescript
export type JSXTagName =
| keyof HTMLElementTagNameMap
| Omit<string, keyof HTMLElementTagNameMap>;
keyof HTMLElementTagNameMap | Omit<string, keyof HTMLElementTagNameMap>;
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-qwik-attributes.ts)
Expand Down Expand Up @@ -3318,10 +3311,7 @@ An event handler for Qwik events, can be a handler QRL or an array of handler QR

```typescript
export type QRLEventHandlerMulti<EV extends Event, EL> =
| QRL<EventHandler<EV, EL>>
| undefined
| null
| QRLEventHandlerMulti<EV, EL>[];
QRL<EventHandler<EV, EL>> | undefined | null | QRLEventHandlerMulti<EV, EL>[];
```

**References:** [QRL](#qrl-type-alias), [EventHandler](#eventhandler), [QRLEventHandlerMulti](#qrleventhandlermulti)
Expand Down Expand Up @@ -3682,10 +3672,9 @@ The SVG props without plain handlers, for use inside functions

```typescript
export type QwikSVGElements = {
[K in keyof Omit<
SVGElementTagNameMap,
keyof HTMLElementTagNameMap
>]: SVGProps<SVGElementTagNameMap[K]>;
[
K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>
]: SVGProps<SVGElementTagNameMap[K]>;
};
```

Expand Down Expand Up @@ -10679,7 +10668,7 @@ export type ValueOrPromise<T> = T | Promise<T>;

<h2 id="version">version</h2>

QWIK_VERSION
QWIK\_VERSION

```typescript
version: string;
Expand All @@ -10691,9 +10680,7 @@ version: string;

```typescript
export type VisibleTaskStrategy =
| "intersection-observer"
| "document-ready"
| "document-idle";
"intersection-observer" | "document-ready" | "document-idle";
```

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/use/use-visible-task.ts)
Expand Down
Loading
Loading