lilact 0.21.1 → 0.23.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.
Files changed (120) hide show
  1. package/README.md +17 -4
  2. package/dist/lilact.development.js +498 -38
  3. package/dist/lilact.development.js.map +4 -4
  4. package/dist/lilact.development.min.js +34 -23
  5. package/dist/lilact.development.min.js.map +4 -4
  6. package/dist/lilact.production.min.js +33 -22
  7. package/docs/assets/hierarchy.js +1 -1
  8. package/docs/assets/highlight.css +20 -20
  9. package/docs/assets/navigation.js +1 -1
  10. package/docs/assets/search.js +1 -1
  11. package/docs/classes/accessories.ErrorBoundary.html +8 -8
  12. package/docs/classes/accessories.Suspense.html +7 -7
  13. package/docs/classes/components.Component.html +11 -11
  14. package/docs/classes/components.HTMLComponent.html +12 -12
  15. package/docs/classes/components.RootComponent.html +12 -12
  16. package/docs/functions/components.cloneComponent.html +1 -0
  17. package/docs/functions/components.createComponent.html +1 -1
  18. package/docs/functions/components.createPortal.html +1 -1
  19. package/docs/functions/components.createRoot.html +1 -1
  20. package/docs/functions/components.memo.html +1 -1
  21. package/docs/functions/components.render.html +1 -1
  22. package/docs/functions/run.lazy.html +7 -1
  23. package/docs/functions/run.require.html +5 -9
  24. package/docs/functions/run.run.html +1 -1
  25. package/docs/functions/run.runScripts.html +1 -1
  26. package/docs/functions/timers.animationFramePromise.html +1 -1
  27. package/docs/functions/timers.clearInterval.html +1 -1
  28. package/docs/functions/timers.clearTimeout.html +1 -1
  29. package/docs/functions/timers.grabTimers.html +1 -1
  30. package/docs/functions/timers.pauseTimers.html +1 -1
  31. package/docs/functions/timers.releaseTimers.html +1 -1
  32. package/docs/functions/timers.resetTimers.html +1 -1
  33. package/docs/functions/timers.resumeTimers.html +1 -1
  34. package/docs/functions/timers.setInterval.html +1 -1
  35. package/docs/functions/timers.setTimeout.html +1 -1
  36. package/docs/functions/timers.timeoutPromise.html +6 -6
  37. package/docs/hierarchy.html +1 -1
  38. package/docs/index.html +17 -10
  39. package/docs/modules/components.html +1 -1
  40. package/docs/static/demos/actionstate.jsx +2 -2
  41. package/docs/static/demos/capture.jsx +2 -2
  42. package/docs/static/demos/cloneelement.jsx +66 -0
  43. package/docs/static/demos/context.jsx +3 -3
  44. package/docs/static/demos/css-transition.jsx +3 -3
  45. package/docs/static/demos/error-boundary.jsx +2 -2
  46. package/docs/static/demos/error-callback.jsx +1 -1
  47. package/docs/static/demos/error-component-stack.jsx +2 -2
  48. package/docs/static/demos/error-init.jsx +1 -1
  49. package/docs/static/demos/error-parser.jsx +1 -1
  50. package/docs/static/demos/form-elements.jsx +1 -1
  51. package/docs/static/demos/forwardref.jsx +2 -2
  52. package/docs/static/demos/lazy.jsx +3 -3
  53. package/docs/static/demos/legacy-context.jsx +2 -2
  54. package/docs/static/demos/memo.jsx +2 -2
  55. package/docs/static/demos/modal.jsx +2 -2
  56. package/docs/static/demos/pane.jsx +2 -2
  57. package/docs/static/demos/portal.jsx +4 -2
  58. package/docs/static/demos/priorities.jsx +2 -2
  59. package/docs/static/demos/proptypes.jsx +2 -2
  60. package/docs/static/demos/reducer.jsx +4 -2
  61. package/docs/static/demos/redux.jsx +3 -3
  62. package/docs/static/demos/router.jsx +3 -3
  63. package/docs/static/demos/stopwatch.jsx +2 -2
  64. package/docs/static/demos/suspense.jsx +2 -2
  65. package/docs/static/demos/switch-transition.jsx +2 -2
  66. package/docs/static/demos/transition.jsx +2 -2
  67. package/docs/static/demos/usedefered.jsx +2 -2
  68. package/docs/static/demos/usetransition.jsx +3 -3
  69. package/docs/static/index.html +34 -33
  70. package/docs/static/lilact.development.js +498 -38
  71. package/docs/static/lilact.development.js.map +4 -4
  72. package/docs/static/lilact.development.min.js +34 -23
  73. package/docs/static/lilact.development.min.js.map +4 -4
  74. package/docs/static/lilact.production.min.js +33 -22
  75. package/docs/variables/accessories.SplitPane.html +1 -1
  76. package/docs/variables/components.cloneElement.html +1 -0
  77. package/examples/demos/actionstate.jsx +2 -2
  78. package/examples/demos/capture.jsx +2 -2
  79. package/examples/demos/cloneelement.jsx +66 -0
  80. package/examples/demos/context.jsx +3 -3
  81. package/examples/demos/css-transition.jsx +3 -3
  82. package/examples/demos/error-boundary.jsx +2 -2
  83. package/examples/demos/error-callback.jsx +1 -1
  84. package/examples/demos/error-component-stack.jsx +2 -2
  85. package/examples/demos/error-init.jsx +1 -1
  86. package/examples/demos/error-parser.jsx +1 -1
  87. package/examples/demos/form-elements.jsx +1 -1
  88. package/examples/demos/forwardref.jsx +2 -2
  89. package/examples/demos/lazy.jsx +3 -3
  90. package/examples/demos/legacy-context.jsx +2 -2
  91. package/examples/demos/memo.jsx +2 -2
  92. package/examples/demos/modal.jsx +2 -2
  93. package/examples/demos/pane.jsx +2 -2
  94. package/examples/demos/portal.jsx +4 -2
  95. package/examples/demos/priorities.jsx +2 -2
  96. package/examples/demos/proptypes.jsx +2 -2
  97. package/examples/demos/reducer.jsx +4 -2
  98. package/examples/demos/redux.jsx +3 -3
  99. package/examples/demos/router.jsx +3 -3
  100. package/examples/demos/stopwatch.jsx +2 -2
  101. package/examples/demos/suspense.jsx +2 -2
  102. package/examples/demos/switch-transition.jsx +2 -2
  103. package/examples/demos/transition.jsx +2 -2
  104. package/examples/demos/usedefered.jsx +2 -2
  105. package/examples/demos/usetransition.jsx +3 -3
  106. package/examples/index.html +34 -33
  107. package/examples/lilact.development.js +498 -38
  108. package/examples/lilact.development.js.map +4 -4
  109. package/examples/lilact.development.min.js +34 -23
  110. package/examples/lilact.development.min.js.map +4 -4
  111. package/examples/lilact.production.min.js +33 -22
  112. package/impexptest.js +51 -0
  113. package/package.json +4 -4
  114. package/src/components.jsx +7 -5
  115. package/src/expscan.js +408 -0
  116. package/src/jsx.js +26 -28
  117. package/src/lilact.jsx +12 -3
  118. package/src/run.jsx +92 -45
  119. package/src/timers.jsx +0 -5
  120. package/src/jsx.addons.js +0 -70
package/README.md CHANGED
@@ -29,7 +29,7 @@ If you find Lilact useful, please consider sponsoring. Your support funds ongoin
29
29
 
30
30
  ## Overview
31
31
 
32
- `Lilact` is a very lightweight implementation of the React API designed to run in the browser. It can be used as a single script that is around `90kb` minified and around `32kb` gzipped and includes its whole API. It is tested and works on **Chrome**, **Firefox**, **Edge**, and **Safari**.
32
+ `Lilact` is a very lightweight implementation of the React API designed to run in the browser. It can be used as a single script that is around `98kb` minified and around `34kb` gzipped and includes its whole API. It is tested and works on **Chrome**, **Firefox**, **Edge**, and **Safari**.
33
33
 
34
34
  `Lilact` is very fast, uses minimal resources, and handles memory very efficiently.
35
35
 
@@ -94,10 +94,16 @@ and update the bundle if any file is changed.
94
94
 
95
95
  ## Using Lilact Outside Node.js (Browser / Script Tag Integration)
96
96
 
97
- `Lilact` runs in the browser, so if you use `Lilact` outside Node, it uses `eval` to run the transpiled scripts, so it cannot use `import`/`export` the same way as a module.
97
+ `Lilact` runs in the browser, and uses `eval` to run the transpiled scripts. You can use both ESModule and CommonJS syntax,
98
+ but in the background `Lilact` converts the ES import and exports to CommonJS as `eval` doesn't allow ES syntax.
98
99
 
99
- Import the `Lilact` functions using this convention. There is also a `require` function that you can use
100
- to load other JSX or JS files.
100
+ ```js
101
+ import { useState, useRef, render } from "lilact";
102
+
103
+ import App from './App.jsx'; // imports the default export
104
+ ```
105
+
106
+ or
101
107
 
102
108
  ```js
103
109
  const { useState, useRef, render, require } = Lilact;
@@ -107,6 +113,13 @@ const App = require('./App.jsx');
107
113
 
108
114
  To export:
109
115
 
116
+ ```js
117
+ export default ...
118
+ // or other standard export statements
119
+ ```
120
+
121
+ or
122
+
110
123
  ```js
111
124
  module.exports = ...
112
125
  ```