@qwik.dev/react 2.0.0-beta.1 → 2.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.qwik.cjs +10 -2
- package/lib/index.qwik.mjs +11 -3
- package/lib/types/react/slot.d.ts +2 -2
- package/package.json +11 -10
package/lib/index.qwik.cjs
CHANGED
|
@@ -5,11 +5,11 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5
5
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
6
|
const jsxRuntime = require("@qwik.dev/core/jsx-runtime");
|
|
7
7
|
const core = require("@qwik.dev/core");
|
|
8
|
-
const client = require("react-dom/client");
|
|
9
|
-
const reactDom = require("react-dom");
|
|
10
8
|
const internal = require("@qwik.dev/core/internal");
|
|
11
9
|
const server = require("react-dom/server");
|
|
12
10
|
const react = require("react");
|
|
11
|
+
const client = require("react-dom/client");
|
|
12
|
+
const reactDom = require("react-dom");
|
|
13
13
|
const SlotCtx = react.createContext({
|
|
14
14
|
scopeId: ""
|
|
15
15
|
});
|
|
@@ -226,6 +226,14 @@ function qwikifyQrl(reactCmp$, opts) {
|
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
});
|
|
229
|
+
core.useTask$(({ track, cleanup }) => {
|
|
230
|
+
track(signal);
|
|
231
|
+
if (core.isBrowser) {
|
|
232
|
+
cleanup(() => {
|
|
233
|
+
internalState.value?.root?.unmount();
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
});
|
|
229
237
|
if (core.isServer && !isClientOnly) {
|
|
230
238
|
const jsx = renderFromServer(TagName, reactCmp$, scopeId, props, hostRef, slotRef, hydrationKeys);
|
|
231
239
|
return /* @__PURE__ */ jsxRuntime.jsx(core.RenderOnce, {
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -3,11 +3,11 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { jsx, jsxs, Fragment } from "@qwik.dev/core/jsx-runtime";
|
|
5
5
|
import { useSignal, $, isServer, useOn, useOnDocument, Slot, implicit$FirstArg, component$, useStylesScoped$, useStore, useTask$, isBrowser, noSerialize, RenderOnce, SkipRender } from "@qwik.dev/core";
|
|
6
|
-
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
7
|
-
import { flushSync } from "react-dom";
|
|
8
6
|
import { SSRStream, SSRComment, SSRRaw } from "@qwik.dev/core/internal";
|
|
9
7
|
import { renderToString } from "react-dom/server";
|
|
10
|
-
import {
|
|
8
|
+
import { createElement, createContext, Component, createRef } from "react";
|
|
9
|
+
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
10
|
+
import { flushSync } from "react-dom";
|
|
11
11
|
const SlotCtx = createContext({
|
|
12
12
|
scopeId: ""
|
|
13
13
|
});
|
|
@@ -224,6 +224,14 @@ function qwikifyQrl(reactCmp$, opts) {
|
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
226
|
});
|
|
227
|
+
useTask$(({ track, cleanup }) => {
|
|
228
|
+
track(signal);
|
|
229
|
+
if (isBrowser) {
|
|
230
|
+
cleanup(() => {
|
|
231
|
+
internalState.value?.root?.unmount();
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
});
|
|
227
235
|
if (isServer && !isClientOnly) {
|
|
228
236
|
const jsx$1 = renderFromServer(TagName, reactCmp$, scopeId, props, hostRef, slotRef, hydrationKeys);
|
|
229
237
|
return /* @__PURE__ */ jsx(RenderOnce, {
|
|
@@ -11,7 +11,7 @@ export declare function mainExactProps(slotEl: Element | undefined, scopeId: str
|
|
|
11
11
|
export declare class SlotElement extends Component {
|
|
12
12
|
static contextType: import("react").Context<SlotState>;
|
|
13
13
|
context: React.ContextType<typeof SlotCtx>;
|
|
14
|
-
slotC: import("react").RefObject<Element>;
|
|
14
|
+
slotC: import("react").RefObject<Element | null>;
|
|
15
15
|
shouldComponentUpdate(): boolean;
|
|
16
16
|
componentDidMount(): void;
|
|
17
17
|
render(): import("react").DOMElement<{
|
|
@@ -20,7 +20,7 @@ export declare class SlotElement extends Component {
|
|
|
20
20
|
dangerouslySetInnerHTML: {
|
|
21
21
|
__html: string;
|
|
22
22
|
};
|
|
23
|
-
ref: import("react").RefObject<Element>;
|
|
23
|
+
ref: import("react").RefObject<Element | null>;
|
|
24
24
|
}, Element>;
|
|
25
25
|
}
|
|
26
26
|
export declare const getReactProps: (props: Record<string, any>) => Record<string, any>;
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwik.dev/react",
|
|
3
3
|
"description": "Qwik React allows adding React components into existing Qwik application",
|
|
4
|
-
"version": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.10",
|
|
5
5
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@types/react": "
|
|
8
|
-
"@types/react-dom": "
|
|
9
|
-
"react": "
|
|
10
|
-
"react-dom": "
|
|
11
|
-
"typescript": "5.
|
|
12
|
-
"vite": "
|
|
13
|
-
"@qwik.dev/core": "2.0.0-beta.
|
|
7
|
+
"@types/react": "19.1.12",
|
|
8
|
+
"@types/react-dom": "19.1.7",
|
|
9
|
+
"react": "19.1.1",
|
|
10
|
+
"react-dom": "19.1.1",
|
|
11
|
+
"typescript": "5.9.2",
|
|
12
|
+
"vite": "7.1.5",
|
|
13
|
+
"@qwik.dev/core": "2.0.0-beta.10"
|
|
14
14
|
},
|
|
15
15
|
"engines": {
|
|
16
16
|
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@types/react-dom": "^18",
|
|
40
40
|
"react": "^18",
|
|
41
41
|
"react-dom": "^18",
|
|
42
|
-
"vite": ">=5 <
|
|
43
|
-
"@qwik.dev/core": "^2.0.0-beta.
|
|
42
|
+
"vite": ">=5 <8",
|
|
43
|
+
"@qwik.dev/core": "^2.0.0-beta.10"
|
|
44
44
|
},
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
@@ -51,6 +51,7 @@
|
|
|
51
51
|
"url": "https://github.com/QwikDev/qwik.git",
|
|
52
52
|
"directory": "packages/qwik-react"
|
|
53
53
|
},
|
|
54
|
+
"sideEffects": false,
|
|
54
55
|
"type": "module",
|
|
55
56
|
"types": "./lib/types/index.qwik.d.ts",
|
|
56
57
|
"scripts": {
|