Skip to content

Commit c147c6e

Browse files
authored
chore: remove deprecated @qwik.dev/react dependency and clean up unused components in the UI package (#51)
1 parent 44db08e commit c147c6e

File tree

11 files changed

+25
-301
lines changed

11 files changed

+25
-301
lines changed

packages/playgrounds/src/root.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default component$(() => {
1717
*/
1818

1919
return (
20-
<QwikRouterProvider>
20+
<QwikRouterProvider viewTransition={true}>
2121
<head>
2222
<meta charset="utf-8" />
2323
{!isDev && (
@@ -26,10 +26,10 @@ export default component$(() => {
2626
href={`${import.meta.env.BASE_URL}manifest.json`}
2727
/>
2828
)}
29-
<RouterHead />
29+
<RouterHead />
3030
</head>
3131
<body lang="en">
32-
<RouterOutlet />
32+
<RouterOutlet />
3333
{!isDev && <ServiceWorkerRegister />}
3434
</body>
3535
</QwikRouterProvider>

packages/playgrounds/src/routes/about/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import type { DocumentHead } from '@qwik.dev/router';
2-
import { component$ } from '@qwik.dev/core';
2+
import { component$, useSignal } from '@qwik.dev/core';
3+
import Button from '~/components/Button/Button';
34

45
export default component$(() => {
6+
const testValue = useSignal('111');
57
return (
68
<>
79
<div>About</div>
10+
<Button
11+
testValue={testValue}
12+
data-testid="button"
13+
class="bg-red-500"
14+
/>
815
</>
916
);
1017
});
@@ -18,3 +25,4 @@ export const head: DocumentHead = {
1825
},
1926
],
2027
};
28+

packages/plugin/src/utils/useCollectHooks.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
const useCollectHooks = `import { $, useSignal, useVisibleTask$ } from "@qwik.dev/core"
22
export const useCollectHooks = (src) => {
3-
const hooksList = useSignal([])
3+
const hooksList = useSignal(new Set())
44
useVisibleTask$(({ track }) => {
55
const newdata = track(() => hooksList.value);
66
if(!window.QWIK_DEVTOOLS_GLOBAL_STATE) {
77
window.QWIK_DEVTOOLS_GLOBAL_STATE = {}
8-
window.QWIK_DEVTOOLS_GLOBAL_STATE[src] = newdata || []
8+
window.QWIK_DEVTOOLS_GLOBAL_STATE[src] = [...newdata]
99
}else {
10-
window.QWIK_DEVTOOLS_GLOBAL_STATE[src] = newdata
10+
window.QWIK_DEVTOOLS_GLOBAL_STATE[src] = [...newdata]
1111
}
12-
})
12+
}, { strategy: 'document-ready'})
1313
return $((args) => {
14-
hooksList.value.push(args)
14+
if(hooksList.value.has(args)) {
15+
return
16+
}
17+
hooksList.value.add(args)
1518
})
1619
}
1720
`

packages/ui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
},
4040
"devDependencies": {
4141
"@devtools/kit": "workspace:*",
42-
"@qwik.dev/react": "2.0.0-beta.9",
4342
"@qwikest/icons": "^0.0.13",
4443
"@types/eslint": "8.56.10",
4544
"@types/node": "20.14.11",

packages/ui/src/devtools.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { tryCreateHotContext } from 'vite-hot-client';
1010
import {
1111
HiBoltOutline,
1212
HiPhotoOutline,
13-
HiCodeBracketMini,
1413
HiMegaphoneMini,
1514
HiCubeOutline,
1615
} from '@qwikest/icons/heroicons';
@@ -37,7 +36,6 @@ import { DevtoolsButton } from './components/DevtoolsButton/DevtoolsButton';
3736
import { DevtoolsContainer } from './components/DevtoolsContainer/DevtoolsContainer';
3837
import { DevtoolsPanel } from './components/DevtoolsPanel/DevtoolsPanel';
3938
import { Packages } from './features/Packages/Packages';
40-
import { Components } from './features/Components/Components';
4139
import { Inspect } from './features/inspect/Inspect';
4240
import { ThemeToggle } from './components/ThemeToggle/ThemeToggle';
4341
import { ThemeScript } from './components/ThemeToggle/theme-script';
@@ -129,9 +127,6 @@ export const QwikDevtools = component$(() => {
129127
<Tab state={state} id="assets" title="Assets">
130128
<HiPhotoOutline class="h-5 w-5" />
131129
</Tab>
132-
<Tab state={state} id="components" title="Components Tree">
133-
<HiCodeBracketMini class="h-5 w-5" />
134-
</Tab>
135130
<Tab state={state} id="inspect" title="inspect">
136131
<HiMegaphoneMini class="h-5 w-5" />
137132
</Tab>
@@ -189,12 +184,6 @@ export const QwikDevtools = component$(() => {
189184
<Routes state={state} q:slot="content" />
190185
</TabContent>
191186
)}
192-
{state.activeTab === 'components' && (
193-
<TabContent>
194-
<TabTitle title="Components Tree" q:slot="title" />
195-
<Components q:slot="content" />
196-
</TabContent>
197-
)}
198187
{state.activeTab === 'inspect' && (
199188
<TabContent>
200189
<Inspect q:slot="content" />

packages/ui/src/features/Components/Components.tsx

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

packages/ui/src/features/Components/components/Tree.tsx

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

packages/ui/src/features/Components/styles.css

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

packages/ui/src/features/RenderTree/formatTreeData.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,10 @@ export function findAllQrl() {
277277
}
278278

279279
export function getQrlPath(qrl: QRL) {
280+
// CHUNK_KEY is not available when dev property isn't null or undefined
281+
if(qrl?.dev){
282+
return `/@fs${(qrl as any)?.[CHUNK_KEY]}`;
283+
}
280284
return (qrl as any)?.[CHUNK_KEY];
281285
}
282286

0 commit comments

Comments
 (0)