@alepha/react 0.11.3 → 0.11.4
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 +23 -4
- package/dist/index.browser.js +322 -31
- package/dist/index.browser.js.map +1 -1
- package/dist/{index.d.ts → index.d.mts} +374 -65
- package/dist/index.d.mts.map +1 -0
- package/dist/{index.js → index.mjs} +389 -90
- package/dist/index.mjs.map +1 -0
- package/package.json +13 -12
- package/src/components/NestedView.tsx +4 -4
- package/src/descriptors/$page.ts +21 -25
- package/src/hooks/useAction.ts +467 -0
- package/src/hooks/useActive.ts +1 -7
- package/src/hooks/useEvents.ts +51 -0
- package/src/index.browser.ts +4 -0
- package/src/index.shared.ts +2 -1
- package/src/index.ts +73 -1
- package/src/providers/ReactBrowserRouterProvider.ts +14 -0
- package/src/providers/ReactPageProvider.ts +34 -1
- package/src/providers/ReactServerProvider.ts +48 -68
- package/src/services/ReactPageServerService.ts +43 -0
- package/src/services/ReactPageService.ts +24 -0
- package/src/services/ReactRouter.ts +21 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/src/hooks/useRouterEvents.ts +0 -66
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/components/ClientOnly.tsx","../src/errors/Redirection.ts","../src/providers/ReactPageProvider.ts","../src/services/ReactPageService.ts","../src/descriptors/$page.ts","../src/providers/ReactBrowserRouterProvider.ts","../src/providers/ReactBrowserProvider.ts","../src/components/ErrorBoundary.tsx","../src/components/ErrorViewer.tsx","../src/components/Link.tsx","../src/components/NestedView.tsx","../src/components/NotFound.tsx","../src/contexts/AlephaContext.ts","../src/contexts/RouterLayerContext.ts","../src/hooks/useAction.ts","../src/hooks/useActive.ts","../src/hooks/useAlepha.ts","../src/hooks/useClient.ts","../src/hooks/useEvents.ts","../src/hooks/useInject.ts","../src/hooks/useQueryParams.ts","../src/services/ReactRouter.ts","../src/hooks/useRouter.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A,MAAA;MACE,KAAA,EyB1TA,KzB0TA;IAAR,CAAA;IAmBuB;;;;IA6BW,kBAAA,EAAA;MAU7B,IAAA,EAAA,MAAA;MACA,EAAA,CAAA,EAAA,MAAA;IACL,CAAA;IAAS;;;IA4EF,wBAAA,EAAA;MACP,QAAA,EyBnbW,gBzBmbX;MA2Be,KAAA,EyB7cP,gBzB6cO;MAmBU,SAAA,CAAA,EyB/dZ,azB+dY;IAAS,CAAA;IA0B1B;AASb;;IAEa,0BAAA,EAAA;MADH,KAAA,EyB7fG,gBzB6fH;IAAI,CAAA;IAIG;AAOjB;;IAGa,wBAAA,EAAA;MAEC,KAAA,EyBvgBD,gBzBugBC;MAIJ,KAAA,EyB1gBG,KzB0gBH;IACA,CAAA;IAEC;;;IAOC,sBAAiB,EAAA;MAEZ,KAAA,EyBhhBJ,gBzBghBe;IAKX,CAAA;EAID;;;;;;;;AA4BhB;;;;AAIU,cyBxiBG,WzBwiBH,EyBxiBc,cAAA,CAAA,OzBwiBd,CyBjhBR,cAAA,CAvBsB,MzBwiBd,CAAA,CAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
import { $env, $hook, $inject, $module, Alepha, AlephaError, Descriptor, KIND, createDescriptor, t } from "@alepha/core";
|
|
2
|
+
import { AlephaDateTime, DateTimeProvider } from "@alepha/datetime";
|
|
2
3
|
import { AlephaServer, HttpClient, ServerProvider, ServerRouterProvider, ServerTimingProvider } from "@alepha/server";
|
|
3
4
|
import { AlephaServerCache } from "@alepha/server-cache";
|
|
4
5
|
import { AlephaServerLinks, LinkProvider, ServerLinksProvider } from "@alepha/server-links";
|
|
5
6
|
import { $logger } from "@alepha/logger";
|
|
6
|
-
import React, { StrictMode, createContext, createElement, memo, use, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
7
|
+
import React, { StrictMode, createContext, createElement, memo, use, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
import { existsSync } from "node:fs";
|
|
9
10
|
import { join } from "node:path";
|
|
10
11
|
import { ServerStaticProvider } from "@alepha/server-static";
|
|
11
12
|
import { renderToString } from "react-dom/server";
|
|
12
|
-
import { DateTimeProvider } from "@alepha/datetime";
|
|
13
13
|
import { RouterProvider } from "@alepha/router";
|
|
14
14
|
|
|
15
|
+
//#region src/services/ReactPageService.ts
|
|
16
|
+
var ReactPageService = class {
|
|
17
|
+
fetch(pathname, options = {}) {
|
|
18
|
+
throw new AlephaError("Fetch is not available for this environment.");
|
|
19
|
+
}
|
|
20
|
+
render(name, options = {}) {
|
|
21
|
+
throw new AlephaError("Render is not available for this environment.");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
15
26
|
//#region src/descriptors/$page.ts
|
|
16
27
|
/**
|
|
17
28
|
* Main descriptor for defining a React route in the application.
|
|
@@ -105,6 +116,7 @@ const $page = (options) => {
|
|
|
105
116
|
return createDescriptor(PageDescriptor, options);
|
|
106
117
|
};
|
|
107
118
|
var PageDescriptor = class extends Descriptor {
|
|
119
|
+
reactPageService = $inject(ReactPageService);
|
|
108
120
|
onInit() {
|
|
109
121
|
if (this.options.static) this.options.cache ??= { store: {
|
|
110
122
|
provider: "memory",
|
|
@@ -115,14 +127,16 @@ var PageDescriptor = class extends Descriptor {
|
|
|
115
127
|
return this.options.name ?? this.config.propertyKey;
|
|
116
128
|
}
|
|
117
129
|
/**
|
|
118
|
-
* For testing or build purposes
|
|
130
|
+
* For testing or build purposes.
|
|
131
|
+
*
|
|
132
|
+
* This will render the page (HTML layout included or not) and return the HTML + context.
|
|
119
133
|
* Only valid for server-side rendering, it will throw an error if called on the client-side.
|
|
120
134
|
*/
|
|
121
135
|
async render(options) {
|
|
122
|
-
|
|
136
|
+
return this.reactPageService.render(this.name, options);
|
|
123
137
|
}
|
|
124
138
|
async fetch(options) {
|
|
125
|
-
|
|
139
|
+
return this.reactPageService.fetch(this.options.path || "", options);
|
|
126
140
|
}
|
|
127
141
|
match(url) {
|
|
128
142
|
return false;
|
|
@@ -344,29 +358,38 @@ const useAlepha = () => {
|
|
|
344
358
|
};
|
|
345
359
|
|
|
346
360
|
//#endregion
|
|
347
|
-
//#region src/hooks/
|
|
361
|
+
//#region src/hooks/useEvents.ts
|
|
348
362
|
/**
|
|
349
|
-
*
|
|
363
|
+
* Allow subscribing to multiple Alepha events. See {@link Hooks} for available events.
|
|
364
|
+
*
|
|
365
|
+
* useEvents is fully typed to ensure correct event callback signatures.
|
|
366
|
+
*
|
|
367
|
+
* @example
|
|
368
|
+
* ```tsx
|
|
369
|
+
* useEvents(
|
|
370
|
+
* {
|
|
371
|
+
* "react:transition:begin": (ev) => {
|
|
372
|
+
* console.log("Transition began to:", ev.to);
|
|
373
|
+
* },
|
|
374
|
+
* "react:transition:error": {
|
|
375
|
+
* priority: "first",
|
|
376
|
+
* callback: (ev) => {
|
|
377
|
+
* console.error("Transition error:", ev.error);
|
|
378
|
+
* },
|
|
379
|
+
* },
|
|
380
|
+
* },
|
|
381
|
+
* [],
|
|
382
|
+
* );
|
|
383
|
+
* ```
|
|
350
384
|
*/
|
|
351
|
-
const
|
|
385
|
+
const useEvents = (opts, deps) => {
|
|
352
386
|
const alepha = useAlepha();
|
|
353
387
|
useEffect(() => {
|
|
354
388
|
if (!alepha.isBrowser()) return;
|
|
355
|
-
const cb = (callback) => {
|
|
356
|
-
if (typeof callback === "function") return { callback };
|
|
357
|
-
return callback;
|
|
358
|
-
};
|
|
359
389
|
const subs = [];
|
|
360
|
-
const
|
|
361
|
-
const onEnd = opts.onEnd;
|
|
362
|
-
const onError = opts.onError;
|
|
363
|
-
const onSuccess = opts.onSuccess;
|
|
364
|
-
if (onBegin) subs.push(alepha.events.on("react:transition:begin", cb(onBegin)));
|
|
365
|
-
if (onEnd) subs.push(alepha.events.on("react:transition:end", cb(onEnd)));
|
|
366
|
-
if (onError) subs.push(alepha.events.on("react:transition:error", cb(onError)));
|
|
367
|
-
if (onSuccess) subs.push(alepha.events.on("react:transition:success", cb(onSuccess)));
|
|
390
|
+
for (const [name, hook] of Object.entries(opts)) subs.push(alepha.events.on(name, hook));
|
|
368
391
|
return () => {
|
|
369
|
-
for (const
|
|
392
|
+
for (const clear of subs) clear();
|
|
370
393
|
};
|
|
371
394
|
}, deps);
|
|
372
395
|
};
|
|
@@ -462,8 +485,8 @@ const NestedView = (props) => {
|
|
|
462
485
|
const [animation, setAnimation] = useState("");
|
|
463
486
|
const animationExitDuration = useRef(0);
|
|
464
487
|
const animationExitNow = useRef(0);
|
|
465
|
-
|
|
466
|
-
|
|
488
|
+
useEvents({
|
|
489
|
+
"react:transition:begin": async ({ previous, state: state$1 }) => {
|
|
467
490
|
const layer = previous.layers[index];
|
|
468
491
|
if (`${state$1.url.pathname}/`.startsWith(`${layer?.path}/`)) return;
|
|
469
492
|
const animationExit = parseAnimation(layer.route?.animation, state$1, "exit");
|
|
@@ -478,7 +501,7 @@ const NestedView = (props) => {
|
|
|
478
501
|
setAnimation("");
|
|
479
502
|
}
|
|
480
503
|
},
|
|
481
|
-
|
|
504
|
+
"react:transition:end": async ({ state: state$1 }) => {
|
|
482
505
|
const layer = state$1.layers[index];
|
|
483
506
|
if (animationExitNow.current) {
|
|
484
507
|
const duration = animationExitDuration.current;
|
|
@@ -590,9 +613,34 @@ var ReactPageProvider = class {
|
|
|
590
613
|
getPages() {
|
|
591
614
|
return this.pages;
|
|
592
615
|
}
|
|
616
|
+
getConcretePages() {
|
|
617
|
+
const pages = [];
|
|
618
|
+
for (const page of this.pages) {
|
|
619
|
+
if (page.children && page.children.length > 0) continue;
|
|
620
|
+
const fullPath = this.pathname(page.name);
|
|
621
|
+
if (fullPath.includes(":") || fullPath.includes("*")) {
|
|
622
|
+
if (typeof page.static === "object") {
|
|
623
|
+
const entries = page.static.entries;
|
|
624
|
+
if (entries && entries.length > 0) for (const entry of entries) {
|
|
625
|
+
const params = entry.params;
|
|
626
|
+
const path = this.compile(page.path ?? "", params);
|
|
627
|
+
if (!path.includes(":") && !path.includes("*")) pages.push({
|
|
628
|
+
...page,
|
|
629
|
+
name: params[Object.keys(params)[0]],
|
|
630
|
+
path,
|
|
631
|
+
...entry
|
|
632
|
+
});
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
continue;
|
|
636
|
+
}
|
|
637
|
+
pages.push(page);
|
|
638
|
+
}
|
|
639
|
+
return pages;
|
|
640
|
+
}
|
|
593
641
|
page(name) {
|
|
594
642
|
for (const page of this.pages) if (page.name === name) return page;
|
|
595
|
-
throw new
|
|
643
|
+
throw new AlephaError(`Page '${name}' not found`);
|
|
596
644
|
}
|
|
597
645
|
pathname(name, options = {}) {
|
|
598
646
|
const page = this.page(name);
|
|
@@ -904,26 +952,8 @@ var ReactServerProvider = class {
|
|
|
904
952
|
onConfigure = $hook({
|
|
905
953
|
on: "configure",
|
|
906
954
|
handler: async () => {
|
|
907
|
-
const
|
|
908
|
-
const ssrEnabled = pages.length > 0 && this.env.REACT_SSR_ENABLED !== false;
|
|
955
|
+
const ssrEnabled = this.alepha.descriptors($page).length > 0 && this.env.REACT_SSR_ENABLED !== false;
|
|
909
956
|
this.alepha.state.set("react.server.ssr", ssrEnabled);
|
|
910
|
-
for (const page of pages) {
|
|
911
|
-
page.render = this.createRenderFunction(page.name);
|
|
912
|
-
page.fetch = async (options) => {
|
|
913
|
-
const response = await fetch(`${this.serverProvider.hostname}/${page.pathname(options)}`);
|
|
914
|
-
const html = await response.text();
|
|
915
|
-
if (options?.html) return {
|
|
916
|
-
html,
|
|
917
|
-
response
|
|
918
|
-
};
|
|
919
|
-
const match = html.match(this.ROOT_DIV_REGEX);
|
|
920
|
-
if (match) return {
|
|
921
|
-
html: match[3],
|
|
922
|
-
response
|
|
923
|
-
};
|
|
924
|
-
throw new AlephaError("Invalid HTML response");
|
|
925
|
-
};
|
|
926
|
-
}
|
|
927
957
|
if (this.alepha.isViteDev()) {
|
|
928
958
|
await this.configureVite(ssrEnabled);
|
|
929
959
|
return;
|
|
@@ -1010,53 +1040,51 @@ var ReactServerProvider = class {
|
|
|
1010
1040
|
/**
|
|
1011
1041
|
* For testing purposes, creates a render function that can be used.
|
|
1012
1042
|
*/
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
return {
|
|
1036
|
-
state,
|
|
1037
|
-
html: renderToString(this.pageApi.root(state))
|
|
1038
|
-
};
|
|
1039
|
-
}
|
|
1040
|
-
const template = this.template ?? "";
|
|
1041
|
-
const html = this.renderToHtml(template, state, options.hydration);
|
|
1042
|
-
if (html instanceof Redirection) return {
|
|
1043
|
-
state,
|
|
1044
|
-
html: "",
|
|
1045
|
-
redirect
|
|
1046
|
-
};
|
|
1047
|
-
const result = {
|
|
1043
|
+
async render(name, options = {}) {
|
|
1044
|
+
const page = this.pageApi.page(name);
|
|
1045
|
+
const url = new URL(this.pageApi.url(name, options));
|
|
1046
|
+
const state = {
|
|
1047
|
+
url,
|
|
1048
|
+
params: options.params ?? {},
|
|
1049
|
+
query: options.query ?? {},
|
|
1050
|
+
onError: () => null,
|
|
1051
|
+
layers: [],
|
|
1052
|
+
meta: {}
|
|
1053
|
+
};
|
|
1054
|
+
this.log.trace("Rendering", { url });
|
|
1055
|
+
await this.alepha.events.emit("react:server:render:begin", { state });
|
|
1056
|
+
const { redirect } = await this.pageApi.createLayers(page, state);
|
|
1057
|
+
if (redirect) return {
|
|
1058
|
+
state,
|
|
1059
|
+
html: "",
|
|
1060
|
+
redirect
|
|
1061
|
+
};
|
|
1062
|
+
if (!options.html) {
|
|
1063
|
+
this.alepha.state.set("react.router.state", state);
|
|
1064
|
+
return {
|
|
1048
1065
|
state,
|
|
1049
|
-
html
|
|
1066
|
+
html: renderToString(this.pageApi.root(state))
|
|
1050
1067
|
};
|
|
1051
|
-
|
|
1052
|
-
|
|
1068
|
+
}
|
|
1069
|
+
const template = this.template ?? "";
|
|
1070
|
+
const html = this.renderToHtml(template, state, options.hydration);
|
|
1071
|
+
if (html instanceof Redirection) return {
|
|
1072
|
+
state,
|
|
1073
|
+
html: "",
|
|
1074
|
+
redirect
|
|
1053
1075
|
};
|
|
1076
|
+
const result = {
|
|
1077
|
+
state,
|
|
1078
|
+
html
|
|
1079
|
+
};
|
|
1080
|
+
await this.alepha.events.emit("react:server:render:end", result);
|
|
1081
|
+
return result;
|
|
1054
1082
|
}
|
|
1055
1083
|
createHandler(route, templateLoader) {
|
|
1056
1084
|
return async (serverRequest) => {
|
|
1057
1085
|
const { url, reply, query, params } = serverRequest;
|
|
1058
1086
|
const template = await templateLoader();
|
|
1059
|
-
if (!template) throw new AlephaError("
|
|
1087
|
+
if (!template) throw new AlephaError("Missing template for SSR rendering");
|
|
1060
1088
|
this.log.trace("Rendering page", { name: route.name });
|
|
1061
1089
|
const state = {
|
|
1062
1090
|
url,
|
|
@@ -1186,6 +1214,30 @@ var ReactServerProvider = class {
|
|
|
1186
1214
|
}
|
|
1187
1215
|
};
|
|
1188
1216
|
|
|
1217
|
+
//#endregion
|
|
1218
|
+
//#region src/services/ReactPageServerService.ts
|
|
1219
|
+
var ReactPageServerService = class extends ReactPageService {
|
|
1220
|
+
reactServerProvider = $inject(ReactServerProvider);
|
|
1221
|
+
serverProvider = $inject(ServerProvider);
|
|
1222
|
+
async render(name, options = {}) {
|
|
1223
|
+
return this.reactServerProvider.render(name, options);
|
|
1224
|
+
}
|
|
1225
|
+
async fetch(pathname, options = {}) {
|
|
1226
|
+
const response = await fetch(`${this.serverProvider.hostname}/${pathname}`);
|
|
1227
|
+
const html = await response.text();
|
|
1228
|
+
if (options?.html) return {
|
|
1229
|
+
html,
|
|
1230
|
+
response
|
|
1231
|
+
};
|
|
1232
|
+
const match = html.match(this.reactServerProvider.ROOT_DIV_REGEX);
|
|
1233
|
+
if (match) return {
|
|
1234
|
+
html: match[3],
|
|
1235
|
+
response
|
|
1236
|
+
};
|
|
1237
|
+
throw new AlephaError("Invalid HTML response");
|
|
1238
|
+
}
|
|
1239
|
+
};
|
|
1240
|
+
|
|
1189
1241
|
//#endregion
|
|
1190
1242
|
//#region src/providers/ReactBrowserRouterProvider.ts
|
|
1191
1243
|
var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
@@ -1214,6 +1266,7 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
|
1214
1266
|
onError: () => null,
|
|
1215
1267
|
meta
|
|
1216
1268
|
};
|
|
1269
|
+
await this.alepha.events.emit("react:action:begin", { type: "transition" });
|
|
1217
1270
|
await this.alepha.events.emit("react:transition:begin", {
|
|
1218
1271
|
previous: this.alepha.state.get("react.router.state"),
|
|
1219
1272
|
state
|
|
@@ -1234,6 +1287,7 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
|
1234
1287
|
index: 0,
|
|
1235
1288
|
path: "/"
|
|
1236
1289
|
});
|
|
1290
|
+
await this.alepha.events.emit("react:action:success", { type: "transition" });
|
|
1237
1291
|
await this.alepha.events.emit("react:transition:success", { state });
|
|
1238
1292
|
} catch (e) {
|
|
1239
1293
|
this.log.error("Transition has failed", e);
|
|
@@ -1243,6 +1297,10 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
|
1243
1297
|
index: 0,
|
|
1244
1298
|
path: "/"
|
|
1245
1299
|
}];
|
|
1300
|
+
await this.alepha.events.emit("react:action:error", {
|
|
1301
|
+
type: "transition",
|
|
1302
|
+
error: e
|
|
1303
|
+
});
|
|
1246
1304
|
await this.alepha.events.emit("react:transition:error", {
|
|
1247
1305
|
error: e,
|
|
1248
1306
|
state
|
|
@@ -1253,6 +1311,7 @@ var ReactBrowserRouterProvider = class extends RouterProvider {
|
|
|
1253
1311
|
if (state.layers[i]?.name !== layer.name) this.pageApi.page(layer.name)?.onLeave?.();
|
|
1254
1312
|
}
|
|
1255
1313
|
this.alepha.state.set("react.router.state", state);
|
|
1314
|
+
await this.alepha.events.emit("react:action:end", { type: "transition" });
|
|
1256
1315
|
await this.alepha.events.emit("react:transition:end", { state });
|
|
1257
1316
|
}
|
|
1258
1317
|
root(state) {
|
|
@@ -1428,9 +1487,18 @@ var ReactRouter = class {
|
|
|
1428
1487
|
get pages() {
|
|
1429
1488
|
return this.pageApi.getPages();
|
|
1430
1489
|
}
|
|
1490
|
+
get concretePages() {
|
|
1491
|
+
return this.pageApi.getConcretePages();
|
|
1492
|
+
}
|
|
1431
1493
|
get browser() {
|
|
1432
1494
|
if (this.alepha.isBrowser()) return this.alepha.inject(ReactBrowserProvider);
|
|
1433
1495
|
}
|
|
1496
|
+
isActive(href, options = {}) {
|
|
1497
|
+
const current = this.state.url.pathname;
|
|
1498
|
+
let isActive = current === href || current === `${href}/` || `${current}/` === href;
|
|
1499
|
+
if (options.startWith && !isActive) isActive = current.startsWith(href);
|
|
1500
|
+
return isActive;
|
|
1501
|
+
}
|
|
1434
1502
|
path(name, config = {}) {
|
|
1435
1503
|
return this.pageApi.pathname(name, {
|
|
1436
1504
|
params: {
|
|
@@ -1564,19 +1632,245 @@ const Link = (props) => {
|
|
|
1564
1632
|
};
|
|
1565
1633
|
var Link_default = Link;
|
|
1566
1634
|
|
|
1635
|
+
//#endregion
|
|
1636
|
+
//#region src/hooks/useAction.ts
|
|
1637
|
+
/**
|
|
1638
|
+
* Hook for handling async actions with automatic error handling and event emission.
|
|
1639
|
+
*
|
|
1640
|
+
* By default, prevents concurrent executions - if an action is running and you call it again,
|
|
1641
|
+
* the second call will be ignored. Use `debounce` option to delay execution instead.
|
|
1642
|
+
*
|
|
1643
|
+
* Emits lifecycle events:
|
|
1644
|
+
* - `react:action:begin` - When action starts
|
|
1645
|
+
* - `react:action:success` - When action completes successfully
|
|
1646
|
+
* - `react:action:error` - When action throws an error
|
|
1647
|
+
* - `react:action:end` - Always emitted at the end
|
|
1648
|
+
*
|
|
1649
|
+
* @example Basic usage
|
|
1650
|
+
* ```tsx
|
|
1651
|
+
* const action = useAction({
|
|
1652
|
+
* handler: async (data) => {
|
|
1653
|
+
* await api.save(data);
|
|
1654
|
+
* }
|
|
1655
|
+
* }, []);
|
|
1656
|
+
*
|
|
1657
|
+
* <button onClick={() => action.run(data)} disabled={action.loading}>
|
|
1658
|
+
* Save
|
|
1659
|
+
* </button>
|
|
1660
|
+
* ```
|
|
1661
|
+
*
|
|
1662
|
+
* @example With debounce (search input)
|
|
1663
|
+
* ```tsx
|
|
1664
|
+
* const search = useAction({
|
|
1665
|
+
* handler: async (query: string) => {
|
|
1666
|
+
* await api.search(query);
|
|
1667
|
+
* },
|
|
1668
|
+
* debounce: 300 // Wait 300ms after last call
|
|
1669
|
+
* }, []);
|
|
1670
|
+
*
|
|
1671
|
+
* <input onChange={(e) => search.run(e.target.value)} />
|
|
1672
|
+
* ```
|
|
1673
|
+
*
|
|
1674
|
+
* @example Run on component mount
|
|
1675
|
+
* ```tsx
|
|
1676
|
+
* const fetchData = useAction({
|
|
1677
|
+
* handler: async () => {
|
|
1678
|
+
* const data = await api.getData();
|
|
1679
|
+
* return data;
|
|
1680
|
+
* },
|
|
1681
|
+
* runOnInit: true // Runs once when component mounts
|
|
1682
|
+
* }, []);
|
|
1683
|
+
* ```
|
|
1684
|
+
*
|
|
1685
|
+
* @example Run periodically (polling)
|
|
1686
|
+
* ```tsx
|
|
1687
|
+
* const pollStatus = useAction({
|
|
1688
|
+
* handler: async () => {
|
|
1689
|
+
* const status = await api.getStatus();
|
|
1690
|
+
* return status;
|
|
1691
|
+
* },
|
|
1692
|
+
* runEvery: 5000 // Run every 5 seconds
|
|
1693
|
+
* }, []);
|
|
1694
|
+
*
|
|
1695
|
+
* // Or with duration tuple
|
|
1696
|
+
* const pollStatus = useAction({
|
|
1697
|
+
* handler: async () => {
|
|
1698
|
+
* const status = await api.getStatus();
|
|
1699
|
+
* return status;
|
|
1700
|
+
* },
|
|
1701
|
+
* runEvery: [30, 'seconds'] // Run every 30 seconds
|
|
1702
|
+
* }, []);
|
|
1703
|
+
* ```
|
|
1704
|
+
*
|
|
1705
|
+
* @example With AbortController
|
|
1706
|
+
* ```tsx
|
|
1707
|
+
* const fetch = useAction({
|
|
1708
|
+
* handler: async (url, { signal }) => {
|
|
1709
|
+
* const response = await fetch(url, { signal });
|
|
1710
|
+
* return response.json();
|
|
1711
|
+
* }
|
|
1712
|
+
* }, []);
|
|
1713
|
+
* // Automatically cancelled on unmount or when new request starts
|
|
1714
|
+
* ```
|
|
1715
|
+
*
|
|
1716
|
+
* @example With error handling
|
|
1717
|
+
* ```tsx
|
|
1718
|
+
* const deleteAction = useAction({
|
|
1719
|
+
* handler: async (id: string) => {
|
|
1720
|
+
* await api.delete(id);
|
|
1721
|
+
* },
|
|
1722
|
+
* onError: (error) => {
|
|
1723
|
+
* if (error.code === 'NOT_FOUND') {
|
|
1724
|
+
* // Custom error handling
|
|
1725
|
+
* }
|
|
1726
|
+
* }
|
|
1727
|
+
* }, []);
|
|
1728
|
+
*
|
|
1729
|
+
* {deleteAction.error && <div>Error: {deleteAction.error.message}</div>}
|
|
1730
|
+
* ```
|
|
1731
|
+
*
|
|
1732
|
+
* @example Global error handling
|
|
1733
|
+
* ```tsx
|
|
1734
|
+
* // In your root app setup
|
|
1735
|
+
* alepha.events.on("react:action:error", ({ error }) => {
|
|
1736
|
+
* toast.danger(error.message);
|
|
1737
|
+
* Sentry.captureException(error);
|
|
1738
|
+
* });
|
|
1739
|
+
* ```
|
|
1740
|
+
*/
|
|
1741
|
+
function useAction(options, deps) {
|
|
1742
|
+
const alepha = useAlepha();
|
|
1743
|
+
const dateTimeProvider = useInject(DateTimeProvider);
|
|
1744
|
+
const [loading, setLoading] = useState(false);
|
|
1745
|
+
const [error, setError] = useState();
|
|
1746
|
+
const isExecutingRef = useRef(false);
|
|
1747
|
+
const debounceTimerRef = useRef(void 0);
|
|
1748
|
+
const abortControllerRef = useRef(void 0);
|
|
1749
|
+
const isMountedRef = useRef(true);
|
|
1750
|
+
const intervalRef = useRef(void 0);
|
|
1751
|
+
useEffect(() => {
|
|
1752
|
+
return () => {
|
|
1753
|
+
isMountedRef.current = false;
|
|
1754
|
+
if (debounceTimerRef.current) {
|
|
1755
|
+
dateTimeProvider.clearTimeout(debounceTimerRef.current);
|
|
1756
|
+
debounceTimerRef.current = void 0;
|
|
1757
|
+
}
|
|
1758
|
+
if (intervalRef.current) {
|
|
1759
|
+
dateTimeProvider.clearInterval(intervalRef.current);
|
|
1760
|
+
intervalRef.current = void 0;
|
|
1761
|
+
}
|
|
1762
|
+
if (abortControllerRef.current) {
|
|
1763
|
+
abortControllerRef.current.abort();
|
|
1764
|
+
abortControllerRef.current = void 0;
|
|
1765
|
+
}
|
|
1766
|
+
};
|
|
1767
|
+
}, []);
|
|
1768
|
+
const executeAction = useCallback(async (...args) => {
|
|
1769
|
+
if (isExecutingRef.current) return;
|
|
1770
|
+
if (abortControllerRef.current) abortControllerRef.current.abort();
|
|
1771
|
+
const abortController = new AbortController();
|
|
1772
|
+
abortControllerRef.current = abortController;
|
|
1773
|
+
isExecutingRef.current = true;
|
|
1774
|
+
setLoading(true);
|
|
1775
|
+
setError(void 0);
|
|
1776
|
+
await alepha.events.emit("react:action:begin", {
|
|
1777
|
+
type: "custom",
|
|
1778
|
+
id: options.id
|
|
1779
|
+
});
|
|
1780
|
+
try {
|
|
1781
|
+
const result = await options.handler(...args, { signal: abortController.signal });
|
|
1782
|
+
if (!isMountedRef.current || abortController.signal.aborted) return;
|
|
1783
|
+
await alepha.events.emit("react:action:success", {
|
|
1784
|
+
type: "custom",
|
|
1785
|
+
id: options.id
|
|
1786
|
+
});
|
|
1787
|
+
if (options.onSuccess) await options.onSuccess(result);
|
|
1788
|
+
return result;
|
|
1789
|
+
} catch (err) {
|
|
1790
|
+
if (err instanceof Error && err.name === "AbortError") return;
|
|
1791
|
+
if (!isMountedRef.current) return;
|
|
1792
|
+
const error$1 = err;
|
|
1793
|
+
setError(error$1);
|
|
1794
|
+
await alepha.events.emit("react:action:error", {
|
|
1795
|
+
type: "custom",
|
|
1796
|
+
id: options.id,
|
|
1797
|
+
error: error$1
|
|
1798
|
+
});
|
|
1799
|
+
if (options.onError) await options.onError(error$1);
|
|
1800
|
+
else throw error$1;
|
|
1801
|
+
} finally {
|
|
1802
|
+
isExecutingRef.current = false;
|
|
1803
|
+
setLoading(false);
|
|
1804
|
+
await alepha.events.emit("react:action:end", {
|
|
1805
|
+
type: "custom",
|
|
1806
|
+
id: options.id
|
|
1807
|
+
});
|
|
1808
|
+
if (abortControllerRef.current === abortController) abortControllerRef.current = void 0;
|
|
1809
|
+
}
|
|
1810
|
+
}, [
|
|
1811
|
+
...deps,
|
|
1812
|
+
options.id,
|
|
1813
|
+
options.onError,
|
|
1814
|
+
options.onSuccess
|
|
1815
|
+
]);
|
|
1816
|
+
const handler = useCallback(async (...args) => {
|
|
1817
|
+
if (options.debounce) {
|
|
1818
|
+
if (debounceTimerRef.current) dateTimeProvider.clearTimeout(debounceTimerRef.current);
|
|
1819
|
+
return new Promise((resolve) => {
|
|
1820
|
+
debounceTimerRef.current = dateTimeProvider.createTimeout(async () => {
|
|
1821
|
+
resolve(await executeAction(...args));
|
|
1822
|
+
}, options.debounce ?? 0);
|
|
1823
|
+
});
|
|
1824
|
+
}
|
|
1825
|
+
return executeAction(...args);
|
|
1826
|
+
}, [executeAction, options.debounce]);
|
|
1827
|
+
const cancel = useCallback(() => {
|
|
1828
|
+
if (debounceTimerRef.current) {
|
|
1829
|
+
dateTimeProvider.clearTimeout(debounceTimerRef.current);
|
|
1830
|
+
debounceTimerRef.current = void 0;
|
|
1831
|
+
}
|
|
1832
|
+
if (abortControllerRef.current) {
|
|
1833
|
+
abortControllerRef.current.abort();
|
|
1834
|
+
abortControllerRef.current = void 0;
|
|
1835
|
+
}
|
|
1836
|
+
if (isMountedRef.current) {
|
|
1837
|
+
isExecutingRef.current = false;
|
|
1838
|
+
setLoading(false);
|
|
1839
|
+
}
|
|
1840
|
+
}, []);
|
|
1841
|
+
useEffect(() => {
|
|
1842
|
+
if (options.runOnInit) handler(...[]);
|
|
1843
|
+
}, []);
|
|
1844
|
+
useEffect(() => {
|
|
1845
|
+
if (!options.runEvery) return;
|
|
1846
|
+
intervalRef.current = dateTimeProvider.createInterval(() => handler(...[]), options.runEvery, true);
|
|
1847
|
+
return () => {
|
|
1848
|
+
if (intervalRef.current) {
|
|
1849
|
+
dateTimeProvider.clearInterval(intervalRef.current);
|
|
1850
|
+
intervalRef.current = void 0;
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
}, [handler, options.runEvery]);
|
|
1854
|
+
return {
|
|
1855
|
+
run: handler,
|
|
1856
|
+
loading,
|
|
1857
|
+
error,
|
|
1858
|
+
cancel
|
|
1859
|
+
};
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1567
1862
|
//#endregion
|
|
1568
1863
|
//#region src/hooks/useActive.ts
|
|
1569
1864
|
const useActive = (args) => {
|
|
1570
1865
|
const router = useRouter();
|
|
1571
1866
|
const [isPending, setPending] = useState(false);
|
|
1572
|
-
|
|
1867
|
+
useRouterState().url.pathname;
|
|
1573
1868
|
const options = typeof args === "string" ? { href: args } : {
|
|
1574
1869
|
...args,
|
|
1575
1870
|
href: args.href
|
|
1576
1871
|
};
|
|
1577
1872
|
const href = options.href;
|
|
1578
|
-
|
|
1579
|
-
if (options.startWith && !isActive) isActive = current.startsWith(href);
|
|
1873
|
+
const isActive = router.isActive(href, options);
|
|
1580
1874
|
return {
|
|
1581
1875
|
isPending,
|
|
1582
1876
|
isActive,
|
|
@@ -1696,11 +1990,16 @@ const AlephaReact = $module({
|
|
|
1696
1990
|
services: [
|
|
1697
1991
|
ReactServerProvider,
|
|
1698
1992
|
ReactPageProvider,
|
|
1699
|
-
ReactRouter
|
|
1993
|
+
ReactRouter,
|
|
1994
|
+
ReactPageService,
|
|
1995
|
+
ReactPageServerService
|
|
1700
1996
|
],
|
|
1701
|
-
register: (alepha) => alepha.with(
|
|
1997
|
+
register: (alepha) => alepha.with(AlephaDateTime).with(AlephaServer).with(AlephaServerCache).with(AlephaServerLinks).with({
|
|
1998
|
+
provide: ReactPageService,
|
|
1999
|
+
use: ReactPageServerService
|
|
2000
|
+
}).with(ReactServerProvider).with(ReactPageProvider).with(ReactRouter)
|
|
1702
2001
|
});
|
|
1703
2002
|
|
|
1704
2003
|
//#endregion
|
|
1705
|
-
export { $page, AlephaContext, AlephaReact, ClientOnly_default as ClientOnly, ErrorBoundary_default as ErrorBoundary, ErrorViewer_default as ErrorViewer, Link_default as Link, NestedView_default as NestedView, NotFoundPage as NotFound, PageDescriptor, ReactBrowserProvider, ReactPageProvider, ReactRouter, ReactServerProvider, Redirection, RouterLayerContext, isPageRoute, ssrSchemaLoading, useActive, useAlepha, useClient, useInject, useQueryParams, useRouter,
|
|
1706
|
-
//# sourceMappingURL=index.
|
|
2004
|
+
export { $page, AlephaContext, AlephaReact, ClientOnly_default as ClientOnly, ErrorBoundary_default as ErrorBoundary, ErrorViewer_default as ErrorViewer, Link_default as Link, NestedView_default as NestedView, NotFoundPage as NotFound, PageDescriptor, ReactBrowserProvider, ReactPageProvider, ReactRouter, ReactServerProvider, Redirection, RouterLayerContext, isPageRoute, ssrSchemaLoading, useAction, useActive, useAlepha, useClient, useEvents, useInject, useQueryParams, useRouter, useRouterState, useSchema, useStore };
|
|
2005
|
+
//# sourceMappingURL=index.mjs.map
|