@qwik.dev/router 2.0.0-alpha.1 → 2.0.0-alpha.2

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.
@@ -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
- routeLocation.prevUrl = prevUrl;
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/cookbook/re-exporting-loaders/`);
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 === 500) {
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 === 500) {
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 === 500) {
1651
+ if (res.status >= 500) {
1650
1652
  throw str;
1651
1653
  }
1652
1654
  return str;
@@ -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
- routeLocation.prevUrl = prevUrl;
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/cookbook/re-exporting-loaders/`);
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 === 500) {
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 === 500) {
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 === 500) {
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.1",
4
+ "version": "2.0.0-alpha.2",
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.1"
44
+ "@qwik.dev/core": "2.0.0-alpha.2"
45
45
  },
46
46
  "engines": {
47
47
  "node": "^18.17.0 || ^20.3.0 || >=21.0.0"