lithent 1.13.0 → 1.14.0
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 +23 -19
- package/dist/index.d.ts +1 -0
- package/dist/lithent.mjs +213 -209
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/universalRef.d.ts +1 -0
- package/dist/wDom.d.ts +1 -10
- package/examples/dist/assets/index-42zKyFLo.js +2 -0
- package/examples/dist/assets/index-42zKyFLo.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/ftags/dist/index.d.ts +2 -8
- package/ftags/dist/lithentFTags.mjs +16 -10
- package/ftags/dist/lithentFTags.mjs.map +1 -1
- package/ftags/dist/lithentFTags.umd.js +1 -1
- package/ftags/dist/lithentFTags.umd.js.map +1 -1
- package/ftags/package.json +2 -0
- package/ftags/src/index.ts +30 -6
- package/ftags/src/tests/ftags.ts +134 -0
- package/helper/dist/lithentHelper.mjs +67 -63
- package/helper/dist/lithentHelper.mjs.map +1 -1
- package/helper/dist/lithentHelper.umd.js +1 -1
- package/helper/dist/lithentHelper.umd.js.map +1 -1
- package/helper/package.json +1 -0
- package/helper/src/hook/store.ts +15 -7
- package/helper/src/tests/store.tsx +0 -1
- package/package.json +11 -13
- package/src/index.ts +1 -0
- package/src/tests/core-hoc.tsx +2 -1
- package/src/tests/core-portal.tsx +2 -10
- package/src/tests/core-renew.tsx +2 -1
- package/src/tests/core-renewEventTest.tsx +2 -1
- package/src/types/index.ts +3 -0
- package/src/utils/index.ts +9 -1
- package/src/utils/universalRef.ts +1 -0
- package/src/wDom.ts +13 -8
- package/tag/dist/index.d.ts +0 -6
- package/tag/dist/lithentTag.mjs +1 -2
- package/tag/dist/lithentTag.mjs.map +1 -1
- package/examples/dist/assets/index-Bd9Pg33S.js +0 -2
- package/examples/dist/assets/index-Bd9Pg33S.js.map +0 -1
- package/src/tests/ftag.tsx +0 -71
package/README.md
CHANGED
|
@@ -21,8 +21,8 @@ Lithent were developed to make it easy to insert Virtual DOM component
|
|
|
21
21
|
fragments into pages already drawn with SSR, and are intended to be
|
|
22
22
|
used lightly in a variety of situations.
|
|
23
23
|
|
|
24
|
-
`(lithent.mjs 14.
|
|
25
|
-
`(lithent.umd.js 10.
|
|
24
|
+
`(lithent.mjs 14.62 kB │ gzip: 4.62 kB │ map: 61.56 kB)`
|
|
25
|
+
`(lithent.umd.js 10.66 kB │ gzip: 4.14 kB │ map: 59.94 kB)`
|
|
26
26
|
|
|
27
27
|
## 🚩 Table of Contents
|
|
28
28
|
- [Thanks for the introduction](#thanks-for-the-introduction)
|
|
@@ -78,14 +78,14 @@ pnpm add lithent
|
|
|
78
78
|
|
|
79
79
|
#### Or Use CDN
|
|
80
80
|
|
|
81
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
82
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
83
|
-
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
84
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
85
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
86
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
87
|
-
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
88
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
81
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.14.0/dist/lithent.umd.js
|
|
82
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.14.0/helper/dist/lithentHelper.umd.js
|
|
83
|
+
* UMD-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.14.0/ftags/dist/lithentFTags.umd.js
|
|
84
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.14.0/tag/dist/lithentTag.umd.js
|
|
85
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.14.0/dist/lithent.mjs
|
|
86
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.14.0/helper/dist/lithentHelper.mjs
|
|
87
|
+
* ESM-FTAGS: https://cdn.jsdelivr.net/npm/lithent@1.14.0/ftags/dist/lithentFTags.mjs
|
|
88
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.14.0/tag/dist/lithentTag.mjs
|
|
89
89
|
|
|
90
90
|
|
|
91
91
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -110,9 +110,9 @@ import { fTags, fFragment, fMount } from 'lithent/ftags';
|
|
|
110
110
|
const { section, div, p, br, strong } = fTags;
|
|
111
111
|
|
|
112
112
|
/* UMD
|
|
113
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
114
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
115
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
113
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/dist/lithent.umd.js"></script>
|
|
114
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/helper/dist/lithentHelper.umd.js"></script>
|
|
115
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/ftags/dist/lithentFTags.umd.js"></script>
|
|
116
116
|
|
|
117
117
|
const { render } = lithent;
|
|
118
118
|
const { fTags, fMount, fFragment } = lithentFTags;
|
|
@@ -124,6 +124,7 @@ const fTagComponent = fMount<{ firstProp: number }>((_r, props, children) => {
|
|
|
124
124
|
fFragment(
|
|
125
125
|
'first inner',
|
|
126
126
|
div({ style: { border: '1px solid red' } }, 'second inner'),
|
|
127
|
+
div('The props argument can be omitted.'),
|
|
127
128
|
props.firstProp,
|
|
128
129
|
...children
|
|
129
130
|
);
|
|
@@ -131,7 +132,7 @@ const fTagComponent = fMount<{ firstProp: number }>((_r, props, children) => {
|
|
|
131
132
|
|
|
132
133
|
render(
|
|
133
134
|
fTagComponent(
|
|
134
|
-
{ firstProp: 3 },
|
|
135
|
+
{ firstProp: 3 }, // The props argument can be omitted.
|
|
135
136
|
div({ style: { border: '1px solid green' } }, `Fchildren1`),
|
|
136
137
|
'Fchildren2',
|
|
137
138
|
br()
|
|
@@ -184,10 +185,10 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
184
185
|
#### With UMD
|
|
185
186
|
|
|
186
187
|
```html
|
|
187
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
188
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
189
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
190
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
188
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/dist/lithent.umd.js"></script>
|
|
189
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/helper/dist/lithentHelper.umd.js"></script-->
|
|
190
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/tag/dist/lithentTag.umd.js"></script>
|
|
191
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.14.0/ftags/dist/lithentFTags.umd.js"></script-->
|
|
191
192
|
|
|
192
193
|
<div id="root"></div>
|
|
193
194
|
|
|
@@ -256,8 +257,11 @@ pnpm dev // or pnpm dev:core
|
|
|
256
257
|
|
|
257
258
|
## Test
|
|
258
259
|
|
|
260
|
+
> To fully test everything, including plugins like helper and ftags, a build is required.
|
|
261
|
+
|
|
259
262
|
```bash
|
|
260
|
-
|
|
263
|
+
pnpm install
|
|
264
|
+
pnpm build
|
|
261
265
|
pnpm test
|
|
262
266
|
```
|
|
263
267
|
|
package/dist/index.d.ts
CHANGED