lilact 0.26.7 → 0.26.9
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/bin/bundle.cjs +3 -2
- package/dist/lilact.development.js +22 -14
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +6 -6
- package/dist/lilact.development.min.js.map +2 -2
- package/dist/lilact.production.min.js +6 -6
- package/docs/functions/hooks.useInsertionEffect.html +2 -2
- package/docs/functions/run.lazy.html +1 -1
- package/docs/functions/run.require.html +1 -1
- package/docs/functions/run.runScripts.html +1 -1
- package/docs/static/lilact.development.js +22 -14
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +6 -6
- package/docs/static/lilact.development.min.js.map +2 -2
- package/docs/static/lilact.production.min.js +6 -6
- package/examples/lilact.development.js +22 -14
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +6 -6
- package/examples/lilact.development.min.js.map +2 -2
- package/examples/lilact.production.min.js +6 -6
- package/package.json +1 -1
- package/src/hooks.jsx +9 -9
- package/src/jsx.js +1 -1
- package/src/lilact.jsx +4 -0
- package/src/run.jsx +7 -1
package/bin/bundle.cjs
CHANGED
|
@@ -118,11 +118,12 @@ async function run() {
|
|
|
118
118
|
|
|
119
119
|
if (!userEntry) {
|
|
120
120
|
console.error(
|
|
121
|
-
"Usage: lilact-bundler --watch --minify --entry ./path/to/entry.js --mode production --out ./dist"
|
|
121
|
+
"Usage: lilact-bundler --watch --split --minify --entry ./path/to/entry.js --mode production --out ./dist --name bundle"
|
|
122
122
|
);
|
|
123
123
|
process.exit(1);
|
|
124
124
|
}
|
|
125
125
|
|
|
126
|
+
const name = args.name ?? "bundle";
|
|
126
127
|
const mode = args.mode ?? "production";
|
|
127
128
|
const watch = args?.watch === true;
|
|
128
129
|
const minify = args?.minify === true;
|
|
@@ -148,7 +149,7 @@ async function run() {
|
|
|
148
149
|
};
|
|
149
150
|
|
|
150
151
|
const ctx = await esbuild.context({
|
|
151
|
-
entryPoints: {
|
|
152
|
+
entryPoints: {[name]: userEntry},
|
|
152
153
|
bundle: true,
|
|
153
154
|
format: "esm",
|
|
154
155
|
platform: "browser",
|
|
@@ -3438,7 +3438,7 @@ function useRef(initialValue = null) {
|
|
|
3438
3438
|
}
|
|
3439
3439
|
return hk;
|
|
3440
3440
|
}
|
|
3441
|
-
function useLayoutEffect(effect, deps = void 0) {
|
|
3441
|
+
async function useLayoutEffect(effect, deps = void 0) {
|
|
3442
3442
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3443
3443
|
throw new Error("Layout effect dependencies must be an array, object or omitted.");
|
|
3444
3444
|
}
|
|
@@ -3447,16 +3447,16 @@ function useLayoutEffect(effect, deps = void 0) {
|
|
|
3447
3447
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3448
3448
|
}
|
|
3449
3449
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3450
|
-
hk.cleanup();
|
|
3450
|
+
await hk.cleanup();
|
|
3451
3451
|
}
|
|
3452
3452
|
hk.deps = deps;
|
|
3453
|
-
lilact_default.layout_effects.add(() => {
|
|
3454
|
-
hk.cleanup = effect();
|
|
3453
|
+
lilact_default.layout_effects.add(async () => {
|
|
3454
|
+
hk.cleanup = await effect();
|
|
3455
3455
|
});
|
|
3456
3456
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3457
3457
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3458
3458
|
}
|
|
3459
|
-
function useEffect(effect, deps = void 0) {
|
|
3459
|
+
async function useEffect(effect, deps = void 0) {
|
|
3460
3460
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3461
3461
|
throw new Error("Effect dependencies must be an array, object or omitted.");
|
|
3462
3462
|
}
|
|
@@ -3465,16 +3465,16 @@ function useEffect(effect, deps = void 0) {
|
|
|
3465
3465
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3466
3466
|
}
|
|
3467
3467
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3468
|
-
hk.cleanup();
|
|
3468
|
+
await hk.cleanup();
|
|
3469
3469
|
}
|
|
3470
3470
|
hk.deps = deps;
|
|
3471
|
-
lilact_default.passive_effects.add(() => {
|
|
3472
|
-
hk.cleanup = effect();
|
|
3471
|
+
lilact_default.passive_effects.add(async () => {
|
|
3472
|
+
hk.cleanup = await effect();
|
|
3473
3473
|
});
|
|
3474
3474
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3475
3475
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
3476
3476
|
}
|
|
3477
|
-
function useInsertionEffect(effect, deps = void 0) {
|
|
3477
|
+
async function useInsertionEffect(effect, deps = void 0) {
|
|
3478
3478
|
if (deps !== void 0 && (typeof deps !== "object" || deps.constructor.name !== "Array")) {
|
|
3479
3479
|
throw new Error("Insertion effect dependencies must be an array, object, or omitted.");
|
|
3480
3480
|
}
|
|
@@ -3483,11 +3483,11 @@ function useInsertionEffect(effect, deps = void 0) {
|
|
|
3483
3483
|
if (deps !== void 0 && (hk == null ? void 0 : hk.deps) !== void 0 && shallowEqual(deps, hk.deps)) return;
|
|
3484
3484
|
}
|
|
3485
3485
|
if (hk == null ? void 0 : hk.cleanup) {
|
|
3486
|
-
hk.cleanup();
|
|
3486
|
+
await hk.cleanup();
|
|
3487
3487
|
}
|
|
3488
3488
|
hk.deps = deps;
|
|
3489
|
-
lilact_default.insertion_effects.add(() => {
|
|
3490
|
-
hk.cleanup = effect();
|
|
3489
|
+
lilact_default.insertion_effects.add(async () => {
|
|
3490
|
+
hk.cleanup = await effect();
|
|
3491
3491
|
});
|
|
3492
3492
|
lilact_default.clearTimeout(lilact_default.effect_timeout);
|
|
3493
3493
|
lilact_default.setTimeout(lilact_default.processEffects, 0);
|
|
@@ -3633,9 +3633,9 @@ function run(jsx, path = `InlineJSX-${++lilact_default.eval_num}`, { isInline, i
|
|
|
3633
3633
|
mappings,
|
|
3634
3634
|
factory: "createComponent",
|
|
3635
3635
|
appendSourcemap: false,
|
|
3636
|
-
blocks_info: lilact_default.blocks_info,
|
|
3637
3636
|
injectTraceLabels: true,
|
|
3638
|
-
produceCJS: true
|
|
3637
|
+
produceCJS: true,
|
|
3638
|
+
blocks_info: lilact_default.blocks_info
|
|
3639
3639
|
}
|
|
3640
3640
|
);
|
|
3641
3641
|
} catch (e) {
|
|
@@ -3675,6 +3675,7 @@ function require2(path2) {
|
|
|
3675
3675
|
if (el) {
|
|
3676
3676
|
return run(el.innerText, path2);
|
|
3677
3677
|
}
|
|
3678
|
+
throw new Error(`Required element not found (${path2})`);
|
|
3678
3679
|
} else {
|
|
3679
3680
|
if (requirer && requirer.path) {
|
|
3680
3681
|
path2 = joinPaths(requirer.path, path2);
|
|
@@ -3704,6 +3705,10 @@ function require2(path2) {
|
|
|
3704
3705
|
} else {
|
|
3705
3706
|
const p = (_j = (_i = lilact_default).resolver) == null ? void 0 : _j.call(_i, path2);
|
|
3706
3707
|
if (p) {
|
|
3708
|
+
if (path2.endsWith(".css")) {
|
|
3709
|
+
injectGlobal(p);
|
|
3710
|
+
return;
|
|
3711
|
+
}
|
|
3707
3712
|
return run(p, path2, false);
|
|
3708
3713
|
} else {
|
|
3709
3714
|
const request = new XMLHttpRequest();
|
|
@@ -6658,6 +6663,9 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
|
6658
6663
|
Lilact2.runScripts();
|
|
6659
6664
|
});
|
|
6660
6665
|
if (true) {
|
|
6666
|
+
window.addEventListener("unhandledrejection", (e) => {
|
|
6667
|
+
Lilact2.globalErrorHandler(e.reason);
|
|
6668
|
+
});
|
|
6661
6669
|
window.addEventListener("error", (e) => {
|
|
6662
6670
|
Lilact2.globalErrorHandler(e);
|
|
6663
6671
|
});
|