lilact 0.23.0 → 0.23.1
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 +4 -4
- package/dist/lilact.development.js +11 -4
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +8 -8
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +7 -7
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +3 -4
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/index.html +4 -4
- package/docs/static/index.html +2 -2
- package/docs/static/lilact.development.js +11 -4
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +8 -8
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +7 -7
- package/examples/index.html +2 -2
- package/examples/lilact.development.js +11 -4
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +8 -8
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +7 -7
- package/package.json +1 -1
- 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
|
|
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.
|
|
@@ -197,7 +197,7 @@ render(<App/>, document.body);
|
|
|
197
197
|
</head>
|
|
198
198
|
<body></body>
|
|
199
199
|
<script type='text/jsx'>
|
|
200
|
-
|
|
200
|
+
import { render } from "lilact";
|
|
201
201
|
|
|
202
202
|
function App() {
|
|
203
203
|
return <div>Hello World</div>;
|
|
@@ -3612,9 +3612,16 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, is_inline = t
|
|
|
3612
3612
|
throw e;
|
|
3613
3613
|
}
|
|
3614
3614
|
}
|
|
3615
|
-
function require2(path2
|
|
3616
|
-
var _a, _b;
|
|
3617
|
-
|
|
3615
|
+
function require2(path2) {
|
|
3616
|
+
var _a, _b, _c, _d, _e, _f;
|
|
3617
|
+
let forceUpdate, checkExport, requirer, isLazy;
|
|
3618
|
+
if (arguments.length === 2 && typeof (arguments[1] === "object")) {
|
|
3619
|
+
forceUpdate = (_a = arguments[1]) == null ? void 0 : _a.forceUpdate;
|
|
3620
|
+
checkExport = (_b = arguments[1]) == null ? void 0 : _b.checkExport;
|
|
3621
|
+
requirer = (_c = arguments[1]) == null ? void 0 : _c.requirer;
|
|
3622
|
+
isLazy = (_d = arguments[1]) == null ? void 0 : _d.isLazy;
|
|
3623
|
+
}
|
|
3624
|
+
if ((_e = lilact_default.importObjectPaths) == null ? void 0 : _e[path2]) return lilact_default.importObjectPaths[path2];
|
|
3618
3625
|
if (required_scripts[path2] && !forceUpdate) return required_scripts[path2].exports;
|
|
3619
3626
|
if (path2[0] === "#") {
|
|
3620
3627
|
const el = document.getElementById(path2);
|
|
@@ -3625,7 +3632,7 @@ function require2(path2, { forceUpdate, checkExport, requirer, isLazy }) {
|
|
|
3625
3632
|
if (requirer && requirer.path) {
|
|
3626
3633
|
path2 = joinPaths(requirer.path, path2);
|
|
3627
3634
|
}
|
|
3628
|
-
if (((
|
|
3635
|
+
if (((_f = lilact_default) == null ? void 0 : _f[LAZY]) || isLazy) {
|
|
3629
3636
|
lilact_default[LAZY] = false;
|
|
3630
3637
|
return fetch(path2).then((res2) => {
|
|
3631
3638
|
if (!res2.ok) throw new Error(`HTTP ${res2.status}`);
|