lithent 1.2.1 → 1.2.3
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 +12 -19
- package/dist/lithent.mjs +793 -360
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/dist/render.d.ts +1 -0
- package/examples/dist/assets/index-d0c2c397.js +2 -0
- package/examples/dist/assets/index-d0c2c397.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/helper/dist/hook/nextTickRender.d.ts +2 -0
- package/helper/dist/index.d.ts +1 -1
- package/helper/dist/lithentHelper.mjs +17 -17
- 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/src/hook/{portal.ts → nextTickRender.ts} +2 -4
- package/helper/src/index.ts +1 -1
- package/package.json +1 -1
- package/src/diff.ts +6 -11
- package/src/render.ts +6 -4
- package/src/tests/loop2.tsx +77 -0
- package/examples/dist/assets/index-6e15f967.js +0 -2
- package/examples/dist/assets/index-6e15f967.js.map +0 -1
- package/helper/dist/hook/portal.d.ts +0 -2
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ used lightly in a variety of situations.
|
|
|
9
9
|
- https://superlucky84.github.io/lithent
|
|
10
10
|
- (This guide page is written in lithent.)
|
|
11
11
|
|
|
12
|
-
`(9.
|
|
12
|
+
`(9.90 kB │ gzip: 3.87 kB)`
|
|
13
13
|
|
|
14
14
|
## 🚩 Table of Contents
|
|
15
15
|
|
|
@@ -41,8 +41,6 @@ We provide code in the form of 'helpers' that extend the basic functionality, bu
|
|
|
41
41
|
|
|
42
42
|
### Approach with the developer-friendly concept of closures between "component mounter" and "renderer"
|
|
43
43
|
|
|
44
|
-
Many existing UI libraries have their advantages, but they also create rules that are too strong and rigid for fear of users making mistakes.
|
|
45
|
-
|
|
46
44
|
JavaScript users are used to using closures and love to develop with them.
|
|
47
45
|
|
|
48
46
|
"Lithent" provides a familiar approach to my JavaScript development, as it leverages the properties of higher-order functions and closures to define and recycle the state of a component.
|
|
@@ -61,12 +59,12 @@ pnpm add lithent
|
|
|
61
59
|
|
|
62
60
|
#### Or Use CDN
|
|
63
61
|
|
|
64
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
65
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
66
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
67
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
68
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
69
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
62
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.2.3/dist/lithent.umd.js
|
|
63
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.2.3/helper/dist/lithentHelper.umd.js
|
|
64
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.2.3/tag/dist/lithentTag.umd.js
|
|
65
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.2.3/dist/lithent.mjs
|
|
66
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.2.3/helper/dist/lithentHelper.mjs
|
|
67
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.2.3/tag/dist/lithentTag.mjs
|
|
70
68
|
|
|
71
69
|
|
|
72
70
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -75,14 +73,9 @@ It's easier to use lithent with JSX or HTM.
|
|
|
75
73
|
|
|
76
74
|
- [Htm Github](https://github.com/developit/htm)
|
|
77
75
|
|
|
78
|
-
```bash
|
|
79
|
-
pnpm add -D htm
|
|
80
|
-
```
|
|
81
|
-
|
|
82
76
|
```js
|
|
83
|
-
import {
|
|
84
|
-
|
|
85
|
-
const html = htm.bind(h);
|
|
77
|
+
import { lTag } from 'lithent/tag';
|
|
78
|
+
const destroy = render(lTag`<${Component} />`, document.getElementById('root'), document.getElementById('#insert-before-this-element'));
|
|
86
79
|
```
|
|
87
80
|
|
|
88
81
|
#### With JSX
|
|
@@ -123,9 +116,9 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
123
116
|
#### With UMD
|
|
124
117
|
|
|
125
118
|
```html
|
|
126
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
127
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
128
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.2.
|
|
119
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.2.3/dist/lithent.umd.js"></script>
|
|
120
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.2.3/helper/dist/lithentHelper.umd.js"></script-->
|
|
121
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.2.3/tag/dist/lithentTag.umd.js"></script>
|
|
129
122
|
|
|
130
123
|
<div id="root"></div>
|
|
131
124
|
|