@qwik.dev/router 2.0.0-alpha.1 → 2.0.0-alpha.3
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/lib/index.qwik.cjs +7 -5
- package/lib/index.qwik.mjs +7 -5
- package/package.json +4 -3
package/lib/index.qwik.cjs
CHANGED
|
@@ -985,7 +985,9 @@ const QwikRouterProvider = core.component$((props) => {
|
|
|
985
985
|
if (navigation.dest.search && !isRedirect) {
|
|
986
986
|
trackUrl.search = navigation.dest.search;
|
|
987
987
|
}
|
|
988
|
-
|
|
988
|
+
if (!isSamePath(trackUrl, prevUrl)) {
|
|
989
|
+
routeLocation.prevUrl = prevUrl;
|
|
990
|
+
}
|
|
989
991
|
routeLocation.url = trackUrl;
|
|
990
992
|
routeLocation.params = {
|
|
991
993
|
...params
|
|
@@ -1423,7 +1425,7 @@ const routeLoaderQrl = (loaderQrl, ...rest) => {
|
|
|
1423
1425
|
For more information check: https://qwik.dev/docs/route-loader/
|
|
1424
1426
|
|
|
1425
1427
|
If your are managing reusable logic or a library it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception.
|
|
1426
|
-
For more information check: https://qwik.dev/docs/
|
|
1428
|
+
For more information check: https://qwik.dev/docs/re-exporting-loaders/`);
|
|
1427
1429
|
}
|
|
1428
1430
|
return internal._wrapProp(state, id);
|
|
1429
1431
|
});
|
|
@@ -1634,19 +1636,19 @@ const serverQrl = (qrl, options) => {
|
|
|
1634
1636
|
} else if (contentType === "application/qwik-json") {
|
|
1635
1637
|
const str = await res.text();
|
|
1636
1638
|
const [obj] = internal._deserialize(str, ctxElm ?? document.documentElement);
|
|
1637
|
-
if (res.status
|
|
1639
|
+
if (res.status >= 500) {
|
|
1638
1640
|
throw obj;
|
|
1639
1641
|
}
|
|
1640
1642
|
return obj;
|
|
1641
1643
|
} else if (contentType === "application/json") {
|
|
1642
1644
|
const obj = await res.json();
|
|
1643
|
-
if (res.status
|
|
1645
|
+
if (res.status >= 500) {
|
|
1644
1646
|
throw obj;
|
|
1645
1647
|
}
|
|
1646
1648
|
return obj;
|
|
1647
1649
|
} else if (contentType === "text/plain" || contentType === "text/html") {
|
|
1648
1650
|
const str = await res.text();
|
|
1649
|
-
if (res.status
|
|
1651
|
+
if (res.status >= 500) {
|
|
1650
1652
|
throw str;
|
|
1651
1653
|
}
|
|
1652
1654
|
return str;
|
package/lib/index.qwik.mjs
CHANGED
|
@@ -967,7 +967,9 @@ const QwikRouterProvider = component$((props) => {
|
|
|
967
967
|
if (navigation.dest.search && !isRedirect) {
|
|
968
968
|
trackUrl.search = navigation.dest.search;
|
|
969
969
|
}
|
|
970
|
-
|
|
970
|
+
if (!isSamePath(trackUrl, prevUrl)) {
|
|
971
|
+
routeLocation.prevUrl = prevUrl;
|
|
972
|
+
}
|
|
971
973
|
routeLocation.url = trackUrl;
|
|
972
974
|
routeLocation.params = {
|
|
973
975
|
...params
|
|
@@ -1405,7 +1407,7 @@ const routeLoaderQrl = (loaderQrl, ...rest) => {
|
|
|
1405
1407
|
For more information check: https://qwik.dev/docs/route-loader/
|
|
1406
1408
|
|
|
1407
1409
|
If your are managing reusable logic or a library it is essential that this function is re-exported from within 'layout.tsx' or 'index.tsx file of the existing route otherwise it will not run or throw exception.
|
|
1408
|
-
For more information check: https://qwik.dev/docs/
|
|
1410
|
+
For more information check: https://qwik.dev/docs/re-exporting-loaders/`);
|
|
1409
1411
|
}
|
|
1410
1412
|
return _wrapProp(state, id);
|
|
1411
1413
|
});
|
|
@@ -1616,19 +1618,19 @@ const serverQrl = (qrl, options) => {
|
|
|
1616
1618
|
} else if (contentType === "application/qwik-json") {
|
|
1617
1619
|
const str = await res.text();
|
|
1618
1620
|
const [obj] = _deserialize(str, ctxElm ?? document.documentElement);
|
|
1619
|
-
if (res.status
|
|
1621
|
+
if (res.status >= 500) {
|
|
1620
1622
|
throw obj;
|
|
1621
1623
|
}
|
|
1622
1624
|
return obj;
|
|
1623
1625
|
} else if (contentType === "application/json") {
|
|
1624
1626
|
const obj = await res.json();
|
|
1625
|
-
if (res.status
|
|
1627
|
+
if (res.status >= 500) {
|
|
1626
1628
|
throw obj;
|
|
1627
1629
|
}
|
|
1628
1630
|
return obj;
|
|
1629
1631
|
} else if (contentType === "text/plain" || contentType === "text/html") {
|
|
1630
1632
|
const str = await res.text();
|
|
1631
|
-
if (res.status
|
|
1633
|
+
if (res.status >= 500) {
|
|
1632
1634
|
throw str;
|
|
1633
1635
|
}
|
|
1634
1636
|
return str;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qwik.dev/router",
|
|
3
3
|
"description": "The router for Qwik.",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.3",
|
|
5
5
|
"bugs": "https://github.com/QwikDev/qwik/issues",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@mdx-js/mdx": "^3",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"unist-util-visit": "5.0.0",
|
|
42
42
|
"uvu": "0.5.6",
|
|
43
43
|
"yaml": "2.4.5",
|
|
44
|
-
"@qwik.dev/core": "2.0.0-alpha.
|
|
44
|
+
"@qwik.dev/core": "2.0.0-alpha.3"
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
47
|
"node": "^18.17.0 || ^20.3.0 || >=21.0.0"
|
|
@@ -158,7 +158,8 @@
|
|
|
158
158
|
"types": "./lib/service-worker.d.ts",
|
|
159
159
|
"import": "./lib/service-worker.mjs",
|
|
160
160
|
"require": "./lib/service-worker.cjs"
|
|
161
|
-
}
|
|
161
|
+
},
|
|
162
|
+
"./package.json": "./package.json"
|
|
162
163
|
},
|
|
163
164
|
"files": [
|
|
164
165
|
"adapters",
|