@wrdagency/react-islands 0.1.0 → 0.1.2
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/README.md +13 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1624 -2993
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1623 -2993
- package/dist/index.mjs.map +1 -1
- package/dist/server.js +1600 -2970
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +1624 -2994
- package/dist/server.mjs.map +1 -1
- package/package.json +17 -5
- package/src/index.tsx +4 -2
- package/tsconfig.json +0 -14
- package/tsup.config.ts +0 -10
package/package.json
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wrdagency/react-islands",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
6
|
+
"files": [
|
|
7
|
+
"dist",
|
|
8
|
+
"src"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./server": {
|
|
16
|
+
"types": "./dist/server.ts",
|
|
17
|
+
"default": "./dist/server.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
8
20
|
"scripts": {
|
|
9
21
|
"build": "tsup"
|
|
10
22
|
},
|
|
@@ -15,7 +27,7 @@
|
|
|
15
27
|
"author": "Kyle Thomas Cooper @ WRD",
|
|
16
28
|
"license": "MIT",
|
|
17
29
|
"devDependencies": {
|
|
18
|
-
"@types/react-dom": "^
|
|
30
|
+
"@types/react-dom": "^19.1.6",
|
|
19
31
|
"tsup": "^8.0.2",
|
|
20
32
|
"typescript": "^5.4.3"
|
|
21
33
|
},
|
|
@@ -24,6 +36,6 @@
|
|
|
24
36
|
"url": "https://github.com/kyletcooper/react-islands"
|
|
25
37
|
},
|
|
26
38
|
"peerDependencies": {
|
|
27
|
-
"react-dom": "^
|
|
39
|
+
"react-dom": "^19.1.0"
|
|
28
40
|
}
|
|
29
41
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { FC, PropsWithChildren, useEffect, useRef } from "react";
|
|
2
|
-
import { Island, IslandOpts, IslandRenderOpts } from "./types";
|
|
3
2
|
import { createRoot, hydrateRoot } from "react-dom/client";
|
|
3
|
+
import { Island, IslandOpts, IslandRenderOpts } from "./types";
|
|
4
|
+
|
|
5
|
+
export { Island };
|
|
4
6
|
|
|
5
|
-
export
|
|
7
|
+
export function createIsland(component: FC, opts: IslandOpts): Island {
|
|
6
8
|
const mergedOpts: Required<IslandOpts> = {
|
|
7
9
|
multiple: false,
|
|
8
10
|
selector: `[data-hydrate="${opts.name}"]`,
|
package/tsconfig.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist/",
|
|
4
|
-
"target": "es2016",
|
|
5
|
-
"module": "Node16",
|
|
6
|
-
"jsx": "react-jsx",
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"allowSyntheticDefaultImports": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"strict": true,
|
|
11
|
-
"skipLibCheck": true
|
|
12
|
-
},
|
|
13
|
-
"exclude": ["dist", "node_modules"]
|
|
14
|
-
}
|