Skip to content

feat: route loaders serialization #7466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: build/v2
Choose a base branch
from
Draft
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ export default tseslint.config(
},
},
{
files: ['packages/docs/**/*.{ts,tsx}'],
files: ['packages/docs/demo/**/*.{ts,tsx}'],
rules: {
'no-console': 'off',
},
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -177,6 +177,7 @@
"build.cli": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli --dev",
"build.cli.prod": "tsx --require ./scripts/runBefore.ts scripts/index.ts --cli",
"build.core": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwik --insights --qwikrouter --api --platform-binding",
"build.router": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --qwikrouter --api",
"build.eslint": "tsx --require ./scripts/runBefore.ts scripts/index.ts --eslint",
"build.full": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --qwik --insights --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding --wasm",
"build.local": "tsx --require ./scripts/runBefore.ts scripts/index.ts --tsc --tsc-docs --qwik --insights --supabaseauthhelpers --api --eslint --qwikrouter --qwikworker --qwikreact --cli --platform-binding-wasm-copy",
32 changes: 2 additions & 30 deletions packages/docs/src/routes/api/qwik/api.json
Original file line number Diff line number Diff line change
@@ -672,20 +672,6 @@
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/jsx-runtime.ts",
"mdFile": "core.h.md"
},
{
"name": "HTMLElementAttrs",
"id": "htmlelementattrs",
"hierarchy": [
{
"name": "HTMLElementAttrs",
"id": "htmlelementattrs"
}
],
"kind": "Interface",
"content": "```typescript\nexport interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement> \n```\n**Extends:** HTMLAttributesBase, FilterBase&lt;HTMLElement&gt;",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts",
"mdFile": "core.htmlelementattrs.md"
},
{
"name": "implicit$FirstArg",
"id": "implicit_firstarg",
@@ -1318,7 +1304,7 @@
}
],
"kind": "TypeAlias",
"content": "The DOM props without plain handlers, for use inside functions\n\n\n```typescript\nexport type QwikHTMLElements = {\n [tag in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[tag], SpecialAttrs[tag]> & HTMLElementAttrs & QwikAttributes<HTMLElementTagNameMap[tag]>;\n};\n```\n**References:** [HTMLElementAttrs](#htmlelementattrs)<!-- -->, [QwikAttributes](#qwikattributes)",
"content": "The DOM props without plain handlers, for use inside functions\n\n\n```typescript\nexport type QwikHTMLElements = {\n [tag in keyof HTMLElementTagNameMap]: Augmented<HTMLElementTagNameMap[tag], SpecialAttrs[tag]> & HTMLElementAttrs & QwikAttributes<HTMLElementTagNameMap[tag]>;\n};\n```\n**References:** [QwikAttributes](#qwikattributes)",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts",
"mdFile": "core.qwikhtmlelements.md"
},
@@ -1458,7 +1444,7 @@
}
],
"kind": "TypeAlias",
"content": "The SVG props without plain handlers, for use inside functions\n\n\n```typescript\nexport type QwikSVGElements = {\n [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<SVGElementTagNameMap[K]>;\n};\n```\n**References:** [SVGProps](#svgprops)",
"content": "The SVG props without plain handlers, for use inside functions\n\n\n```typescript\nexport type QwikSVGElements = {\n [K in keyof Omit<SVGElementTagNameMap, keyof HTMLElementTagNameMap>]: SVGProps<SVGElementTagNameMap[K]>;\n};\n```",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts",
"mdFile": "core.qwiksvgelements.md"
},
@@ -2008,20 +1994,6 @@
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts",
"mdFile": "core.svgattributes.md"
},
{
"name": "SVGProps",
"id": "svgprops",
"hierarchy": [
{
"name": "SVGProps",
"id": "svgprops"
}
],
"kind": "Interface",
"content": "```typescript\nexport interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T> \n```\n**Extends:** [SVGAttributes](#svgattributes)<!-- -->, [QwikAttributes](#qwikattributes)<!-- -->&lt;T&gt;",
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts",
"mdFile": "core.svgprops.md"
},
{
"name": "sync$",
"id": "sync_",
24 changes: 1 addition & 23 deletions packages/docs/src/routes/api/qwik/index.mdx
Original file line number Diff line number Diff line change
@@ -1333,16 +1333,6 @@ any[]

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

## HTMLElementAttrs

```typescript
export interface HTMLElementAttrs extends HTMLAttributesBase, FilterBase<HTMLElement>
```

**Extends:** HTMLAttributesBase, FilterBase&lt;HTMLElement&gt;

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts)

## implicit$FirstArg

Create a `____$(...)` convenience method from `___(...)`.
@@ -2586,7 +2576,7 @@ export type QwikHTMLElements = {
};
```

**References:** [HTMLElementAttrs](#htmlelementattrs), [QwikAttributes](#qwikattributes)
**References:** [QwikAttributes](#qwikattributes)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts)

@@ -2784,8 +2774,6 @@ export type QwikSVGElements = {
};
```

**References:** [SVGProps](#svgprops)

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts)

## QwikSymbolEvent
@@ -8121,16 +8109,6 @@ _(Optional)_

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts)

## SVGProps

```typescript
export interface SVGProps<T extends Element> extends SVGAttributes, QwikAttributes<T>
```

**Extends:** [SVGAttributes](#svgattributes), [QwikAttributes](#qwikattributes)&lt;T&gt;

[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/jsx/types/jsx-generated.ts)

## sync$

Extract function into a synchronously loadable QRL.
3 changes: 2 additions & 1 deletion packages/qwik-router/src/buildtime/vite/dev-server.ts
Original file line number Diff line number Diff line change
@@ -33,6 +33,7 @@ import { getExtension, normalizePath } from '../../utils/fs';
import { updateBuildContext } from '../build';
import type { BuildContext, BuildRoute } from '../types';
import { formatError } from './format-error';
import { RequestEvShareServerTiming } from '../../middleware/request-handler/request-event';

export function ssrDevMiddleware(ctx: BuildContext, server: ViteDevServer) {
const matchRouteRequest = (pathname: string) => {
@@ -188,7 +189,7 @@ export function ssrDevMiddleware(ctx: BuildContext, server: ViteDevServer) {
res.setHeader('Set-Cookie', cookieHeaders);
}

const serverTiming = requestEv.sharedMap.get('@serverTiming') as
const serverTiming = requestEv.sharedMap.get(RequestEvShareServerTiming) as
| [string, number][]
| undefined;
if (serverTiming) {
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ export { getErrorHtml, ServerError } from './error-handler';
export { mergeHeadersCookies } from './cookie';
export { AbortMessage, RedirectMessage } from './redirect-handler';
export { requestHandler } from './request-handler';
export { RequestEvShareQData } from './request-event';
export { _TextEncoderStream_polyfill } from './polyfill';
export type {
CacheControl,
Loading
Loading