Skip to content

Commit f211d54

Browse files
committed
feat(core)\!: export ErrorBoundary from core instead of router
ErrorBoundary now lives in @qwik.dev/core, built with the internal componentQrl + inlinedQrl pattern (core isn't run through the optimizer). Removed from @qwik.dev/router; import it from @qwik.dev/core instead.
1 parent caefbb5 commit f211d54

16 files changed

Lines changed: 235 additions & 56 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@qwik.dev/core': major
3+
'@qwik.dev/router': major
4+
---
5+
6+
BREAKING: `ErrorBoundary` now ships from `@qwik.dev/core` instead of `@qwik.dev/router`. Update your imports from `@qwik.dev/router` to `@qwik.dev/core`.

e2e/qwik-e2e/apps/qwikrouter-test/src/routes/error/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { component$, $ } from '@qwik.dev/core';
2-
import { ErrorBoundary } from '@qwik.dev/router';
1+
import { component$, $, ErrorBoundary } from '@qwik.dev/core';
32

43
export default component$(() => {
54
return <UseErrorBoundaryNoEffectIssue7227 />;

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

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -268,20 +268,6 @@
268268
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/types.ts",
269269
"mdFile": "router.documentstyle.md"
270270
},
271-
{
272-
"name": "ErrorBoundary",
273-
"id": "errorboundary",
274-
"hierarchy": [
275-
{
276-
"name": "ErrorBoundary",
277-
"id": "errorboundary"
278-
}
279-
],
280-
"kind": "Variable",
281-
"content": "```typescript\nErrorBoundary: import(\"@qwik.dev/core\").Component<ErrorBoundaryProps>\n```",
282-
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/error-boundary.tsx",
283-
"mdFile": "router.errorboundary.md"
284-
},
285271
{
286272
"name": "FailOfRest",
287273
"id": "failofrest",

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -775,14 +775,6 @@ export type DocumentStyle = Readonly<
775775

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

778-
<h2 id="errorboundary">ErrorBoundary</h2>
779-
780-
```typescript
781-
ErrorBoundary: import("@qwik.dev/core").Component<ErrorBoundaryProps>;
782-
```
783-
784-
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik-router/src/runtime/src/error-boundary.tsx)
785-
786778
<h2 id="failofrest">FailOfRest</h2>
787779

788780
```typescript

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,34 @@
644644
"content": "```typescript\ntype ElementType = string | FunctionComponent<Record<any, any>>;\n```\n**References:** [FunctionComponent](#functioncomponent)",
645645
"mdFile": "core.qwikjsx.elementtype.md"
646646
},
647+
{
648+
"name": "ErrorBoundary",
649+
"id": "errorboundary",
650+
"hierarchy": [
651+
{
652+
"name": "ErrorBoundary",
653+
"id": "errorboundary"
654+
}
655+
],
656+
"kind": "Variable",
657+
"content": "```typescript\nErrorBoundary: Component<ErrorBoundaryProps>\n```",
658+
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/error/error-boundary.ts",
659+
"mdFile": "core.errorboundary.md"
660+
},
661+
{
662+
"name": "ErrorBoundaryProps",
663+
"id": "errorboundaryprops",
664+
"hierarchy": [
665+
{
666+
"name": "ErrorBoundaryProps",
667+
"id": "errorboundaryprops"
668+
}
669+
],
670+
"kind": "Interface",
671+
"content": "```typescript\nexport interface ErrorBoundaryProps \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\nfallback$?\n\n\n</td><td>\n\n\n</td><td>\n\n[QRL](#qrl-type-alias)<!-- -->&lt;(error: any) =&gt; any&gt;\n\n\n</td><td>\n\n_(Optional)_\n\n\n</td></tr>\n</tbody></table>",
672+
"editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/error/error-boundary.ts",
673+
"mdFile": "core.errorboundaryprops.md"
674+
},
647675
{
648676
"name": "ErrorBoundaryStore",
649677
"id": "errorboundarystore",

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

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,56 @@ type ElementType = string | FunctionComponent<Record<any, any>>;
16201620
16211621
**References:** [FunctionComponent](#functioncomponent)
16221622
1623+
<h2 id="errorboundary">ErrorBoundary</h2>
1624+
1625+
```typescript
1626+
ErrorBoundary: Component<ErrorBoundaryProps>;
1627+
```
1628+
1629+
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/error/error-boundary.ts)
1630+
1631+
<h2 id="errorboundaryprops">ErrorBoundaryProps</h2>
1632+
1633+
```typescript
1634+
export interface ErrorBoundaryProps
1635+
```
1636+
1637+
<table><thead><tr><th>
1638+
1639+
Property
1640+
1641+
</th><th>
1642+
1643+
Modifiers
1644+
1645+
</th><th>
1646+
1647+
Type
1648+
1649+
</th><th>
1650+
1651+
Description
1652+
1653+
</th></tr></thead>
1654+
<tbody><tr><td>
1655+
1656+
fallback$?
1657+
1658+
</td><td>
1659+
1660+
</td><td>
1661+
1662+
[QRL](#qrl-type-alias)&lt;(error: any) =&gt; any&gt;
1663+
1664+
</td><td>
1665+
1666+
_(Optional)_
1667+
1668+
</td></tr>
1669+
</tbody></table>
1670+
1671+
[Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/shared/error/error-boundary.ts)
1672+
16231673
<h2 id="errorboundarystore">ErrorBoundaryStore</h2>
16241674
16251675
```typescript

packages/qwik-router/src/runtime/src/error-boundary.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

packages/qwik-router/src/runtime/src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export type {
5555
ZodConstructor,
5656
} from './types';
5757

58-
export { ErrorBoundary } from './error-boundary';
5958
export { Link, type LinkProps, type PrefetchStrategy } from './link-component';
6059
export {
6160
QWIK_CITY_SCROLLER,

packages/qwik-router/src/runtime/src/qwik-router.runtime.api.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,6 @@ export type DocumentStyle = Readonly<((Omit<QwikIntrinsicElements['style'], 'dan
188188
style?: never;
189189
})>;
190190

191-
// Warning: (ae-forgotten-export) The symbol "ErrorBoundaryProps" needs to be exported by the entry point index.d.ts
192-
//
193-
// @public (undocumented)
194-
export const ErrorBoundary: Component<ErrorBoundaryProps>;
195-
196191
// @public (undocumented)
197192
export type FailOfRest<REST extends readonly DataValidator[]> = REST extends readonly DataValidator<infer ERROR>[] ? ERROR : never;
198193

packages/qwik-vite/src/manifest.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ const extraSymbols = new Set([
2121
'_reR',
2222
'_reC',
2323
'_reT',
24+
// ErrorBoundary
25+
'_ebC',
26+
'_ebL',
2427
]);
2528

2629
// This is just the initial prioritization of the symbols and entries

0 commit comments

Comments
 (0)