Skip to content

Commit 1db7917

Browse files
committed
lint++
1 parent 4e2d6b8 commit 1db7917

File tree

4 files changed

+208
-244
lines changed

4 files changed

+208
-244
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"cross-spawn": "7.0.3",
111111
"csstype": "3.1.3",
112112
"dotenv": "16.4.5",
113-
"esbuild": "0.24.0",
113+
"esbuild": "0.25.4",
114114
"eslint": "9.25.1",
115115
"eslint-plugin-import": "2.29.1",
116116
"eslint-plugin-no-only-tests": "3.3.0",

packages/docs/package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"@algolia/autocomplete-core": "1.7.4",
99
"@algolia/client-search": "4.14.3",
1010
"@builder.io/partytown": "0.10.2",
11-
"@builder.io/qwik": "../qwik",
12-
"@builder.io/qwik-city": "../qwik-router",
13-
"@builder.io/sdk-qwik": "0.14.31",
1411
"@emotion/react": "11.13.0",
1512
"@emotion/styled": "11.13.0",
1613
"@modular-forms/qwik": "0.23.1",
Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,8 @@
1-
import {
2-
type Component,
3-
component$,
4-
useSignal,
5-
useTask$,
6-
isDev,
7-
} from '@qwik.dev/core';
1+
import { component$, type Component } from '@qwik.dev/core';
82

9-
const metaGlobComponents: Record<string, any> = import.meta.glob(
3+
const metaGlobComponents = import.meta.glob<Component>(
104
'/src/routes/demo/cookbook/glob-import/examples/*',
11-
{
12-
import: 'default',
13-
eager: !isDev,
14-
}
5+
{ import: 'default' }
156
);
167

178
export default component$(() => {
@@ -24,15 +15,14 @@ export default component$(() => {
2415
);
2516
});
2617

18+
const loaded: Record<string, Component> = {};
2719
export const MetaGlobExample = component$<{ name: string }>(({ name }) => {
28-
const MetaGlobComponent = useSignal<Component<any>>();
29-
const componentPath = `/src/routes/demo/cookbook/glob-import/examples/${name}.tsx`;
30-
31-
useTask$(async () => {
32-
MetaGlobComponent.value = isDev
33-
? await metaGlobComponents[componentPath]() // We need to call `await metaGlobComponents[componentPath]()` in development as it is `eager:false`
34-
: metaGlobComponents[componentPath]; // We need to directly access the `metaGlobComponents[componentPath]` expression in preview/production as it is `eager:true`
35-
});
20+
const Cmp = loaded[name];
21+
if (!Cmp) {
22+
const componentPath = `/src/routes/demo/cookbook/glob-import/examples/${name}.tsx`;
23+
const promise = metaGlobComponents[componentPath]();
24+
throw promise.then((c) => (loaded[name] = c));
25+
}
3626

37-
return <>{MetaGlobComponent.value && <MetaGlobComponent.value />}</>;
27+
return <Cmp />;
3828
});

0 commit comments

Comments
 (0)