@flareapp/inertia 2.11.0 → 2.12.0

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/dist/index.cjs CHANGED
@@ -2,8 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _flareapp_js_browser = require("@flareapp/js/browser");
3
3
 
4
4
  //#region src/traceInertiaRouter.ts
5
- /** Resolve a router-reported location (a `URL` on visits, a relative string on pages) to a full href
6
- * plus its path. Both are undefined outside a browser or for an unparseable value. */
7
5
  function locationOf(raw) {
8
6
  if (raw == null) return {};
9
7
  const url = (0, _flareapp_js_browser.absoluteUrl)(String(raw));
@@ -13,16 +11,12 @@ function locationOf(raw) {
13
11
  path: url.pathname
14
12
  };
15
13
  }
16
- /** Background work fires the same `start` and `finish` a real visit does, so opening a root for one both
17
- * invents a navigation and ends the root that was live. */
18
14
  function isBackgroundVisit(visit) {
19
15
  if (!visit) return false;
20
16
  if (visit.prefetch) return true;
21
17
  const { path } = locationOf(visit.url);
22
18
  return !!visit.async && path !== void 0 && path === (0, _flareapp_js_browser.currentPath)();
23
19
  }
24
- /** `component` ('Products/Show') is Inertia's route identifier, and there is a small fixed set of them,
25
- * so reports group by it the way the other integrations' route templates do. */
26
20
  function routeNameFor(page) {
27
21
  const { href, path } = locationOf(page?.url);
28
22
  return (0, _flareapp_js_browser.routeName)(() => page?.component, path ?? (0, _flareapp_js_browser.currentPath)(), href);
@@ -106,7 +100,6 @@ function install(router, track) {
106
100
  if (locationOf(page?.url).path !== inFlightPath) return;
107
101
  settle(page);
108
102
  });
109
- /** Whether `visit` is the one that opened the currently held root, i.e. `finish` may settle it. */
110
103
  const belongsToThisNavigation = (visit) => {
111
104
  if (isBackgroundVisit(visit)) return false;
112
105
  if (visit && locationOf(visit.url).path !== inFlightPath) return false;
package/dist/index.d.cts CHANGED
@@ -1,14 +1,8 @@
1
1
  //#region src/vendor/inertiaTypes.d.ts
2
- /** The page object Inertia ships with every response. `component` is the page component name
3
- * ('Products/Show'), `url` a relative string ('/products/42'). */
4
2
  type InertiaPageLike = {
5
3
  component?: string;
6
4
  url?: string;
7
5
  };
8
- /** `visit.url` is a `URL` instance in @inertiajs/core. A string is tolerated for older versions.
9
- * `prefetch` and `async` are how a background visit gives itself away: see `isBackgroundVisit`.
10
- * `interrupted` and `cancelled` are set on the visit `finish` carries, and only the first of the two
11
- * means a successor visit is already on its way. */
12
6
  type InertiaVisitLike = {
13
7
  url?: URL | string;
14
8
  prefetch?: boolean;
package/dist/index.d.mts CHANGED
@@ -1,14 +1,8 @@
1
1
  //#region src/vendor/inertiaTypes.d.ts
2
- /** The page object Inertia ships with every response. `component` is the page component name
3
- * ('Products/Show'), `url` a relative string ('/products/42'). */
4
2
  type InertiaPageLike = {
5
3
  component?: string;
6
4
  url?: string;
7
5
  };
8
- /** `visit.url` is a `URL` instance in @inertiajs/core. A string is tolerated for older versions.
9
- * `prefetch` and `async` are how a background visit gives itself away: see `isBackgroundVisit`.
10
- * `interrupted` and `cancelled` are set on the visit `finish` carries, and only the first of the two
11
- * means a successor visit is already on its way. */
12
6
  type InertiaVisitLike = {
13
7
  url?: URL | string;
14
8
  prefetch?: boolean;
package/dist/index.mjs CHANGED
@@ -1,8 +1,6 @@
1
1
  import { absoluteUrl, currentPath, instrumentOnce, insulate, registerNavigationSource, routeName } from "@flareapp/js/browser";
2
2
 
3
3
  //#region src/traceInertiaRouter.ts
4
- /** Resolve a router-reported location (a `URL` on visits, a relative string on pages) to a full href
5
- * plus its path. Both are undefined outside a browser or for an unparseable value. */
6
4
  function locationOf(raw) {
7
5
  if (raw == null) return {};
8
6
  const url = absoluteUrl(String(raw));
@@ -12,16 +10,12 @@ function locationOf(raw) {
12
10
  path: url.pathname
13
11
  };
14
12
  }
15
- /** Background work fires the same `start` and `finish` a real visit does, so opening a root for one both
16
- * invents a navigation and ends the root that was live. */
17
13
  function isBackgroundVisit(visit) {
18
14
  if (!visit) return false;
19
15
  if (visit.prefetch) return true;
20
16
  const { path } = locationOf(visit.url);
21
17
  return !!visit.async && path !== void 0 && path === currentPath();
22
18
  }
23
- /** `component` ('Products/Show') is Inertia's route identifier, and there is a small fixed set of them,
24
- * so reports group by it the way the other integrations' route templates do. */
25
19
  function routeNameFor(page) {
26
20
  const { href, path } = locationOf(page?.url);
27
21
  return routeName(() => page?.component, path ?? currentPath(), href);
@@ -105,7 +99,6 @@ function install(router, track) {
105
99
  if (locationOf(page?.url).path !== inFlightPath) return;
106
100
  settle(page);
107
101
  });
108
- /** Whether `visit` is the one that opened the currently held root, i.e. `finish` may settle it. */
109
102
  const belongsToThisNavigation = (visit) => {
110
103
  if (isBackgroundVisit(visit)) return false;
111
104
  if (visit && locationOf(visit.url).path !== inFlightPath) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/inertia",
3
- "version": "2.11.0",
3
+ "version": "2.12.0",
4
4
  "description": "Inertia.js performance tracing for flareapp.io",
5
5
  "homepage": "https://flareapp.io",
6
6
  "bugs": "https://github.com/spatie/flare-client-js/issues",
@@ -52,7 +52,7 @@
52
52
  "vitest": "^4.0.0"
53
53
  },
54
54
  "peerDependencies": {
55
- "@flareapp/js": "^2.11.0"
55
+ "@flareapp/js": "^2.12.0"
56
56
  },
57
57
  "publishConfig": {
58
58
  "access": "public"