lilact 0.23.0 → 0.24.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 (41) hide show
  1. package/README.md +19 -5
  2. package/dist/lilact.development.js +490 -464
  3. package/dist/lilact.development.js.map +4 -4
  4. package/dist/lilact.development.min.js +24 -24
  5. package/dist/lilact.development.min.js.map +4 -4
  6. package/dist/lilact.production.min.js +24 -24
  7. package/docs/assets/hierarchy.js +1 -1
  8. package/docs/classes/components.Component.html +1 -1
  9. package/docs/classes/components.HTMLComponent.html +1 -1
  10. package/docs/classes/components.RootComponent.html +1 -1
  11. package/docs/functions/components.cloneComponent.html +1 -1
  12. package/docs/functions/run.lazy.html +1 -1
  13. package/docs/functions/run.require.html +3 -4
  14. package/docs/functions/run.runScripts.html +1 -1
  15. package/docs/functions/timers.timeoutPromise.html +4 -4
  16. package/docs/hierarchy.html +1 -1
  17. package/docs/index.html +21 -5
  18. package/docs/static/demos/cloneelement.jsx +6 -0
  19. package/docs/static/demos/lazy.jsx +1 -1
  20. package/docs/static/demos/legacy-context.jsx +0 -7
  21. package/docs/static/index.html +3 -3
  22. package/docs/static/lilact.development.js +490 -464
  23. package/docs/static/lilact.development.js.map +4 -4
  24. package/docs/static/lilact.development.min.js +24 -24
  25. package/docs/static/lilact.development.min.js.map +4 -4
  26. package/docs/static/lilact.production.min.js +24 -24
  27. package/docs/variables/components.cloneElement.html +1 -1
  28. package/examples/demos/cloneelement.jsx +6 -0
  29. package/examples/demos/lazy.jsx +1 -1
  30. package/examples/demos/legacy-context.jsx +0 -7
  31. package/examples/index.html +3 -3
  32. package/examples/lilact.development.js +490 -464
  33. package/examples/lilact.development.js.map +4 -4
  34. package/examples/lilact.development.min.js +24 -24
  35. package/examples/lilact.development.min.js.map +4 -4
  36. package/examples/lilact.production.min.js +24 -24
  37. package/package.json +1 -1
  38. package/src/components.jsx +3 -3
  39. package/src/lilact.jsx +1 -1
  40. package/src/proptypes.jsx +38 -0
  41. package/src/run.jsx +10 -11
package/README.md CHANGED
@@ -53,7 +53,7 @@ There is a `transpile.js` helper in the `bin` directory to demonstrate how to us
53
53
 
54
54
  In addition to the API itself, it bundles the official `Redux` library (see the `redux.jsx` example). As a result, it has Redux support and provides all necessary functions and hooks for working with it.
55
55
 
56
- It also includes the amazing `@emotion/css` library to ease working with styles. You can access it via `Lilact.emotion`.
56
+ It also includes the amazing `@emotion/css` library to ease working with styles. You can access it via `Lilact.emotion` or by importing `@emotion/css`.
57
57
 
58
58
  For convenience, it already includes components such as:
59
59
 
@@ -106,7 +106,7 @@ import App from './App.jsx'; // imports the default export
106
106
  or
107
107
 
108
108
  ```js
109
- const { useState, useRef, render, require } = Lilact;
109
+ const { useState, useRef, render } = Lilact;
110
110
 
111
111
  const App = require('./App.jsx');
112
112
  ```
@@ -121,7 +121,7 @@ export default ...
121
121
  or
122
122
 
123
123
  ```js
124
- module.exports = ...
124
+ module.exports.default = ...
125
125
  ```
126
126
 
127
127
  Bundled projects can also be used statically on other backends. However, bundling is not required: JSX files can be served and transpiled live.
@@ -175,7 +175,7 @@ This is not the only way to use it—inside Node projects you can use standard m
175
175
 
176
176
  ### Node.js example
177
177
 
178
- ```js
178
+ ```jsx
179
179
  import { render } from "lilact";
180
180
 
181
181
  function App() {
@@ -197,7 +197,7 @@ render(<App/>, document.body);
197
197
  </head>
198
198
  <body></body>
199
199
  <script type='text/jsx'>
200
- const { render } = Lilact;
200
+ import { render } from "lilact";
201
201
 
202
202
  function App() {
203
203
  return <div>Hello World</div>;
@@ -212,6 +212,20 @@ render(<App/>, document.body);
212
212
 
213
213
  ## Learn More / Examples / Beta Status
214
214
 
215
+ `Lilact` tries to mimic `React` API as close as possible. So the [Official React API Reference](https://react.dev/reference/react) can be used as a perfect resource. Most of its examples would work in `Lilact` with just substituting import source "react" with "lilact"! There are a few differences that are mentioned in `Lilact` documentation. You can even do:
216
+
217
+ ```jsx
218
+ import React from "lilact"
219
+
220
+ ```
221
+
222
+ And things will probably work just fine. For `redux` and `emotion` just import as you would do, `Lilact` will fix the references automatically:
223
+
224
+ ```jsx
225
+ import redux from "redux";
226
+ import emotion from "@emotion/css";
227
+ ```
228
+
215
229
  To know more about using `Lilact`, see the included examples:
216
230
  [Lilact Examples](https://arashkazemi.github.io/lilact/static)
217
231