@lookiero/checkout 0.6.0-beta.11 → 0.6.0-beta.13
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.d.ts +1 -1
- package/dist/infrastructure/ui/Root.js +4 -1
- package/dist/infrastructure/ui/routing/Routing.d.ts +3 -1
- package/dist/infrastructure/ui/routing/Routing.js +2 -2
- package/dist/shared/logging/SentryDependencies.js +8 -2
- package/dist/shared/logging/SentryDependencies.native.js +3 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ interface BootstrapFunctionArgs {
|
|
|
13
13
|
readonly getAuthToken: () => Promise<string>;
|
|
14
14
|
readonly apiUrl: string;
|
|
15
15
|
readonly translations: EndpointFunction;
|
|
16
|
-
readonly sentry
|
|
16
|
+
readonly sentry?: SentryLoggerFunctionArgs;
|
|
17
17
|
}
|
|
18
18
|
interface BootstrapFunctionReturn {
|
|
19
19
|
readonly Root: ComponentType<RootProps>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { wrapUseRoutes } from "@sentry/react";
|
|
1
2
|
import React, { useCallback } from "react";
|
|
2
3
|
import { Platform } from "react-native";
|
|
4
|
+
import { useRoutes as reactRouterUseRoutes } from "react-router-native";
|
|
3
5
|
import { sentryLogger } from "../../shared/logging/SentryLogger";
|
|
4
6
|
import { Routing } from "./routing/Routing";
|
|
5
7
|
const root = ({ Messaging, I18n, getAuthToken, development, sentry }) => {
|
|
8
|
+
const useRoutes = sentry ? wrapUseRoutes(reactRouterUseRoutes) : reactRouterUseRoutes;
|
|
6
9
|
// eslint-disable-next-line react/display-name, react/prop-types
|
|
7
10
|
const Root = ({ basePath, locale = "en", customer, menu, tabBar, onNotAccessible, useRedirect }) => {
|
|
8
11
|
const handleOnI18nError = useCallback(() => void 0, []);
|
|
9
12
|
return (React.createElement(Messaging, { includeReactQueryDevTools: Platform.OS === "web" },
|
|
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 })));
|
|
13
|
+
React.createElement(Routing, { I18n: I18n, basePath: basePath, customer: customer, getAuthToken: getAuthToken, locale: locale, menu: menu, tabBar: tabBar, useRedirect: useRedirect, useRoutes: useRoutes, onI18nError: development ? undefined : handleOnI18nError, onNotAccessible: onNotAccessible })));
|
|
11
14
|
};
|
|
12
15
|
return sentry
|
|
13
16
|
? sentryLogger({
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { I18n } from "@lookiero/i18n-react";
|
|
2
|
-
import { FC } from "react";
|
|
2
|
+
import React, { FC } from "react";
|
|
3
|
+
import { Location, RouteObject } from "react-router-native";
|
|
3
4
|
import { Customer } from "../../../projection/shared/customer";
|
|
4
5
|
import { Menu, TabBar } from "../views/navigation/Navigation";
|
|
5
6
|
interface RoutingProps {
|
|
@@ -13,6 +14,7 @@ interface RoutingProps {
|
|
|
13
14
|
readonly onNotAccessible: () => void;
|
|
14
15
|
readonly onI18nError?: (err: Error) => void;
|
|
15
16
|
readonly useRedirect: () => Record<string, string>;
|
|
17
|
+
readonly useRoutes: (routes: RouteObject[], locationArg?: Partial<Location> | string) => React.ReactElement | null;
|
|
16
18
|
}
|
|
17
19
|
declare const Routing: FC<RoutingProps>;
|
|
18
20
|
export { Routing };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { lazy, Suspense } from "react";
|
|
2
|
-
import { Navigate, Outlet
|
|
2
|
+
import { Navigate, Outlet } 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,7 +12,7 @@ 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, }) => {
|
|
15
|
+
const Routing = ({ basePath = "", customer, locale, I18n, menu, tabBar, getAuthToken, onI18nError, onNotAccessible, useRedirect, useRoutes, }) => {
|
|
16
16
|
const routes = useRoutes([
|
|
17
17
|
{
|
|
18
18
|
path: "",
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { BrowserClient, Hub } from "@sentry/browser";
|
|
2
2
|
import { makeFetchTransport } from "@sentry/browser";
|
|
3
|
-
import { ErrorBoundary } from "@sentry/react";
|
|
3
|
+
import { ErrorBoundary, reactRouterV6Instrumentation } from "@sentry/react";
|
|
4
4
|
import { BrowserTracing } from "@sentry/tracing";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
import { createRoutesFromChildren, matchRoutes, useLocation, useNavigationType } from "react-router-native";
|
|
5
7
|
const transport = (options, nativeFetch) => makeFetchTransport(options, nativeFetch);
|
|
6
|
-
const integrations = [
|
|
8
|
+
const integrations = [
|
|
9
|
+
new BrowserTracing({
|
|
10
|
+
routingInstrumentation: reactRouterV6Instrumentation(useEffect, useLocation, useNavigationType, createRoutesFromChildren, matchRoutes),
|
|
11
|
+
}),
|
|
12
|
+
];
|
|
7
13
|
const wrap = (Component) => Component;
|
|
8
14
|
export { BrowserClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
|
|
@@ -3,6 +3,8 @@ import { ReactNativeClient, Hub, ErrorBoundary, wrap as sentryWrap } from "@sent
|
|
|
3
3
|
import { makeReactNativeTransport } from "@sentry/react-native/dist/js/transports/native";
|
|
4
4
|
import { NATIVE } from "@sentry/react-native/dist/js/wrapper";
|
|
5
5
|
const transport = (options, nativeFetch) => NATIVE.isNativeTransportAvailable() ? makeReactNativeTransport(options) : makeFetchTransport(options, nativeFetch);
|
|
6
|
-
const integrations = [
|
|
6
|
+
const integrations = [
|
|
7
|
+
// native tracing?? => rr6 integration??
|
|
8
|
+
];
|
|
7
9
|
const wrap = (Component) => sentryWrap(Component);
|
|
8
10
|
export { ReactNativeClient as Client, Hub, ErrorBoundary, transport, integrations, wrap };
|