@lookiero/checkout 0.6.0-beta.29 → 0.6.0-beta.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.
@@ -1,7 +1,6 @@
1
1
  import { I18n } from "@lookiero/i18n-react";
2
2
  import { MessagingRoot } from "@lookiero/messaging-react/bootstrap";
3
3
  import { ComponentType } from "react";
4
- import { Routes as ReactRouterRoutes } from "react-router-native";
5
4
  import { Customer } from "../../projection/shared/customer";
6
5
  import { SentryLoggerFunctionArgs } from "../../shared/logging/SentryLogger";
7
6
  import { Menu, TabBar } from "./views/navigation/Navigation";
@@ -9,7 +8,7 @@ interface RootFunctionArgs {
9
8
  readonly Messaging: MessagingRoot;
10
9
  readonly I18n: I18n;
11
10
  readonly development?: boolean;
12
- readonly sentry: SentryLoggerFunctionArgs;
11
+ readonly sentry?: SentryLoggerFunctionArgs;
13
12
  readonly getAuthToken: () => Promise<string>;
14
13
  }
15
14
  interface RootFunction {
@@ -23,7 +22,6 @@ interface RootProps {
23
22
  readonly tabBar: TabBar;
24
23
  readonly onNotAccessible: () => void;
25
24
  readonly useRedirect: () => Record<string, string>;
26
- readonly rootRoutes?: typeof ReactRouterRoutes;
27
25
  }
28
26
  declare const root: RootFunction;
29
27
  export type { RootProps };
@@ -1,15 +1,21 @@
1
1
  import React, { useCallback } from "react";
2
2
  import { Platform } from "react-native";
3
- import { Routes as ReactRouterRoutes } from "react-router-native";
4
3
  import { sentryLogger } from "../../shared/logging/SentryLogger";
5
4
  import { Routing } from "./routing/Routing";
6
5
  const root = ({ Messaging, I18n, getAuthToken, development, sentry }) => {
7
6
  // eslint-disable-next-line react/display-name, react/prop-types
8
- const Root = ({ basePath, locale = "en", customer, menu, tabBar, onNotAccessible, useRedirect, rootRoutes = ReactRouterRoutes, }) => {
7
+ const Root = ({ basePath, locale = "en", customer, menu, tabBar, onNotAccessible, useRedirect }) => {
9
8
  const handleOnI18nError = useCallback(() => void 0, []);
10
9
  return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
11
- React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, rootRoutes: rootRoutes, tabBar: tabBar, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
10
+ React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, tabBar: tabBar, useRedirect: useRedirect, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
12
11
  };
13
- return sentryLogger(sentry)(Root);
12
+ return sentry
13
+ ? sentryLogger({
14
+ publicKey: sentry.publicKey,
15
+ environment: sentry.environment,
16
+ release: sentry.release,
17
+ project: sentry.project,
18
+ })(Root)
19
+ : Root;
14
20
  };
15
21
  export { root };
@@ -11,7 +11,7 @@ const CheckoutAccessibilityMiddleware = ({ customerId, onNotAccessible, loader =
11
11
  if (notAccessible) {
12
12
  onNotAccessibleRef.current();
13
13
  }
14
- }, [notAccessible]);
14
+ }, [notAccessible, onNotAccessible]);
15
15
  return accessible === undefined && [QueryStatus.IDLE, QueryStatus.LOADING].includes(status)
16
16
  ? loader
17
17
  : accessible
@@ -1,6 +1,5 @@
1
1
  import { I18n } from "@lookiero/i18n-react";
2
2
  import { FC } from "react";
3
- import { Routes as ReactRouterRoutes } from "react-router-native";
4
3
  import { Customer } from "../../../projection/shared/customer";
5
4
  import { Menu, TabBar } from "../views/navigation/Navigation";
6
5
  interface RoutingProps {
@@ -14,7 +13,6 @@ interface RoutingProps {
14
13
  readonly onNotAccessible: () => void;
15
14
  readonly onI18nError?: (err: Error) => void;
16
15
  readonly useRedirect: () => Record<string, string>;
17
- readonly rootRoutes: typeof ReactRouterRoutes;
18
16
  }
19
17
  declare const Routing: FC<RoutingProps>;
20
18
  export { Routing };
@@ -1,5 +1,5 @@
1
1
  import React, { lazy, Suspense } from "react";
2
- import { Navigate, Outlet, Route } from "react-router-native";
2
+ import { Navigate, Outlet, useRoutes } from "react-router-native";
3
3
  import { Spinner } from "../../../shared/ui/components/atoms/spinner/Spinner";
4
4
  import { App } from "../views/App";
5
5
  import { CheckoutPaymentModal } from "../views/checkout/components/checkoutPaymentModal/CheckoutPaymentModal";
@@ -12,28 +12,61 @@ const Item = lazy(() => import("../views/item/Item").then((module) => ({ default
12
12
  const Summary = lazy(() => import("../views/summary/Summary").then((module) => ({ default: module.Summary })));
13
13
  const Checkout = lazy(() => import("../views/checkout/Checkout").then((module) => ({ default: module.Checkout })));
14
14
  const Feedback = lazy(() => import("../views/feedback/Feedback").then((module) => ({ default: module.Feedback })));
15
- const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, rootRoutes: RootRoutes, }) => {
16
- return (React.createElement(RootRoutes, null,
17
- React.createElement(Route, { path: "", element: React.createElement(BasePathProvider, { basePath: basePath },
15
+ const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, }) => {
16
+ const routes = useRoutes([
17
+ {
18
+ path: "",
19
+ element: (React.createElement(BasePathProvider, { basePath: basePath },
18
20
  React.createElement(CheckoutAccessibilityMiddleware, { customerId: customer?.customerId, onNotAccessible: onNotAccessible },
19
21
  React.createElement(I18n, { loader: React.createElement(Spinner, null), locale: locale, onError: onI18nError },
20
22
  React.createElement(CheckoutMiddleware, { customerId: customer?.customerId },
21
23
  React.createElement(App, { customerId: customer?.customerId, menu: menu, tabBar: tabBar },
22
- React.createElement(Outlet, null)))))) },
23
- React.createElement(Route, { path: Routes.INTRO, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
24
- React.createElement(Intro, { customerId: customer?.customerId })) }),
25
- React.createElement(Route, { path: Routes.ITEM, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
26
- React.createElement(Item, { country: customer?.country, customerId: customer?.customerId })) }),
27
- React.createElement(Route, { path: Routes.ITEM_DETAIL, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
28
- React.createElement(Item, { country: customer?.country, customerId: customer?.customerId })) }),
29
- React.createElement(Route, { path: Routes.SUMMARY, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
30
- React.createElement(Summary, { country: customer?.country, customerId: customer?.customerId })) }),
31
- React.createElement(Route, { path: Routes.CHECKOUT, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
32
- React.createElement(Checkout, { country: customer?.country, customerId: customer?.customerId, useRedirect: useRedirect },
33
- React.createElement(Outlet, null))) },
34
- React.createElement(Route, { element: React.createElement(CheckoutPaymentModal, { customerId: customer?.customerId, getAuthToken: getAuthToken }), path: Routes.CHECKOUT_PAYMENT })),
35
- React.createElement(Route, { path: Routes.FEEDBACK, element: React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
36
- React.createElement(Feedback, { customerId: customer?.customerId })) }),
37
- React.createElement(Route, { element: React.createElement(Navigate, { to: `${Routes.HOME}`, replace: true }), path: "*" }))));
24
+ React.createElement(Outlet, null))))))),
25
+ children: [
26
+ {
27
+ path: Routes.INTRO,
28
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
29
+ React.createElement(Intro, { customerId: customer?.customerId }))),
30
+ },
31
+ {
32
+ path: Routes.ITEM,
33
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
34
+ React.createElement(Item, { country: customer?.country, customerId: customer?.customerId }))),
35
+ },
36
+ {
37
+ path: Routes.ITEM_DETAIL,
38
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
39
+ React.createElement(Item, { country: customer?.country, customerId: customer?.customerId }))),
40
+ },
41
+ {
42
+ path: Routes.SUMMARY,
43
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
44
+ React.createElement(Summary, { country: customer?.country, customerId: customer?.customerId }))),
45
+ },
46
+ {
47
+ path: Routes.CHECKOUT,
48
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
49
+ React.createElement(Checkout, { country: customer?.country, customerId: customer?.customerId, useRedirect: useRedirect },
50
+ React.createElement(Outlet, null)))),
51
+ children: [
52
+ {
53
+ path: Routes.CHECKOUT_PAYMENT,
54
+ element: React.createElement(CheckoutPaymentModal, { customerId: customer?.customerId, getAuthToken: getAuthToken }),
55
+ },
56
+ ],
57
+ },
58
+ {
59
+ path: Routes.FEEDBACK,
60
+ element: (React.createElement(Suspense, { fallback: React.createElement(Spinner, null) },
61
+ React.createElement(Feedback, { customerId: customer?.customerId }))),
62
+ },
63
+ {
64
+ path: "*",
65
+ element: React.createElement(Navigate, { to: `${Routes.HOME}`, replace: true }),
66
+ },
67
+ ],
68
+ },
69
+ ]);
70
+ return routes;
38
71
  };
39
72
  export { Routing };
@@ -4,8 +4,14 @@ import { SafeAreaProvider } from "react-native-safe-area-context";
4
4
  import { Notifications } from "../../../shared/notifications/infrastructure/ui/views/Notifications";
5
5
  import { MESSAGING_CONTEXT_ID } from "../../delivery/baseBootstrap";
6
6
  import { Navigation } from "./navigation/Navigation";
7
- const App = ({ customerId, menu, tabBar, children }) => (React.createElement(SafeAreaProvider, null,
8
- React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
9
- React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
10
- React.createElement(PortalProvider, null, children))));
7
+ const a = true;
8
+ const App = ({ customerId, menu, tabBar, children }) => {
9
+ if (a) {
10
+ throw new Error("This is my first Sentry error");
11
+ }
12
+ return (React.createElement(SafeAreaProvider, null,
13
+ React.createElement(Notifications, { contextId: MESSAGING_CONTEXT_ID }),
14
+ React.createElement(Navigation, { customerId: customerId, menu: menu, tabBar: tabBar },
15
+ React.createElement(PortalProvider, null, children))));
16
+ };
11
17
  export { App };
@@ -1,20 +1,15 @@
1
+ import "@sentry/tracing";
1
2
  import { ComponentType } from "react";
2
3
  import { Platform } from "react-native";
3
4
  interface SentryLoggerFunctionArgs {
4
- readonly routerBasename: string;
5
5
  readonly publicKey: string;
6
6
  readonly environment: `${typeof Platform.OS}-${"DEV" | "PROD"}`;
7
7
  readonly release: string;
8
8
  readonly project: string;
9
9
  }
10
- interface SentryLoggerHOCProps {
11
- readonly customer: {
12
- readonly customerId: string;
13
- } | undefined;
14
- }
15
10
  interface SentryLoggerFunction {
16
- (args: SentryLoggerFunctionArgs): <P extends SentryLoggerHOCProps>(Component: ComponentType<P>) => ComponentType<P & JSX.IntrinsicAttributes>;
11
+ (args: SentryLoggerFunctionArgs): <P>(Component: ComponentType<P>) => ComponentType<P & JSX.IntrinsicAttributes>;
17
12
  }
18
13
  declare const sentryLogger: SentryLoggerFunction;
19
- export type { SentryLoggerFunctionArgs, SentryLoggerHOCProps };
14
+ export type { SentryLoggerFunctionArgs };
20
15
  export { sentryLogger };
@@ -1,103 +1,41 @@
1
- import { defaultStackParser } from "@sentry/browser";
2
1
  import { makeMain } from "@sentry/core";
3
- import { withSentryReactRouterV6Routing } from "@sentry/react";
2
+ import * as Sentry from "@sentry/react-native";
3
+ import "@sentry/tracing";
4
4
  import React, { useEffect } from "react";
5
5
  import { Platform } from "react-native";
6
- import { Routes as ReactRouterRoutes } from "react-router-native";
7
- import { Client, Hub, ErrorBoundary, transport, integrations, wrap } from "./SentryDependencies";
8
- const sentryLogger = ({ routerBasename, publicKey, environment, release, project }) => {
6
+ const sentryLogger = ({ publicKey, environment, release, project }) => {
9
7
  let mainHub;
10
- const client = new Client({
8
+ /**
9
+ * TS complains about not providing 'transport' and 'stackParser' implementations
10
+ * although 'ReactNativeClient' defaults to its own implementation for those options.
11
+ */
12
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
+ // @ts-ignore
14
+ const client = new Sentry.ReactNativeClient({
11
15
  environment,
12
16
  release,
13
17
  dsn: `https://${publicKey}@o179049.ingest.sentry.io/${project}`,
14
- integrations: integrations(routerBasename),
18
+ integrations: [new Sentry.ReactNativeTracing()],
15
19
  tracesSampleRate: 1.0,
16
20
  debug: true,
17
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
18
- // @ts-ignore
19
21
  enableNative: Platform.OS !== "web",
20
- stackParser: defaultStackParser,
21
- transport,
22
- // This configuration is obtained from
23
- // https://docs.sentry.io/clients/javascript/tips/#decluttering-sentry
24
- ignoreErrors: [
25
- // Random plugins/extensions
26
- "top.GLOBALS",
27
- // See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error.html
28
- "originalCreateNotification",
29
- "canvas.contentDocument",
30
- "MyApp_RemoveAllHighlights",
31
- "http://tt.epicplay.com",
32
- "Can't find variable: ZiteReader",
33
- "jigsaw is not defined",
34
- "ComboSearch is not defined",
35
- "http://loading.retry.widdit.com/",
36
- "atomicFindClose",
37
- // Facebook borked
38
- "fb_xd_fragment",
39
- // ISP "optimizing" proxy - `Cache-Control: no-transform` seems to reduce this. (thanks @acdha)
40
- // See http://stackoverflow.com/questions/4113268/how-to-stop-javascript-injection-from-vodafone-proxy
41
- "bmi_SafeAddOnload",
42
- "EBCallBackMessageReceived",
43
- // See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
44
- "conduitPage",
45
- // Generic error code from errors outside the security sandbox
46
- // You can delete this if using raven.js > 1.0, which ignores these automatically.
47
- "Script error.",
48
- // Avast extension error
49
- "_avast_submit",
50
- ],
51
- denyUrls: [
52
- // Google Adsense
53
- /pagead\/js/i,
54
- // Facebook flakiness
55
- /graph\.facebook\.com/i,
56
- // Facebook blocked
57
- /connect\.facebook\.net\/en_US\/all\.js/i,
58
- // Woopra flakiness
59
- /eatdifferent\.com\.woopra-ns\.com/i,
60
- /static\.woopra\.com\/js\/woopra\.js/i,
61
- // Chrome extensions
62
- /extensions\//i,
63
- /^chrome:\/\//i,
64
- // Other plugins
65
- /127\.0\.0\.1:4001\/isrunning/i,
66
- /webappstoolbarba\.texthelp\.com\//i,
67
- /metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
68
- ],
69
- beforeSendTransaction: (event, hint) => {
70
- console.log(event, hint);
71
- return event;
72
- },
73
22
  });
74
- const hub = new Hub(client);
75
- const onMount = (customerId) => {
76
- if (!mainHub) {
77
- hub.setUser({ id: customerId });
78
- hub.startSession();
79
- mainHub = makeMain(hub);
80
- }
23
+ const hub = new Sentry.Hub(client);
24
+ hub.bindClient(client);
25
+ const switchMainHub = () => {
26
+ mainHub = makeMain(hub);
81
27
  };
82
- const onUnMount = () => {
83
- hub.setUser(null);
84
- hub.endSession();
28
+ const revertMainHub = () => {
85
29
  makeMain(mainHub);
86
30
  };
87
- // const useRoutes = wrapUseRoutes(reactRouterUseRoutes);
88
- const Routes = withSentryReactRouterV6Routing(ReactRouterRoutes);
89
31
  return (Component) => {
90
- const WrappedComponent = wrap(Component);
91
- const SentryLogger = (props) => {
92
- const { customer } = props;
93
- useEffect(() => {
94
- onMount(customer?.customerId);
95
- return onUnMount;
96
- }, [customer?.customerId]);
97
- return (React.createElement(ErrorBoundary, null,
98
- React.createElement(WrappedComponent, { ...props, rootRoutes: Routes })));
32
+ switchMainHub();
33
+ const WrappedComponent = Sentry.wrap(Component);
34
+ // eslint-disable-next-line react/display-name
35
+ return (props) => {
36
+ useEffect(() => revertMainHub, []);
37
+ return React.createElement(WrappedComponent, { ...props });
99
38
  };
100
- return SentryLogger;
101
39
  };
102
40
  };
103
41
  export { sentryLogger };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lookiero/checkout",
3
- "version": "0.6.0-beta.29",
3
+ "version": "0.6.0-beta.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -33,7 +33,6 @@
33
33
  "@lookiero/messaging": "^8.0.0",
34
34
  "@lookiero/messaging-react": "^8.0.0",
35
35
  "@react-spring/native": "^9.5.5",
36
- "@sentry/react-native": "^4.13.0",
37
36
  "inline-style-prefixer": "6.0.1",
38
37
  "react-native-safe-area-context": "^4.4.1",
39
38
  "react-native-svg": "^12.1.1",
@@ -48,6 +47,7 @@
48
47
  "@lookiero/event": "^0.3",
49
48
  "@lookiero/locale": "^0.3",
50
49
  "@lookiero/payments-front": "^0.16.5",
50
+ "@sentry/react-native": "^3.2.13",
51
51
  "apollo-boost": "0.4.4",
52
52
  "graphql": "16.6.0",
53
53
  "graphql-tag": "2.12.6",
@@ -80,6 +80,7 @@
80
80
  "@types/react-dom": "~18.0.0",
81
81
  "@types/react-native": "~0.69.1",
82
82
  "@types/uuid": "^9.0.0",
83
+ "@sentry/react-native": "^3.2.13",
83
84
  "apollo-boost": "0.4.4",
84
85
  "eslint": "^8.24.0",
85
86
  "eslint-config-prettier": "^8.5.0",
@@ -1,9 +0,0 @@
1
- import { BrowserClient, Hub } from "@sentry/browser";
2
- import { ErrorBoundary } from "@sentry/react";
3
- import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
4
- import { Transport, Integration } from "@sentry/types";
5
- import { ComponentType } from "react";
6
- declare const transport: (options: ReactNativeTransportOptions) => Transport;
7
- declare const integrations: (basename: string) => Integration[];
8
- declare const wrap: <P>(Component: ComponentType<P>) => ComponentType<P>;
9
- export { BrowserClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -1,16 +0,0 @@
1
- import { BrowserClient, Hub, makeFetchTransport, defaultIntegrations } from "@sentry/browser";
2
- import { ErrorBoundary } from "@sentry/react";
3
- import { reactRouterV6Instrumentation } from "@sentry/react";
4
- import { BrowserTracing } from "@sentry/tracing";
5
- import { useEffect } from "react";
6
- import { createRoutesFromChildren, useLocation, useNavigationType } from "react-router-native";
7
- import { matchRoutesForBasename } from "./matchRoutes";
8
- const transport = (options, nativeFetch) => makeFetchTransport(options, nativeFetch);
9
- const integrations = (basename) => [
10
- ...defaultIntegrations,
11
- new BrowserTracing({
12
- routingInstrumentation: reactRouterV6Instrumentation(useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutesForBasename(basename)),
13
- }),
14
- ];
15
- const wrap = (Component) => Component;
16
- export { BrowserClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -1,8 +0,0 @@
1
- import { ReactNativeClient, Hub, ErrorBoundary } from "@sentry/react-native";
2
- import { ReactNativeTransportOptions } from "@sentry/react-native/dist/js/options";
3
- import { Transport, Integration } from "@sentry/types";
4
- import { ComponentType } from "react";
5
- declare const transport: (options: ReactNativeTransportOptions) => Transport;
6
- declare const integrations: (basename: string) => Integration[];
7
- declare const wrap: <P>(Component: ComponentType<P>) => ComponentType<P>;
8
- export { ReactNativeClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -1,16 +0,0 @@
1
- import { makeFetchTransport } from "@sentry/browser";
2
- import { ReactNativeClient, Hub, ErrorBoundary, wrap as sentryWrap, ReactNativeTracing } from "@sentry/react-native";
3
- import { makeReactNativeTransport } from "@sentry/react-native/dist/js/transports/native";
4
- import { NATIVE } from "@sentry/react-native/dist/js/wrapper";
5
- import { useEffect } from "react";
6
- import { createRoutesFromChildren, useLocation, useNavigationType } from "react-router-native";
7
- import { matchRoutesForBasename } from "./matchRoutes";
8
- import { ReactRouterV6Instrumentation } from "./reactRouterV6Instrumentation.native";
9
- const transport = (options, nativeFetch) => NATIVE.isNativeTransportAvailable() ? makeReactNativeTransport(options) : makeFetchTransport(options, nativeFetch);
10
- const integrations = (basename) => [
11
- new ReactNativeTracing({
12
- routingInstrumentation: new ReactRouterV6Instrumentation(useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutesForBasename(basename)),
13
- }),
14
- ];
15
- const wrap = (Component) => sentryWrap(Component);
16
- export { ReactNativeClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
@@ -1,6 +0,0 @@
1
- import { matchRoutes } from "@remix-run/router";
2
- interface MatchRoutesForBasenameFunction {
3
- (basename: string): typeof matchRoutes;
4
- }
5
- declare const matchRoutesForBasename: MatchRoutesForBasenameFunction;
6
- export { matchRoutesForBasename };
@@ -1,7 +0,0 @@
1
- import { matchRoutes } from "@remix-run/router";
2
- const matchRoutesForBasename = (basename) => (routes, locationArg) => {
3
- // Remove the location's first path ("/checkout"). Otherwise it won't match the proper route.
4
- const location = (typeof locationArg === "string" ? locationArg : locationArg?.pathname || "").replace(/^\/\w+/, "");
5
- return matchRoutes(routes, location, basename);
6
- };
7
- export { matchRoutesForBasename };
@@ -1,14 +0,0 @@
1
- import { RoutingInstrumentation } from "@sentry/react-native";
2
- import { useEffect } from "react";
3
- import { matchRoutes } from "react-router-native";
4
- import { createRoutesFromChildren, useLocation, useNavigationType } from "react-router-native";
5
- type UseEffect = typeof useEffect;
6
- type UseLocation = typeof useLocation;
7
- type UseNavigationType = typeof useNavigationType;
8
- type CreateRoutesFromChildren = typeof createRoutesFromChildren;
9
- type MatchRoutes = typeof matchRoutes;
10
- declare class ReactRouterV6Instrumentation extends RoutingInstrumentation {
11
- static instrumentationName: string;
12
- constructor(useEffect: UseEffect, useLocation: UseLocation, useNavigationType: UseNavigationType, createRoutesFromChildren: CreateRoutesFromChildren, matchRoutes: MatchRoutes);
13
- }
14
- export { ReactRouterV6Instrumentation };
@@ -1,10 +0,0 @@
1
- import { reactRouterV6Instrumentation as origReactRouterV6Instrumentation } from "@sentry/react";
2
- import { RoutingInstrumentation } from "@sentry/react-native";
3
- class ReactRouterV6Instrumentation extends RoutingInstrumentation {
4
- static instrumentationName = "react-router-v6";
5
- constructor(useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes) {
6
- super();
7
- origReactRouterV6Instrumentation(useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes);
8
- }
9
- }
10
- export { ReactRouterV6Instrumentation };