one 1.1.314 → 1.1.315
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/cleanUrl.cjs.map +1 -1
- package/dist/cjs/cleanUrl.native.js.map +1 -1
- package/dist/cjs/createHandleRequest.cjs +1 -1
- package/dist/cjs/createHandleRequest.cjs.map +1 -1
- package/dist/cjs/createHandleRequest.native.js +1 -1
- package/dist/cjs/createHandleRequest.native.js.map +2 -2
- package/dist/cjs/views/PreloadLinks.cjs +11 -5
- package/dist/cjs/views/PreloadLinks.cjs.map +1 -1
- package/dist/esm/cleanUrl.js.map +1 -1
- package/dist/esm/cleanUrl.mjs.map +1 -1
- package/dist/esm/cleanUrl.native.js.map +1 -1
- package/dist/esm/createHandleRequest.js +1 -1
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs +1 -1
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js +1 -1
- package/dist/esm/createHandleRequest.native.js.map +2 -2
- package/dist/esm/views/PreloadLinks.js +17 -8
- package/dist/esm/views/PreloadLinks.js.map +1 -1
- package/dist/esm/views/PreloadLinks.mjs +11 -5
- package/dist/esm/views/PreloadLinks.mjs.map +1 -1
- package/package.json +7 -7
- package/src/cleanUrl.ts +0 -1
- package/src/createHandleRequest.ts +0 -1
- package/src/views/PreloadLinks.tsx +24 -11
- package/types/cleanUrl.d.ts.map +1 -1
- package/types/views/PreloadLinks.d.ts.map +1 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/cleanUrl.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKO,wBACP,gBAAuB,qBACvB,sBAA6B;AAE7B,SAAS,SAAS,MAAc;AAC9B,aACE,kCAAa,IA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ASC,cACdH,aAAmB;MAEnBI,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAaC,2BAEPC,UAAUF,iBAAaN,sBAAAA,IAAW,IAClCS,UAAUC,QAAQC,IAAIC,aAAa,gBAAgB,UAAU,IAE7DC,iBAAiB,IAAIC,IACzBZ,aACA,oBAAA;AAGF,SAAO,GAAGM,OAAAA,GAAUC,OAAAA,WAAkBjB,SAASqB,eAAeE,SAASZ,MAAM,CAAA,CAAA,CAAA,GAAMa,kCAAAA;AACrF;AAEO,SAASC,sBAAsBC,YAAkB;AACtD,SAAOA,WACJtB,QAAQuB,0CAAyB,EAAA,EACjCvB,QAAQ,sBAAsB,EAAA,EAC9BD,WAAW,MAAM,GAAA;AACtB;",
|
5
5
|
"names": ["cleanUrl", "path", "removeSearch", "replaceAll", "replace", "isClient", "window", "clientSideURL", "getURL", "getPreloadPath", "currentPath", "slice", "PRELOAD_JS_POSTFIX", "getLoaderPath", "includeUrl", "isNative", "baseURL", "devPath", "process", "env", "NODE_ENV", "currentPathUrl", "URL", "pathname", "LOADER_JS_POSTFIX", "getPathFromLoaderPath", "loaderPath", "LOADER_JS_POSTFIX_REGEX"]
|
6
6
|
}
|
@@ -138,7 +138,7 @@ function createHandleRequest(options, handlers) {
|
|
138
138
|
function getLoaderParams(url, config) {
|
139
139
|
const params = {},
|
140
140
|
match = new RegExp(config.workingRegex).exec(url.pathname);
|
141
|
-
if (
|
141
|
+
if (match?.groups) for (const [key, value] of Object.entries(match.groups)) {
|
142
142
|
const namedKey = config.routeKeys[key];
|
143
143
|
params[namedKey] = value;
|
144
144
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/createHandleRequest.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAAsC,uBACtC,mBAAoE,wBAEpE,oBAA2B,+B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ElE,QAAM,QADQ,IAAI,OAAO,MAAM,UAAU,EACrB,KAAK,QAAQ;AACjC,SAAK,QACE,OAAO;AAAA,IACZ,OAAO,QAAQ,MAAM,SAAS,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,OAAO,MAAM,SAAS,GAAG,CAAC,CAAC;AAAA,EACpF,IAHmB,CAAC;AAItB;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -158,7 +158,7 @@ function createHandleRequest(options, handlers) {
|
|
158
158
|
}
|
159
159
|
function getLoaderParams(url, config) {
|
160
160
|
var params = {}, match = new RegExp(config.workingRegex).exec(url.pathname);
|
161
|
-
if (
|
161
|
+
if (match != null && match.groups) {
|
162
162
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
163
163
|
try {
|
164
164
|
for (var _iterator = Object.entries(match.groups)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/Users/n8/one/packages/one/src/createHandleRequest.ts"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;sBAAsC,uBACtC,mBAAoE,wBAEpE,oBAA2B,+BAC3B,8BAAqC,yCACrC,qBAA4B;AAYrB,SAASA,oBACdC,SACAC,UAIC;AAED,MAAMC,eAAWC,gCAAAA;AACjB,MAAI,CAACD;AACH,UAAM,IAAIE,MAAM,oBAAoB;AAGtC,MAAMC,eACJH,SAASI,UAAUC,OAAO,SAACC,KAAKC,KAAAA;AAC9BD,eAAIC,IAAIC,IAAI,IAAI;MAAE,GAAGD;MAAKE,eAAe,IAAIC,OAAOH,IAAII,UAAU;IAAE,GAC7DL;EACT,GAAG,CAAC,CAAA,GAEAM,gBAAgBC,OAAOC,OAAOX,YAAAA,GAK9BY,iBAAiB,CAAC,GAGlBC,aAAahB,SAASgB,WAAWC,IAA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AA3B,kBAAME,SAAN,OAAA;AACH,kBAAKA,OAAMC,aAAakB,KAAKV,QAAAA,GAI7B;oBAAMyC,cAAc,MAAMrE,SAASgE,UAAU;kBAC3C1C;kBACAH,OAAAA;kBACAK;kBACAiB,aAAa;oBACXC,MAAMd,WAAWC;oBACjBU,QAAQqB,gBAAgBpC,KAAKL,MAAAA;kBAC/B;gBACF,CAAA;AAEAgD,+BAAQE,WAAAA,GACDA;;YACT;;AAjBK,iCAAA,IAAA,kBAAA;;;eAAA,8BAAA,WAAA,UAAA,QAAA,WAAA,OAAA;;kBAAA;sBAAA;;;QAkBP,SAAS1B,KAAK;AACZuB,uBAAOvB,GAAAA,GACDA;QACR,UAAA;AACE,iBAAO3B,eAAeY,QAAAA;QACxB;MACF;AAEA,aAAO;IACT;EACF;AACF;AAEA,SAASgC,gBACPpC,KACA8C,QAAmE;AAEnE,MAAM/B,SAAiC,CAAC,GAClCgC,QAAQ,IAAI5D,OAAO2D,OAAOlD,YAAY,EAAEoD,KAAKhD,IAAII,QAAQ;
|
5
|
-
"names": ["createHandleRequest", "options", "handlers", "manifest", "getManifest", "Error", "apiRoutesMap", "apiRoutes", "reduce", "acc", "cur", "page", "compiledRegex", "RegExp", "namedRegex", "apiRoutesList", "Object", "values", "activeRequests", "pageRoutes", "map", "route", "workingRegex", "handler", "request", "urlString", "url", "URL", "headers", "get", "pathname", "search", "process", "env", "NODE_ENV", "startsWith", "handleAPI", "apiRoute", "find", "regex", "test", "params", "getRouteParams", "loaderProps", "path", "err", "isResponse", "method", "handleLoader", "isClientRequestingNewRoute", "endsWith", "LOADER_JS_POSTFIX_UNCACHED", "originalUrl", "getPathFromLoaderPath", "finalUrl", "origin", "file", "console", "info", "Headers", "set", "loaderResponse", "getLoaderParams", "Response", "error", "routes", "handleSSR", "promise", "reject", "resolve", "promiseWithResolvers", "ssrResponse", "config", "match", "exec", "
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;;;;;sBAAsC,uBACtC,mBAAoE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AAA,EAAA,GAAjD,OAAA,EAAA,6BAAA,QAAA,UAAA,KAAA,GAAA,OAAA,4BAAA,IAAoD;AAApD,YAAM,CAACE,KAAKC,KAAAA,IAAZ,MAAA,OACGC,WAAWP,OAAOQ,UAAUH,GAAAA;AAClCpC,eAAOsC,QAAAA,IAAYD;MACrB;;AAHK,0BAAA,IAAA,iBAAA;;;SAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;YAAA;gBAAA;;;EAIP;AACA,SAAOrC;AACT;AAGA,SAASC,eAAeZ,UAAkBT,OAAwB;AAChE,MAAMkB,QAAQ,IAAI1B,OAAOQ,MAAMP,UAAU,GACnC2D,QAAQlC,MAAMmC,KAAK5C,QAAAA;AACzB,SAAK2C,QACEzD,OAAOiE,YACZjE,OAAO4D,QAAQvD,MAAM2D,SAAS,EAAE5D,IAAI,SAAA,OAAA;QAAC,CAACyD,KAAKC,KAAAA,IAAM,OAAaL;WAAR;MAACK;OAAOL,gBAAAA,MAAME,YAAM,QAAZF,kBAAAA,SAAAA,SAAAA,cAAeI,GAAAA;;QAF5D,CAAC;AAItB;",
|
5
|
+
"names": ["createHandleRequest", "options", "handlers", "manifest", "getManifest", "Error", "apiRoutesMap", "apiRoutes", "reduce", "acc", "cur", "page", "compiledRegex", "RegExp", "namedRegex", "apiRoutesList", "Object", "values", "activeRequests", "pageRoutes", "map", "route", "workingRegex", "handler", "request", "urlString", "url", "URL", "headers", "get", "pathname", "search", "process", "env", "NODE_ENV", "startsWith", "handleAPI", "apiRoute", "find", "regex", "test", "params", "getRouteParams", "loaderProps", "path", "err", "isResponse", "method", "handleLoader", "isClientRequestingNewRoute", "endsWith", "LOADER_JS_POSTFIX_UNCACHED", "originalUrl", "getPathFromLoaderPath", "finalUrl", "origin", "file", "console", "info", "Headers", "set", "loaderResponse", "getLoaderParams", "Response", "error", "routes", "handleSSR", "promise", "reject", "resolve", "promiseWithResolvers", "ssrResponse", "config", "match", "exec", "groups", "entries", "key", "value", "namedKey", "routeKeys", "fromEntries"]
|
6
6
|
}
|
@@ -28,13 +28,19 @@ var import_react = require("react"),
|
|
28
28
|
import_getURL = require("../getURL.cjs");
|
29
29
|
const import_meta = {};
|
30
30
|
function PreloadLinks() {
|
31
|
-
return import_meta.env.PROD && (0, import_react.useEffect)(() => {
|
32
|
-
const url = (0, import_getURL.getURL)()
|
33
|
-
|
31
|
+
return typeof window < "u" && import_meta.env.PROD && (0, import_react.useEffect)(() => {
|
32
|
+
const url = (0, import_getURL.getURL)(),
|
33
|
+
controller = new AbortController();
|
34
|
+
return document.addEventListener("mouseover", e => {
|
34
35
|
let target = e.target;
|
35
|
-
if (!(target instanceof HTMLElement) || (target = target instanceof HTMLAnchorElement ? target : target.
|
36
|
+
if (!(target instanceof HTMLElement) || (target = target instanceof HTMLAnchorElement ? target : target.closest("a"), !(target instanceof HTMLAnchorElement))) return;
|
36
37
|
const href = target.getAttribute("href");
|
37
38
|
(href?.[0] === "/" || href?.[0].startsWith(url)) && (0, import_router.preloadRoute)(href.replace(url, ""));
|
38
|
-
}
|
39
|
+
}, {
|
40
|
+
passive: !0,
|
41
|
+
signal: controller.signal
|
42
|
+
}), () => {
|
43
|
+
controller.abort();
|
44
|
+
};
|
39
45
|
}, []), null;
|
40
46
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/views/PreloadLinks.tsx"],
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B,kBAC1B,gBAA6B,6BAC7B,gBAAuB;AAFvB;AAIO,SAAS,eAAe;AAG7B,SAAI,YAAY,IAAI,
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA0B,kBAC1B,gBAA6B,6BAC7B,gBAAuB;AAFvB;AAIO,SAAS,eAAe;AAG7B,SAAI,OAAO,SAAW,OAAe,YAAY,IAAI,YACnD,wBAAU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I,IAClC,UAAU,QAAQ,IAAI,aAAa,gBAAgB,UAAU,IAE7D,iBAAiB,IAAI;AAAA,IACzB;AAAA,IACA;AAAA;AAAA,EACF;AAEA,SAAO,GAAG,OAAO,GAAG,OAAO,WAAW,SAAS,eAAe,SAAS,MAAM,CAAC,CAAC,CAAC,GAAG,iBAAiB;AACtG;AAEO,SAAS,sBAAsB,YAAoB;AACxD,SAAO,WACJ,QAAQ,yBAAyB,EAAE,EACnC,QAAQ,sBAAsB,EAAE,EAChC,WAAW,MAAM,GAAG;AACzB;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isNative","LOADER_JS_POSTFIX","LOADER_JS_POSTFIX_REGEX","PRELOAD_JS_POSTFIX","getURL","removeSearch","cleanUrl","path","replaceAll","replace","isClient","window","clientSideURL","getPreloadPath","currentPath","slice","getLoaderPath","includeUrl","baseURL","devPath","process","env","NODE_ENV","currentPathUrl","URL","pathname","getPathFromLoaderPath","loaderPath"],"sources":["../../src/cleanUrl.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,QAAA,EACAC,iBAAA,EACAC,uBAAA,
|
1
|
+
{"version":3,"names":["isNative","LOADER_JS_POSTFIX","LOADER_JS_POSTFIX_REGEX","PRELOAD_JS_POSTFIX","getURL","removeSearch","cleanUrl","path","replaceAll","replace","isClient","window","clientSideURL","getPreloadPath","currentPath","slice","getLoaderPath","includeUrl","baseURL","devPath","process","env","NODE_ENV","currentPathUrl","URL","pathname","getPathFromLoaderPath","loaderPath"],"sources":["../../src/cleanUrl.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,QAAA,EACAC,iBAAA,EACAC,uBAAA,EACAC,kBAAA,QACK;AACP,SAASC,MAAA,QAAc;AACvB,SAASC,YAAA,QAAoB;AAE7B,SAASC,SAASC,IAAA,EAAc;EAC9B,OACEF,YAAA,CAAaE,IAAI,EACdC,UAAA,CAAW,KAAK,GAAG,EAEnBC,OAAA,CAAQ,M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,WAAWN,OAAAA,IAAW;AAErC,SAASS,eAAeC,aAAmB;AAChD,SAAO,GAAGF,aAAAA,WAAwBN,SAASQ,YAAYC,MAAM,CAAA,CAAA,CAAA,GAAMZ,kBAAAA;AACrE;AAEO,SAASa,cACdF,aAAmB;MAEnBG,aAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAAajB,UAEPkB,UAAUD,aAAab,OAAAA,IAAW,IAClCe,UAAUC,QAAQC,IAAIC,aAAa,gBAAgB,UAAU,IAE7DC,iBAAiB,IAAIC,IACzBV,aACA,oBAAA;AAGF,SAAO,GAAGI,OAAAA,GAAUC,OAAAA,WAAkBb,SAASiB,eAAeE,SAASV,MAAM,CAAA,CAAA,CAAA,GAAMd,iBAAAA;AACrF;AAEO,SAASyB,sBAAsBC,YAAkB;AACtD,SAAOA,WACJlB,QAAQP,yBAAyB,EAAA,EACjCO,QAAQ,sBAAsB,EAAA,EAC9BD,WAAW,MAAM,GAAA;AACtB;",
|
5
5
|
"names": ["isNative", "LOADER_JS_POSTFIX", "LOADER_JS_POSTFIX_REGEX", "PRELOAD_JS_POSTFIX", "getURL", "removeSearch", "cleanUrl", "path", "replaceAll", "replace", "isClient", "window", "clientSideURL", "getPreloadPath", "currentPath", "slice", "getLoaderPath", "includeUrl", "baseURL", "devPath", "process", "env", "NODE_ENV", "currentPathUrl", "URL", "pathname", "getPathFromLoaderPath", "loaderPath"]
|
6
6
|
}
|
@@ -107,7 +107,7 @@ function createHandleRequest(options, handlers) {
|
|
107
107
|
}
|
108
108
|
function getLoaderParams(url, config) {
|
109
109
|
const params = {}, match = new RegExp(config.workingRegex).exec(url.pathname);
|
110
|
-
if (
|
110
|
+
if (match?.groups)
|
111
111
|
for (const [key, value] of Object.entries(match.groups)) {
|
112
112
|
const namedKey = config.routeKeys[key];
|
113
113
|
params[namedKey] = value;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
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GAAG;AACrC,aAAO,QAAQ,IAAI;AAAA,IACrB;AAEF,SAAO;AACT;AAGA,SAAS,eAAe,UAAkB,OAA0B;AAElE,QAAM,QADQ,IAAI,OAAO,MAAM,UAAU,EACrB,KAAK,QAAQ;AACjC,SAAK,QACE,OAAO;AAAA,IACZ,OAAO,QAAQ,MAAM,SAAS,EAAE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,OAAO,MAAM,SAAS,GAAG,CAAC,CAAC;AAAA,EACpF,IAHmB,CAAC;AAItB;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -113,7 +113,7 @@ function createHandleRequest(options, handlers) {
|
|
113
113
|
function getLoaderParams(url, config) {
|
114
114
|
const params = {},
|
115
115
|
match = new RegExp(config.workingRegex).exec(url.pathname);
|
116
|
-
if (
|
116
|
+
if (match?.groups) for (const [key, value] of Object.entries(match.groups)) {
|
117
117
|
const namedKey = config.routeKeys[key];
|
118
118
|
params[namedKey] = value;
|
119
119
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["getPathFromLoaderPath","LOADER_JS_POSTFIX_UNCACHED","isResponse","promiseWithResolvers","getManifest","createHandleRequest","options","handlers","manifest","Error","apiRoutesMap","apiRoutes","reduce","acc","cur","page","compiledRegex","RegExp","namedRegex","apiRoutesList","Object","values","activeRequests","pageRoutes","map","route","workingRegex","handler","request","urlString","url","URL","headers","get","pathname","search","process","env","NODE_ENV","startsWith","handleAPI","apiRoute","find","test","params","getRouteParams","loaderProps","path","err","method","handleLoader","endsWith","originalUrl","finalUrl","origin","file","console","info","Headers","set","loaderResponse","getLoaderParams","Response","error","routes","handleSSR","promise","reject","resolve","ssrResponse","config","match","exec","
|
1
|
+
{"version":3,"names":["getPathFromLoaderPath","LOADER_JS_POSTFIX_UNCACHED","isResponse","promiseWithResolvers","getManifest","createHandleRequest","options","handlers","manifest","Error","apiRoutesMap","apiRoutes","reduce","acc","cur","page","compiledRegex","RegExp","namedRegex","apiRoutesList","Object","values","activeRequests","pageRoutes","map","route","workingRegex","handler","request","urlString","url","URL","headers","get","pathname","search","process","env","NODE_ENV","startsWith","handleAPI","apiRoute","find","test","params","getRouteParams","loaderProps","path","err","method","handleLoader","endsWith","originalUrl","finalUrl","origin","file","console","info","Headers","set","loaderResponse","getLoaderParams","Response","error","routes","handleSSR","promise","reject","resolve","ssrResponse","config","match","exec","groups","key","value","entries","namedKey","routeKeys","fromEntries"],"sources":["../../src/createHandleRequest.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,qBAAA,QAA6B;AACtC,SAAkCC,0BAAA,QAAkC;AAEpE,SAASC,UAAA,QAAkB;AAC3B,SAASC,oBAAA,QAA4B;AACrC,SAASC,WAAA,QAAmB;AAYrB,SAASC,oBACdC,OAAA,EACAC,QAAA,EAKA;EACA,MAAMC,QAAA,GAAWJ,WAAA,CAAY;EAC7B,IAAI,CAACI,QAAA,EACH,MAAM,IAAIC,KAAA,CAAM,oBAAoB;EAGtC,MAAMC,YAAA,GACJF,QAAA,CAASG,SAAA,CAAUC,MAAA,CAAO,CAACC,GAAA,EAAKC,GAAA,MAC9BD,GAAA,CAAIC,GAAA,CAAIC,IAAI,IAAI;MAAE,GAAGD,GAAA;MAAKE,aAAA,EAAe,IAAIC,MAAA,CAAOH,GAAA,CAAII,UAAU;IAAE,GAC7DL,GAAA,GACN,CAAC,CAAC;IAEDM,aAAA,GAAgBC,MAAA,CAAOC,MAAA,CAAOX,YAAY;IAK1CY,cAAA,GAAiB,CAAC;IAGlBC,UAAA,GAAaf,QAAA,CAASe,UAAA,CAAWC,GAAA,CAAKC,KAAA,KAAW;MACrD,GAAGA,KAAA;MACHC,YAAA,EAAc,IAAIT,MAAA,CAAOQ,KAAA,CAAMP,UAAU;IAC3C,EAAE;EAEF,OAAO;IACLV,QAAA;IACAmB,OAAA,EAAS,eAAAA,CAA6BC,OAAA,EAAmD;MACvF,MAAMC,SAAA,GAAYD,OAAA,CAAQE,GAAA,IAAO;QAC3BA,GAAA,GAA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GAAA,CAAI,CAAC,CAACkD,GAAA,EAAKC,KAAK,MAAM,CAACA,KAAA,EAAOJ,KAAA,CAAME,MAAA,GAASC,GAAG,CAAC,CAAC,CACpF,IAHmB,CAAC;AAItB","ignoreList":[]}
|
@@ -142,7 +142,7 @@ function createHandleRequest(options, handlers) {
|
|
142
142
|
}
|
143
143
|
function getLoaderParams(url, config) {
|
144
144
|
var params = {}, match = new RegExp(config.workingRegex).exec(url.pathname);
|
145
|
-
if (
|
145
|
+
if (match?.groups) {
|
146
146
|
var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
|
147
147
|
try {
|
148
148
|
for (var _iterator = Object.entries(match.groups)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../src/Users/n8/one/packages/one/src/createHandleRequest.ts"],
|
4
|
-
"mappings": "AAAA,SAASA,6BAA6B;AACtC,SAAkCC,kCAAkC;AAEpE,SAASC,kBAAkB;AAC3B,SAASC,4BAA4B;AACrC,SAASC,mBAAmB;AAYrB,SAASC,oBACdC,SACAC,UAIC;AAED,MAAMC,WAAWJ,YAAAA;AACjB,MAAI,CAACI;AACH,UAAM,IAAIC,MAAM,oBAAoB;AAGtC,MAAMC,eACJF,SAASG,UAAUC,OAAO,SAACC,KAAKC,KAAAA;AAC9BD,eAAIC,IAAIC,IAAI,IAAI;MAAE,GAAGD;MAAKE,eAAe,IAAIC,OAAOH,IAAII,UAAU;IAAE,GAC7DL;EACT,GAAG,CAAC,CAAA,GAEAM,gBAAgBC,OAAOC,OAAOX,YAAAA,GAK9BY,iBAAiB,CAAC,GAGlBC,aAAaf,SAASe,WAAWC,IAAI,SAACC,OAAAA;WAAW;MACrD,GAAGA;MACHC,cAAc,IAAIT,OAAOQ,MAAMP,UAAU;IAC3C;;AAEA,SAAO;IACLV;IACAmB,SAAS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;kBAC3CvC;kBACAH,OAAAA;kBACAK;kBACAiB,aAAa;oBACXC,MAAMd,WAAWC;oBACjBU,QAAQkB,gBAAgBjC,KAAKL,MAAAA;kBAC/B;gBACF,CAAA;AAEA6C,+BAAQC,WAAAA,GACDA;;YACT;;AAjBK,iCAAA,IAAA,kBAAA;;;eAAA,8BAAA,WAAA,UAAA,QAAA,WAAA,OAAA;;kBAAA;sBAAA;;;QAkBP,SAAStB,KAAK;AACZoB,uBAAOpB,GAAAA,GACDA;QACR,UAAA;AACE,iBAAO3B,eAAeY,QAAAA;QACxB;MACF;AAEA,aAAO;IACT;EACF;AACF;AAEA,SAAS6B,gBACPjC,KACA0C,QAAmE;AAEnE,MAAM3B,SAAiC,CAAC,GAClC4B,QAAQ,IAAIxD,OAAOuD,OAAO9C,YAAY,EAAEgD,KAAK5C,IAAII,QAAQ;
|
5
|
-
"names": ["getPathFromLoaderPath", "LOADER_JS_POSTFIX_UNCACHED", "isResponse", "promiseWithResolvers", "getManifest", "createHandleRequest", "options", "handlers", "manifest", "Error", "apiRoutesMap", "apiRoutes", "reduce", "acc", "cur", "page", "compiledRegex", "RegExp", "namedRegex", "apiRoutesList", "Object", "values", "activeRequests", "pageRoutes", "map", "route", "workingRegex", "handler", "request", "urlString", "url", "URL", "headers", "get", "pathname", "search", "process", "env", "NODE_ENV", "startsWith", "handleAPI", "apiRoute", "find", "regex", "test", "params", "getRouteParams", "loaderProps", "path", "err", "method", "handleLoader", "isClientRequestingNewRoute", "endsWith", "originalUrl", "finalUrl", "origin", "file", "console", "info", "Headers", "set", "loaderResponse", "getLoaderParams", "Response", "error", "routes", "handleSSR", "promise", "reject", "resolve", "ssrResponse", "config", "match", "exec", "
|
4
|
+
"mappings": "AAAA,SAASA,6BAA6B;AACtC,SAAkCC,kCAAkC;AAEpE,SAASC,kBAAkB;AAC3B,SAASC,4BAA4B;AACrC,SAASC,mBAAmB;AAYrB,SAASC,oBACdC,SACAC,UAIC;AAED,MAAMC,WAAWJ,YA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Z,MAAA,OACGC,WAAWP,OAAOQ,UAAUH,GAAAA;AAClChC,eAAOkC,QAAAA,IAAYD;MACrB;;AAHK,0BAAA,IAAA,iBAAA;;;SAAA,6BAAA,UAAA,UAAA,QAAA,UAAA,OAAA;;YAAA;gBAAA;;;EAIP;AACA,SAAOjC;AACT;AAGA,SAASC,eAAeZ,UAAkBT,OAAwB;AAChE,MAAMkB,QAAQ,IAAI1B,OAAOQ,MAAMP,UAAU,GACnCuD,QAAQ9B,MAAM+B,KAAKxC,QAAAA;AACzB,SAAKuC,QACErD,OAAO6D,YACZ7D,OAAOwD,QAAQnD,MAAMuD,SAAS,EAAExD,IAAI,SAAA,OAAA;QAAC,CAACqD,KAAKC,KAAAA,IAAM,OAAaL;WAAR;MAACK;OAAOL,gBAAAA,MAAME,YAAM,QAAZF,kBAAAA,SAAAA,SAAAA,cAAeI,GAAAA;;QAF5D,CAAC;AAItB;",
|
5
|
+
"names": ["getPathFromLoaderPath", "LOADER_JS_POSTFIX_UNCACHED", "isResponse", "promiseWithResolvers", "getManifest", "createHandleRequest", "options", "handlers", "manifest", "Error", "apiRoutesMap", "apiRoutes", "reduce", "acc", "cur", "page", "compiledRegex", "RegExp", "namedRegex", "apiRoutesList", "Object", "values", "activeRequests", "pageRoutes", "map", "route", "workingRegex", "handler", "request", "urlString", "url", "URL", "headers", "get", "pathname", "search", "process", "env", "NODE_ENV", "startsWith", "handleAPI", "apiRoute", "find", "regex", "test", "params", "getRouteParams", "loaderProps", "path", "err", "method", "handleLoader", "isClientRequestingNewRoute", "endsWith", "originalUrl", "finalUrl", "origin", "file", "console", "info", "Headers", "set", "loaderResponse", "getLoaderParams", "Response", "error", "routes", "handleSSR", "promise", "reject", "resolve", "ssrResponse", "config", "match", "exec", "groups", "entries", "key", "value", "namedKey", "routeKeys", "fromEntries"]
|
6
6
|
}
|
@@ -2,14 +2,23 @@ import { useEffect } from "react";
|
|
2
2
|
import { preloadRoute } from "../router/router";
|
3
3
|
import { getURL } from "../getURL";
|
4
4
|
function PreloadLinks() {
|
5
|
-
return import.meta.env.PROD && useEffect(() => {
|
6
|
-
const url = getURL();
|
7
|
-
document.addEventListener(
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
return typeof window < "u" && import.meta.env.PROD && useEffect(() => {
|
6
|
+
const url = getURL(), controller = new AbortController();
|
7
|
+
return document.addEventListener(
|
8
|
+
"mouseover",
|
9
|
+
(e) => {
|
10
|
+
let target = e.target;
|
11
|
+
if (!(target instanceof HTMLElement) || (target = target instanceof HTMLAnchorElement ? target : target.closest("a"), !(target instanceof HTMLAnchorElement))) return;
|
12
|
+
const href = target.getAttribute("href");
|
13
|
+
(href?.[0] === "/" || href?.[0].startsWith(url)) && preloadRoute(href.replace(url, ""));
|
14
|
+
},
|
15
|
+
{
|
16
|
+
passive: !0,
|
17
|
+
signal: controller.signal
|
18
|
+
}
|
19
|
+
), () => {
|
20
|
+
controller.abort();
|
21
|
+
};
|
13
22
|
}, []), null;
|
14
23
|
}
|
15
24
|
export {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../src/views/PreloadLinks.tsx"],
|
4
|
-
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEhB,SAAS,eAAe;AAG7B,SAAI,YAAY,IAAI,
|
4
|
+
"mappings": "AAAA,SAAS,iBAAiB;AAC1B,SAAS,oBAAoB;AAC7B,SAAS,cAAc;AAEhB,SAAS,eAAe;AAG7B,SAAI,OAAO,SAAW,OAAe,YAAY,IAAI,QACnD,UAAU,MAAM;AACd,UAAM,MAAM,OAAO,GACb,aAAa,IAAI,gBAAgB;AAEvC,oBAAS;AAAA,MACP;AAAA,MACA,CAAC,MAAM;AACL,YAAI,SAAS,EAAE;AAGf,YAFI,EAAE,kBAAkB,iBACxB,SAAS,kBAAkB,oBAAoB,SAAS,OAAO,QAAQ,GAAG,GACtE,EAAE,kBAAkB,oBAAoB;AAC5C,cAAM,OAAO,OAAO,aAAa,MAAM;AACvC,SAAI,OAAO,CAAC,MAAM,OAAO,OAAO,CAAC,EAAE,WAAW,GAAG,MAE/C,aAAa,KAAK,QAAQ,KAAK,EAAE,CAAC;AAAA,MAEtC;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,QAAQ,WAAW;AAAA,MACrB;AAAA,IACF,GAEO,MAAM;AACX,iBAAW,MAAM;AAAA,IACnB;AAAA,EACF,GAAG,CAAC,CAAC,GAGA;AACT;",
|
5
5
|
"names": []
|
6
6
|
}
|
@@ -2,14 +2,20 @@ import { useEffect } from "react";
|
|
2
2
|
import { preloadRoute } from "../router/router.mjs";
|
3
3
|
import { getURL } from "../getURL.mjs";
|
4
4
|
function PreloadLinks() {
|
5
|
-
return import.meta.env.PROD && useEffect(() => {
|
6
|
-
const url = getURL()
|
7
|
-
|
5
|
+
return typeof window < "u" && import.meta.env.PROD && useEffect(() => {
|
6
|
+
const url = getURL(),
|
7
|
+
controller = new AbortController();
|
8
|
+
return document.addEventListener("mouseover", e => {
|
8
9
|
let target = e.target;
|
9
|
-
if (!(target instanceof HTMLElement) || (target = target instanceof HTMLAnchorElement ? target : target.
|
10
|
+
if (!(target instanceof HTMLElement) || (target = target instanceof HTMLAnchorElement ? target : target.closest("a"), !(target instanceof HTMLAnchorElement))) return;
|
10
11
|
const href = target.getAttribute("href");
|
11
12
|
(href?.[0] === "/" || href?.[0].startsWith(url)) && preloadRoute(href.replace(url, ""));
|
12
|
-
}
|
13
|
+
}, {
|
14
|
+
passive: !0,
|
15
|
+
signal: controller.signal
|
16
|
+
}), () => {
|
17
|
+
controller.abort();
|
18
|
+
};
|
13
19
|
}, []), null;
|
14
20
|
}
|
15
21
|
export { PreloadLinks };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useEffect","preloadRoute","getURL","PreloadLinks","import","meta","env","PROD","url","document","addEventListener","e","target","HTMLElement","HTMLAnchorElement","
|
1
|
+
{"version":3,"names":["useEffect","preloadRoute","getURL","PreloadLinks","window","import","meta","env","PROD","url","controller","AbortController","document","addEventListener","e","target","HTMLElement","HTMLAnchorElement","closest","href","getAttribute","startsWith","replace","passive","signal","abort"],"sources":["../../../src/views/PreloadLinks.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,QAAiB;AAC1B,SAASC,YAAA,QAAoB;AAC7B,SAASC,MAAA,QAAc;AAEhB,SAASC,aAAA,EAAe;EAG7B,OAAI,OAAOC,MAAA,GAAW,OAAeC,MAAA,CAAAC,IAAA,CAAYC,GAAA,CAAIC,IAAA,IACnDR,SAAA,CAAU,MAAM;IACd,MAAMS,GAAA,GAAMP,MAAA,CAAO;MACbQ,UAAA,GAAa,IAAIC,eAAA,CAAgB;IAEvC,OAAAC,QAAA,CAASC,gBAAA,CACP,aACCC,CAAA,IAAM;MACL,IAAIC,MAAA,GAASD,CAAA,CAAEC,MAAA;MAGf,IAFI,EAAEA,MAAA,YAAkBC,WAAA,MACxBD,MAAA,GAASA,MAAA,YAAkBE,iBAAA,GAAoBF,MAAA,GAASA,MAAA,CAAOG,OAAA,CAAQ,GAAG,GACtE,EAAEH,MAAA,YAAkBE,iBAAA,IAAoB;MAC5C,MAAME,IAAA,GAAOJ,MAAA,CAAOK,YAAA,CAAa,MAAM;MACvC,CAAID,IAAA,GAAO,CAAC,MAAM,OAAOA,IAAA,GAAO,CAAC,EAAEE,UAAA,CAAWZ,GAAG,MAE/CR,YAAA,CAAakB,IAAA,CAAKG,OAAA,CAAQb,GAAA,EAAK,EAAE,CAAC;IAEtC,GACA;MACEc,OAAA,EAAS;MACTC,MAAA,EAAQd,UAAA,CAAWc;IACrB,CACF,GAEO,MAAM;MACXd,UAAA,CAAWe,KAAA,CAAM;IACnB;EACF,GAAG,EAAE,GAGA;AACT","ignoreList":[]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "one",
|
3
|
-
"version": "1.1.
|
3
|
+
"version": "1.1.315",
|
4
4
|
"source": "src/index.ts",
|
5
5
|
"types": "./types/index.d.ts",
|
6
6
|
"sideEffects": false,
|
@@ -91,14 +91,14 @@
|
|
91
91
|
"@react-navigation/native-stack": "~6.9.13",
|
92
92
|
"@react-navigation/routers": "~6.1.9",
|
93
93
|
"@ungap/structured-clone": "^1.2.0",
|
94
|
-
"@vxrn/resolve": "1.1.
|
95
|
-
"@vxrn/tslib-lite": "1.1.
|
96
|
-
"@vxrn/universal-color-scheme": "1.1.
|
97
|
-
"@vxrn/use-isomorphic-layout-effect": "1.1.
|
94
|
+
"@vxrn/resolve": "1.1.315",
|
95
|
+
"@vxrn/tslib-lite": "1.1.315",
|
96
|
+
"@vxrn/universal-color-scheme": "1.1.315",
|
97
|
+
"@vxrn/use-isomorphic-layout-effect": "1.1.315",
|
98
98
|
"babel-dead-code-elimination": "^1.0.6",
|
99
99
|
"citty": "^0.1.6",
|
100
100
|
"core-js": "^3.38.1",
|
101
|
-
"create-vxrn": "1.1.
|
101
|
+
"create-vxrn": "1.1.315",
|
102
102
|
"escape-string-regexp": "^5.0.0",
|
103
103
|
"expo-linking": "~6.3.1",
|
104
104
|
"expo-modules-core": "^1.12.24",
|
@@ -120,7 +120,7 @@
|
|
120
120
|
"url-parse": "^1.5.10",
|
121
121
|
"vite": "6.0.0-beta.1",
|
122
122
|
"vite-tsconfig-paths": "^5.0.1",
|
123
|
-
"vxrn": "1.1.
|
123
|
+
"vxrn": "1.1.315",
|
124
124
|
"ws": "^8.18.0",
|
125
125
|
"xxhashjs": "^0.2.2"
|
126
126
|
},
|
package/src/cleanUrl.ts
CHANGED
@@ -208,7 +208,6 @@ function getLoaderParams(
|
|
208
208
|
) {
|
209
209
|
const params: Record<string, string> = {}
|
210
210
|
const match = new RegExp(config.workingRegex).exec(url.pathname)
|
211
|
-
console.log('getting loader params', url)
|
212
211
|
if (match?.groups) {
|
213
212
|
for (const [key, value] of Object.entries(match.groups)) {
|
214
213
|
const namedKey = config.routeKeys[key]
|
@@ -5,20 +5,33 @@ import { getURL } from '../getURL'
|
|
5
5
|
export function PreloadLinks() {
|
6
6
|
// only in prod because we don't generate them until build
|
7
7
|
// @ts-ignore
|
8
|
-
if (import.meta.env.PROD) {
|
8
|
+
if (typeof window !== 'undefined' && import.meta.env.PROD) {
|
9
9
|
useEffect(() => {
|
10
10
|
const url = getURL()
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
const controller = new AbortController()
|
12
|
+
|
13
|
+
document.addEventListener(
|
14
|
+
'mouseover',
|
15
|
+
(e) => {
|
16
|
+
let target = e.target
|
17
|
+
if (!(target instanceof HTMLElement)) return
|
18
|
+
target = target instanceof HTMLAnchorElement ? target : target.closest('a')
|
19
|
+
if (!(target instanceof HTMLAnchorElement)) return
|
20
|
+
const href = target.getAttribute('href')
|
21
|
+
if (href?.[0] === '/' || href?.[0].startsWith(url)) {
|
22
|
+
// local route
|
23
|
+
preloadRoute(href.replace(url, ''))
|
24
|
+
}
|
25
|
+
},
|
26
|
+
{
|
27
|
+
passive: true,
|
28
|
+
signal: controller.signal,
|
20
29
|
}
|
21
|
-
|
30
|
+
)
|
31
|
+
|
32
|
+
return () => {
|
33
|
+
controller.abort()
|
34
|
+
}
|
22
35
|
}, [])
|
23
36
|
}
|
24
37
|
|
package/types/cleanUrl.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cleanUrl.d.ts","sourceRoot":"","sources":["../src/cleanUrl.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"cleanUrl.d.ts","sourceRoot":"","sources":["../src/cleanUrl.ts"],"names":[],"mappings":"AAqBA,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,UAEjD;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EAEnB,UAAU,UAAW,UAWtB;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,UAKvD"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"PreloadLinks.d.ts","sourceRoot":"","sources":["../../src/views/PreloadLinks.tsx"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,
|
1
|
+
{"version":3,"file":"PreloadLinks.d.ts","sourceRoot":"","sources":["../../src/views/PreloadLinks.tsx"],"names":[],"mappings":"AAIA,wBAAgB,YAAY,SAkC3B"}
|