From 804f0f31b7f04c8a1d6e4b56547ba9890a884c0f Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 11:19:57 -0500 Subject: [PATCH 1/8] Top level lazy loading --- .../ConnectorBuilderPage.tsx | 2 ++ .../destination/AllDestinationsPage/index.tsx | 3 +++ .../destination/DestinationItemPage/index.tsx | 3 +++ .../destination/DestinationOverviewPage.tsx | 2 ++ .../DestinationSettingsPage/index.ts | 3 +++ airbyte-webapp/src/pages/routes.tsx | 24 ++++++++++--------- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/airbyte-webapp/src/pages/ConnectorBuilderPage/ConnectorBuilderPage.tsx b/airbyte-webapp/src/pages/ConnectorBuilderPage/ConnectorBuilderPage.tsx index fc28253ee5c7..3bffb7436651 100644 --- a/airbyte-webapp/src/pages/ConnectorBuilderPage/ConnectorBuilderPage.tsx +++ b/airbyte-webapp/src/pages/ConnectorBuilderPage/ConnectorBuilderPage.tsx @@ -59,3 +59,5 @@ export const ConnectorBuilderPage: React.FC = () => ( ); + +export default ConnectorBuilderPage; diff --git a/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx b/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx index 77fff4f24fb8..236bfb0ed7f9 100644 --- a/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx +++ b/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx @@ -1 +1,4 @@ +import { AllDestinationsPage } from "./AllDestinationsPage"; + export { AllDestinationsPage } from "./AllDestinationsPage"; +export default AllDestinationsPage; diff --git a/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx b/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx index d59ca7bff0b0..f10abb425f82 100644 --- a/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx +++ b/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx @@ -1 +1,4 @@ +import { DestinationItemPage } from "./DestinationItemPage"; + export { DestinationItemPage } from "./DestinationItemPage"; +export default DestinationItemPage; diff --git a/airbyte-webapp/src/pages/destination/DestinationOverviewPage.tsx b/airbyte-webapp/src/pages/destination/DestinationOverviewPage.tsx index 93115750a16f..8717600fa0d8 100644 --- a/airbyte-webapp/src/pages/destination/DestinationOverviewPage.tsx +++ b/airbyte-webapp/src/pages/destination/DestinationOverviewPage.tsx @@ -75,3 +75,5 @@ export const DestinationOverviewPage = () => { ); }; + +export default DestinationOverviewPage; diff --git a/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts b/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts index d8c33a61eec3..6432215de9c2 100644 --- a/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts +++ b/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts @@ -1 +1,4 @@ +import { DestinationSettingsPage } from "./DestinationSettingsPage"; + export { DestinationSettingsPage } from "./DestinationSettingsPage"; +export default DestinationSettingsPage; diff --git a/airbyte-webapp/src/pages/routes.tsx b/airbyte-webapp/src/pages/routes.tsx index 2d758484a771..9b4dc3cd7c43 100644 --- a/airbyte-webapp/src/pages/routes.tsx +++ b/airbyte-webapp/src/pages/routes.tsx @@ -13,18 +13,20 @@ import { CompleteOauthRequest } from "views/CompleteOauthRequest"; import MainView from "views/layout/MainView"; import { WorkspaceRead } from "../core/request/AirbyteClient"; -import ConnectionPage from "./ConnectionPage"; -import CreationFormPage from "./ConnectionPage/pages/CreationFormPage"; -import { ConnectorBuilderPage } from "./ConnectorBuilderPage/ConnectorBuilderPage"; -import { AllDestinationsPage } from "./destination/AllDestinationsPage"; -import CreateDestinationPage from "./destination/CreateDestinationPage"; -import { DestinationItemPage } from "./destination/DestinationItemPage"; -import { DestinationOverviewPage } from "./destination/DestinationOverviewPage"; -import { DestinationSettingsPage } from "./destination/DestinationSettingsPage"; -import PreferencesPage from "./PreferencesPage"; import { RoutePaths, DestinationPaths } from "./routePaths"; -import SettingsPage from "./SettingsPage"; -import SourcesPage from "./SourcesPage"; + +const ConnectionPage = React.lazy(() => import("./ConnectionPage")); +const CreationFormPage = React.lazy(() => import("./ConnectionPage/pages/CreationFormPage")); +const ConnectorBuilderPage = React.lazy(() => import("./ConnectorBuilderPage/ConnectorBuilderPage")); + +const AllDestinationsPage = React.lazy(() => import("./destination/AllDestinationsPage")); +const CreateDestinationPage = React.lazy(() => import("./destination/CreateDestinationPage")); +const DestinationItemPage = React.lazy(() => import("./destination/DestinationItemPage")); +const DestinationOverviewPage = React.lazy(() => import("./destination/DestinationOverviewPage")); +const DestinationSettingsPage = React.lazy(() => import("./destination/DestinationSettingsPage")); +const PreferencesPage = React.lazy(() => import("./PreferencesPage")); +const SettingsPage = React.lazy(() => import("./SettingsPage")); +const SourcesPage = React.lazy(() => import("./SourcesPage")); const useAddAnalyticsContextForWorkspace = (workspace: WorkspaceRead): void => { const analyticsContext = useMemo( From fd9cb7082b9b959d08447df2f24006597d0263c7 Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 11:50:41 -0500 Subject: [PATCH 2/8] Lazyloading for Datepicker --- .../Connector/ConnectorForm/components/Property/Control.tsx | 2 ++ .../ConnectorForm/components/Sections/PropertySection.tsx | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx index a6b9c1d1c396..8fd292e6635c 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx @@ -120,3 +120,5 @@ export const Control: React.FC = ({ property, name, disabled, erro /> ); }; + +export default Control; diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx index a7e333429670..12146f4c8798 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx @@ -7,11 +7,12 @@ import { LabeledSwitch } from "components"; import { FormBaseItem } from "core/form/types"; import { useConnectorForm } from "../../connectorFormContext"; -import { Control } from "../Property/Control"; import { PropertyError } from "../Property/PropertyError"; import { PropertyLabel } from "../Property/PropertyLabel"; import styles from "./PropertySection.module.scss"; +const Control = React.lazy(() => import("../Property/Control")); + interface PropertySectionProps { property: FormBaseItem; path?: string; From 8561421dc08b9233accc789f08a311ec087adc54 Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 12:55:45 -0500 Subject: [PATCH 3/8] Cleanup export --- .../ConnectorForm/components/Sections/PropertySection.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx index 12146f4c8798..e29f8896b952 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx @@ -19,7 +19,7 @@ interface PropertySectionProps { disabled?: boolean; } -const PropertySection: React.FC = ({ property, path, disabled }) => { +export const PropertySection: React.FC = ({ property, path, disabled }) => { const propertyPath = path ?? property.path; const formikBag = useField(propertyPath); const [field, meta] = formikBag; @@ -65,5 +65,3 @@ const PropertySection: React.FC = ({ property, path, disab ); }; - -export { PropertySection }; From 0c7996b420f8eaa2372d68a0ffc38bf409c90100 Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 13:03:25 -0500 Subject: [PATCH 4/8] Better datepicker lazy loading --- airbyte-webapp/src/components/ui/DatePicker/DatePicker.tsx | 2 ++ airbyte-webapp/src/components/ui/DatePicker/index.ts | 4 +++- .../Connector/ConnectorForm/components/Property/Control.tsx | 4 +--- .../ConnectorForm/components/Sections/PropertySection.tsx | 3 +-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/airbyte-webapp/src/components/ui/DatePicker/DatePicker.tsx b/airbyte-webapp/src/components/ui/DatePicker/DatePicker.tsx index c64055111126..40a014ad82cd 100644 --- a/airbyte-webapp/src/components/ui/DatePicker/DatePicker.tsx +++ b/airbyte-webapp/src/components/ui/DatePicker/DatePicker.tsx @@ -162,3 +162,5 @@ export const DatePicker: React.FC = ({ ); }; + +export default DatePicker; diff --git a/airbyte-webapp/src/components/ui/DatePicker/index.ts b/airbyte-webapp/src/components/ui/DatePicker/index.ts index b0b3af5ed415..718367514af0 100644 --- a/airbyte-webapp/src/components/ui/DatePicker/index.ts +++ b/airbyte-webapp/src/components/ui/DatePicker/index.ts @@ -1 +1,3 @@ -export { DatePicker } from "./DatePicker"; +import React from "react"; + +export default React.lazy(() => import("./DatePicker")); diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx index 8fd292e6635c..6aa0e7929b64 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx @@ -1,7 +1,7 @@ import { Field, useField } from "formik"; import React from "react"; -import { DatePicker } from "components/ui/DatePicker"; +import DatePicker from "components/ui/DatePicker"; import { DropDown } from "components/ui/DropDown"; import { Input } from "components/ui/Input"; import { Multiselect } from "components/ui/Multiselect"; @@ -120,5 +120,3 @@ export const Control: React.FC = ({ property, name, disabled, erro /> ); }; - -export default Control; diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx index e29f8896b952..21ce5d4c620c 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Sections/PropertySection.tsx @@ -7,12 +7,11 @@ import { LabeledSwitch } from "components"; import { FormBaseItem } from "core/form/types"; import { useConnectorForm } from "../../connectorFormContext"; +import { Control } from "../Property/Control"; import { PropertyError } from "../Property/PropertyError"; import { PropertyLabel } from "../Property/PropertyLabel"; import styles from "./PropertySection.module.scss"; -const Control = React.lazy(() => import("../Property/Control")); - interface PropertySectionProps { property: FormBaseItem; path?: string; From 0a9f21f3b21e564421a0dd89cf8d64b276d6c661 Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 13:24:25 -0500 Subject: [PATCH 5/8] Sources routes lazy loaded --- .../pages/CreationFormPage/CreationFormPage.tsx | 2 ++ airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx | 12 +++++++----- .../src/views/common/StartOverErrorView.tsx | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx b/airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx index 0c55e82c3c75..da9795db1475 100644 --- a/airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx +++ b/airbyte-webapp/src/pages/ConnectionPage/pages/CreationFormPage/CreationFormPage.tsx @@ -247,3 +247,5 @@ export const CreationFormPage: React.FC = () => { ); }; + +export default CreationFormPage; diff --git a/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx b/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx index 57fba58b77c8..7e5b7b1d4053 100644 --- a/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx +++ b/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx @@ -1,14 +1,16 @@ import React from "react"; import { Navigate, Route, Routes } from "react-router-dom"; -import { CreationFormPage } from "pages/ConnectionPage/pages/CreationFormPage/CreationFormPage"; import { ResourceNotFoundErrorBoundary } from "views/common/ResorceNotFoundErrorBoundary"; -import { StartOverErrorView } from "views/common/StartOverErrorView"; import { RoutePaths } from "../routePaths"; -import AllSourcesPage from "./pages/AllSourcesPage"; -import CreateSourcePage from "./pages/CreateSourcePage/CreateSourcePage"; -import SourceItemPage from "./pages/SourceItemPage"; + +const AllSourcesPage = React.lazy(() => import("./pages/AllSourcesPage")); +const CreateSourcePage = React.lazy(() => import("./pages/CreateSourcePage/CreateSourcePage")); +const SourceItemPage = React.lazy(() => import("./pages/SourceItemPage")); +const CreationFormPage = React.lazy(() => import("pages/ConnectionPage/pages/CreationFormPage/CreationFormPage")); + +const StartOverErrorView = React.lazy(() => import("views/common/StartOverErrorView")); export const SourcesPage: React.FC = () => ( diff --git a/airbyte-webapp/src/views/common/StartOverErrorView.tsx b/airbyte-webapp/src/views/common/StartOverErrorView.tsx index 54115e039ba8..f775893d90ec 100644 --- a/airbyte-webapp/src/views/common/StartOverErrorView.tsx +++ b/airbyte-webapp/src/views/common/StartOverErrorView.tsx @@ -23,3 +23,5 @@ export const StartOverErrorView: React.FC = ({ message, /> ); }; + +export default StartOverErrorView; From 20db48f5ba0744d56aa8bc596cc6aa9d069b4631 Mon Sep 17 00:00:00 2001 From: KC Date: Fri, 16 Dec 2022 13:30:52 -0500 Subject: [PATCH 6/8] More connection page optimization --- airbyte-webapp/src/pages/ConnectionPage/ConnectionPage.tsx | 7 ++++--- .../pages/ConnectionItemPage/ConnectionItemPage.tsx | 2 ++ airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx | 3 +-- airbyte-webapp/src/views/common/StartOverErrorView.tsx | 2 -- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/airbyte-webapp/src/pages/ConnectionPage/ConnectionPage.tsx b/airbyte-webapp/src/pages/ConnectionPage/ConnectionPage.tsx index 828278e8557d..78cbab7b3bf3 100644 --- a/airbyte-webapp/src/pages/ConnectionPage/ConnectionPage.tsx +++ b/airbyte-webapp/src/pages/ConnectionPage/ConnectionPage.tsx @@ -7,9 +7,10 @@ import { ResourceNotFoundErrorBoundary } from "views/common/ResorceNotFoundError import { StartOverErrorView } from "views/common/StartOverErrorView"; import { RoutePaths } from "../routePaths"; -import AllConnectionsPage from "./pages/AllConnectionsPage"; -import { ConnectionItemPage } from "./pages/ConnectionItemPage/ConnectionItemPage"; -import { CreationFormPage } from "./pages/CreationFormPage/CreationFormPage"; + +const CreationFormPage = React.lazy(() => import("./pages/CreationFormPage/CreationFormPage")); +const ConnectionItemPage = React.lazy(() => import("./pages/ConnectionItemPage/ConnectionItemPage")); +const AllConnectionsPage = React.lazy(() => import("./pages/AllConnectionsPage")); export const ConnectionPage: React.FC = () => ( }> diff --git a/airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionItemPage.tsx b/airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionItemPage.tsx index 6d3b6400ef13..b72522d8f042 100644 --- a/airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionItemPage.tsx +++ b/airbyte-webapp/src/pages/ConnectionPage/pages/ConnectionItemPage/ConnectionItemPage.tsx @@ -70,3 +70,5 @@ export const ConnectionItemPage = () => { ); }; + +export default ConnectionItemPage; diff --git a/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx b/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx index 7e5b7b1d4053..ac10deb6bab2 100644 --- a/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx +++ b/airbyte-webapp/src/pages/SourcesPage/SourcesPage.tsx @@ -2,6 +2,7 @@ import React from "react"; import { Navigate, Route, Routes } from "react-router-dom"; import { ResourceNotFoundErrorBoundary } from "views/common/ResorceNotFoundErrorBoundary"; +import { StartOverErrorView } from "views/common/StartOverErrorView"; import { RoutePaths } from "../routePaths"; @@ -10,8 +11,6 @@ const CreateSourcePage = React.lazy(() => import("./pages/CreateSourcePage/Creat const SourceItemPage = React.lazy(() => import("./pages/SourceItemPage")); const CreationFormPage = React.lazy(() => import("pages/ConnectionPage/pages/CreationFormPage/CreationFormPage")); -const StartOverErrorView = React.lazy(() => import("views/common/StartOverErrorView")); - export const SourcesPage: React.FC = () => ( } /> diff --git a/airbyte-webapp/src/views/common/StartOverErrorView.tsx b/airbyte-webapp/src/views/common/StartOverErrorView.tsx index f775893d90ec..54115e039ba8 100644 --- a/airbyte-webapp/src/views/common/StartOverErrorView.tsx +++ b/airbyte-webapp/src/views/common/StartOverErrorView.tsx @@ -23,5 +23,3 @@ export const StartOverErrorView: React.FC = ({ message, /> ); }; - -export default StartOverErrorView; From 6de476139942392abb73876b6bd2a90cf338f86f Mon Sep 17 00:00:00 2001 From: KC Date: Mon, 19 Dec 2022 14:06:51 -0500 Subject: [PATCH 7/8] Cloud pass --- .../src/packages/cloud/cloudRoutes.tsx | 33 ++++++++++--------- .../cloud/views/AcceptEmailInvite.tsx | 2 ++ .../src/packages/cloud/views/DefaultView.tsx | 2 ++ .../cloud/views/FirebaseActionRoute.tsx | 9 ++--- .../src/packages/cloud/views/auth/Auth.tsx | 13 ++++---- .../auth/ConfirmPasswordResetPage/index.tsx | 4 +++ .../cloud/views/auth/LoginPage/index.tsx | 2 +- .../views/auth/ResetPasswordPage/index.tsx | 2 +- .../cloud/views/auth/SignupPage/index.tsx | 2 +- .../components/PersonQuoteCover/index.tsx | 4 ++- .../src/packages/cloud/views/auth/index.tsx | 4 +-- .../packages/cloud/views/credits/index.tsx | 2 +- .../views/settings/CloudSettingsPage.tsx | 2 ++ .../packages/cloud/views/workspaces/index.tsx | 2 +- .../src/pages/SpeakeasyRedirectPage/index.tsx | 4 ++- 15 files changed, 52 insertions(+), 35 deletions(-) diff --git a/airbyte-webapp/src/packages/cloud/cloudRoutes.tsx b/airbyte-webapp/src/packages/cloud/cloudRoutes.tsx index db4fea04ab25..eb773b2e70f5 100644 --- a/airbyte-webapp/src/packages/cloud/cloudRoutes.tsx +++ b/airbyte-webapp/src/packages/cloud/cloudRoutes.tsx @@ -10,19 +10,6 @@ import { FeatureItem, FeatureSet, useFeatureService } from "hooks/services/Featu import { useApiHealthPoll } from "hooks/services/Health"; import { useQuery } from "hooks/useQuery"; import { useAuthService } from "packages/cloud/services/auth/AuthService"; -import { Auth } from "packages/cloud/views/auth"; -import { CreditsPage } from "packages/cloud/views/credits"; -import MainView from "packages/cloud/views/layout/MainView"; -import { WorkspacesPage } from "packages/cloud/views/workspaces"; -import ConnectionPage from "pages/ConnectionPage"; -import CreationFormPage from "pages/ConnectionPage/pages/CreationFormPage"; -import { AllDestinationsPage } from "pages/destination/AllDestinationsPage"; -import CreateDestinationPage from "pages/destination/CreateDestinationPage"; -import { DestinationItemPage } from "pages/destination/DestinationItemPage"; -import { DestinationOverviewPage } from "pages/destination/DestinationOverviewPage"; -import { DestinationSettingsPage } from "pages/destination/DestinationSettingsPage"; -import SourcesPage from "pages/SourcesPage"; -import { SpeakeasyRedirectPage } from "pages/SpeakeasyRedirectPage"; import { useCurrentWorkspace, WorkspaceServiceProvider } from "services/workspaces/WorkspacesService"; import { setSegmentAnonymousId, useGetSegmentAnonymousId } from "utils/crossDomainUtils"; import { storeUtmFromQuery } from "utils/utmStorage"; @@ -32,9 +19,7 @@ import { RoutePaths, DestinationPaths } from "../../pages/routePaths"; import { CreditStatus } from "./lib/domain/cloudWorkspaces/types"; import { LDExperimentServiceProvider } from "./services/thirdParty/launchdarkly"; import { useGetCloudWorkspace } from "./services/workspaces/CloudWorkspacesService"; -import { DefaultView } from "./views/DefaultView"; import { VerifyEmailAction } from "./views/FirebaseActionRoute"; -import { CloudSettingsPage } from "./views/settings/CloudSettingsPage"; export const CloudRoutes = { Root: "/", @@ -56,6 +41,24 @@ export const CloudRoutes = { FirebaseAction: "/verify-email", } as const; +const MainView = React.lazy(() => import("packages/cloud/views/layout/MainView")); +const WorkspacesPage = React.lazy(() => import("packages/cloud/views/workspaces")); +const Auth = React.lazy(() => import("packages/cloud/views/auth")); +const CreditsPage = React.lazy(() => import("packages/cloud/views/credits")); + +const ConnectionPage = React.lazy(() => import("pages/ConnectionPage")); +const CreationFormPage = React.lazy(() => import("pages/ConnectionPage/pages/CreationFormPage")); +const AllDestinationsPage = React.lazy(() => import("pages/destination/AllDestinationsPage")); +const CreateDestinationPage = React.lazy(() => import("pages/destination/CreateDestinationPage")); +const DestinationItemPage = React.lazy(() => import("pages/destination/DestinationItemPage")); +const DestinationOverviewPage = React.lazy(() => import("pages/destination/DestinationOverviewPage")); +const DestinationSettingsPage = React.lazy(() => import("pages/destination/DestinationSettingsPage")); +const SourcesPage = React.lazy(() => import("pages/SourcesPage")); +const SpeakeasyRedirectPage = React.lazy(() => import("pages/SpeakeasyRedirectPage")); + +const CloudSettingsPage = React.lazy(() => import("./views/settings/CloudSettingsPage")); +const DefaultView = React.lazy(() => import("./views/DefaultView")); + const MainRoutes: React.FC = () => { const { setWorkspaceFeatures } = useFeatureService(); const workspace = useCurrentWorkspace(); diff --git a/airbyte-webapp/src/packages/cloud/views/AcceptEmailInvite.tsx b/airbyte-webapp/src/packages/cloud/views/AcceptEmailInvite.tsx index 616163a28eb4..b5d23368ab39 100644 --- a/airbyte-webapp/src/packages/cloud/views/AcceptEmailInvite.tsx +++ b/airbyte-webapp/src/packages/cloud/views/AcceptEmailInvite.tsx @@ -94,3 +94,5 @@ export const AcceptEmailInvite: React.FC = () => { ); }; + +export default AcceptEmailInvite; diff --git a/airbyte-webapp/src/packages/cloud/views/DefaultView.tsx b/airbyte-webapp/src/packages/cloud/views/DefaultView.tsx index c17843fde634..acfa16b4c214 100644 --- a/airbyte-webapp/src/packages/cloud/views/DefaultView.tsx +++ b/airbyte-webapp/src/packages/cloud/views/DefaultView.tsx @@ -36,3 +36,5 @@ export const DefaultView: React.FC = () => { /> ); }; + +export default DefaultView; diff --git a/airbyte-webapp/src/packages/cloud/views/FirebaseActionRoute.tsx b/airbyte-webapp/src/packages/cloud/views/FirebaseActionRoute.tsx index a41f6c84db18..a0f429829a1c 100644 --- a/airbyte-webapp/src/packages/cloud/views/FirebaseActionRoute.tsx +++ b/airbyte-webapp/src/packages/cloud/views/FirebaseActionRoute.tsx @@ -3,7 +3,6 @@ import { useIntl } from "react-intl"; import { Navigate, useNavigate } from "react-router-dom"; import { useAsync } from "react-use"; -import LoadingPage from "components/LoadingPage"; import { ToastType } from "components/ui/Toast"; import { PageTrackingCodes, useTrackPage } from "hooks/services/Analytics"; @@ -12,8 +11,10 @@ import { useQuery } from "hooks/useQuery"; import { useAuthService } from "packages/cloud/services/auth/AuthService"; import { CloudRoutes } from "../cloudRoutes"; -import { AcceptEmailInvite } from "./AcceptEmailInvite"; -import { ResetPasswordConfirmPage } from "./auth/ConfirmPasswordResetPage"; + +const AcceptEmailInvite = React.lazy(() => import("./AcceptEmailInvite")); +const ResetPasswordConfirmPage = React.lazy(() => import("./auth/ConfirmPasswordResetPage")); +const LoadingPage = React.lazy(() => import("components/LoadingPage")); export enum FirebaseActionMode { VERIFY_EMAIL = "verifyEmail", @@ -53,7 +54,7 @@ export const VerifyEmailAction: React.FC = () => { }; export const FirebaseActionRoute: React.FC = () => { - const { mode } = useQuery(); + const { mode } = useQuery<{ mode: FirebaseActionMode }>(); switch (mode) { case FirebaseActionMode.VERIFY_EMAIL: diff --git a/airbyte-webapp/src/packages/cloud/views/auth/Auth.tsx b/airbyte-webapp/src/packages/cloud/views/auth/Auth.tsx index e366a2d531d5..d614f6dfd520 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/Auth.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/Auth.tsx @@ -11,10 +11,11 @@ import { FirebaseActionRoute } from "packages/cloud/views/FirebaseActionRoute"; import styles from "./Auth.module.scss"; import FormContent from "./components/FormContent"; -import { PersonQuoteCover } from "./components/PersonQuoteCover"; -import { LoginPage } from "./LoginPage"; -import { ResetPasswordPage } from "./ResetPasswordPage"; -import { SignupPage } from "./SignupPage"; + +const PersonQuoteCover = React.lazy(() => import("./components/PersonQuoteCover")); +const LoginPage = React.lazy(() => import("./LoginPage")); +const ResetPasswordPage = React.lazy(() => import("./ResetPasswordPage")); +const SignupPage = React.lazy(() => import("./SignupPage")); const hasValidRightSideUrl = (url?: string): boolean => { if (url) { @@ -33,7 +34,7 @@ const hasValidRightSideUrl = (url?: string): boolean => { return false; }; -const Auth: React.FC = () => { +export const Auth: React.FC = () => { const { pathname } = useLocation(); const { formatMessage } = useIntl(); const { loggedOut } = useAuthService(); @@ -74,5 +75,3 @@ const Auth: React.FC = () => { ); }; - -export default Auth; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/ConfirmPasswordResetPage/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/ConfirmPasswordResetPage/index.tsx index 308d4aa33f16..b5661d55ae0d 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/ConfirmPasswordResetPage/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/ConfirmPasswordResetPage/index.tsx @@ -1 +1,5 @@ +import { ResetPasswordConfirmPage } from "./ConfirmPasswordResetPage"; + export * from "./ConfirmPasswordResetPage"; + +export default ResetPasswordConfirmPage; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx index 3d7a720ccafc..e7bbf4454219 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx @@ -1,3 +1,3 @@ import LoginPage from "./LoginPage"; -export { LoginPage }; +export default LoginPage; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/ResetPasswordPage/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/ResetPasswordPage/index.tsx index ab398d3d365b..19706f3ae869 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/ResetPasswordPage/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/ResetPasswordPage/index.tsx @@ -1,3 +1,3 @@ import ResetPasswordPage from "./ResetPasswordPage"; -export { ResetPasswordPage }; +export default ResetPasswordPage; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/SignupPage/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/SignupPage/index.tsx index 25aef74940c0..435f9f1855ef 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/SignupPage/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/SignupPage/index.tsx @@ -1,3 +1,3 @@ import SignupPage from "./SignupPage"; -export { SignupPage }; +export default SignupPage; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/components/PersonQuoteCover/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/components/PersonQuoteCover/index.tsx index 32a82bcce848..9b0b2601471b 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/components/PersonQuoteCover/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/components/PersonQuoteCover/index.tsx @@ -1 +1,3 @@ -export { PersonQuoteCover } from "./PersonQuoteCover"; +import { PersonQuoteCover } from "./PersonQuoteCover"; + +export default PersonQuoteCover; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/index.tsx index 02113077f2c5..b1a43d593c3a 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/index.tsx @@ -1,3 +1,3 @@ -import Auth from "./Auth"; +import { Auth } from "./Auth"; -export { Auth }; +export default Auth; diff --git a/airbyte-webapp/src/packages/cloud/views/credits/index.tsx b/airbyte-webapp/src/packages/cloud/views/credits/index.tsx index c3f0efb2a208..ec2fa8d2cad8 100644 --- a/airbyte-webapp/src/packages/cloud/views/credits/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/credits/index.tsx @@ -1,3 +1,3 @@ import CreditsPage from "./CreditsPage"; -export { CreditsPage }; +export default CreditsPage; diff --git a/airbyte-webapp/src/packages/cloud/views/settings/CloudSettingsPage.tsx b/airbyte-webapp/src/packages/cloud/views/settings/CloudSettingsPage.tsx index 8737e29351ec..12b16bd9377d 100644 --- a/airbyte-webapp/src/packages/cloud/views/settings/CloudSettingsPage.tsx +++ b/airbyte-webapp/src/packages/cloud/views/settings/CloudSettingsPage.tsx @@ -118,3 +118,5 @@ export const CloudSettingsPage: React.FC = () => { return ; }; + +export default CloudSettingsPage; diff --git a/airbyte-webapp/src/packages/cloud/views/workspaces/index.tsx b/airbyte-webapp/src/packages/cloud/views/workspaces/index.tsx index 70594dad3abf..78fe36a1baf4 100644 --- a/airbyte-webapp/src/packages/cloud/views/workspaces/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/workspaces/index.tsx @@ -1,3 +1,3 @@ import WorkspacesPage from "./WorkspacesPage"; -export { WorkspacesPage }; +export default WorkspacesPage; diff --git a/airbyte-webapp/src/pages/SpeakeasyRedirectPage/index.tsx b/airbyte-webapp/src/pages/SpeakeasyRedirectPage/index.tsx index 11a607c7d6d7..5b1600a7cb24 100644 --- a/airbyte-webapp/src/pages/SpeakeasyRedirectPage/index.tsx +++ b/airbyte-webapp/src/pages/SpeakeasyRedirectPage/index.tsx @@ -1 +1,3 @@ -export { SpeakeasyRedirectPage } from "./SpeakeasyRedirectPage"; +import { SpeakeasyRedirectPage } from "./SpeakeasyRedirectPage"; + +export default SpeakeasyRedirectPage; From 0c9ac1515c0c9b54194d57752484d82a5d2d06e3 Mon Sep 17 00:00:00 2001 From: KC Date: Wed, 4 Jan 2023 15:43:12 -0500 Subject: [PATCH 8/8] Joseph code review --- airbyte-webapp/src/components/ui/DatePicker/index.ts | 4 +--- .../src/packages/cloud/views/auth/LoginPage/LoginPage.tsx | 4 +--- .../src/packages/cloud/views/auth/LoginPage/index.tsx | 4 +--- .../src/pages/destination/AllDestinationsPage/index.tsx | 5 +---- .../src/pages/destination/DestinationItemPage/index.tsx | 5 +---- .../src/pages/destination/DestinationSettingsPage/index.ts | 5 +---- .../Connector/ConnectorForm/components/Property/Control.tsx | 3 ++- 7 files changed, 8 insertions(+), 22 deletions(-) diff --git a/airbyte-webapp/src/components/ui/DatePicker/index.ts b/airbyte-webapp/src/components/ui/DatePicker/index.ts index 718367514af0..cfd145ba692e 100644 --- a/airbyte-webapp/src/components/ui/DatePicker/index.ts +++ b/airbyte-webapp/src/components/ui/DatePicker/index.ts @@ -1,3 +1 @@ -import React from "react"; - -export default React.lazy(() => import("./DatePicker")); +export { DatePicker as default } from "./DatePicker"; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/LoginPage.tsx b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/LoginPage.tsx index 3a1c517032b8..8e8757fc3328 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/LoginPage.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/LoginPage.tsx @@ -26,7 +26,7 @@ const LoginPageValidationSchema = yup.object().shape({ password: yup.string().required("form.empty.error"), }); -const LoginPage: React.FC = () => { +export const LoginPage: React.FC = () => { const { formatMessage } = useIntl(); const { login } = useAuthService(); const query = useQuery<{ from?: string }>(); @@ -120,5 +120,3 @@ const LoginPage: React.FC = () => { ); }; - -export default LoginPage; diff --git a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx index e7bbf4454219..35fe74b2a768 100644 --- a/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx +++ b/airbyte-webapp/src/packages/cloud/views/auth/LoginPage/index.tsx @@ -1,3 +1 @@ -import LoginPage from "./LoginPage"; - -export default LoginPage; +export { LoginPage as default } from "./LoginPage"; diff --git a/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx b/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx index 236bfb0ed7f9..878d0080eb47 100644 --- a/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx +++ b/airbyte-webapp/src/pages/destination/AllDestinationsPage/index.tsx @@ -1,4 +1 @@ -import { AllDestinationsPage } from "./AllDestinationsPage"; - -export { AllDestinationsPage } from "./AllDestinationsPage"; -export default AllDestinationsPage; +export { AllDestinationsPage as default } from "./AllDestinationsPage"; diff --git a/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx b/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx index f10abb425f82..77cec5e8e2a5 100644 --- a/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx +++ b/airbyte-webapp/src/pages/destination/DestinationItemPage/index.tsx @@ -1,4 +1 @@ -import { DestinationItemPage } from "./DestinationItemPage"; - -export { DestinationItemPage } from "./DestinationItemPage"; -export default DestinationItemPage; +export { DestinationItemPage as default } from "./DestinationItemPage"; diff --git a/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts b/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts index 6432215de9c2..22374d3a210d 100644 --- a/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts +++ b/airbyte-webapp/src/pages/destination/DestinationSettingsPage/index.ts @@ -1,4 +1 @@ -import { DestinationSettingsPage } from "./DestinationSettingsPage"; - -export { DestinationSettingsPage } from "./DestinationSettingsPage"; -export default DestinationSettingsPage; +export { DestinationSettingsPage as default } from "./DestinationSettingsPage"; diff --git a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx index 2b63165b3dbc..474b0b71166b 100644 --- a/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx +++ b/airbyte-webapp/src/views/Connector/ConnectorForm/components/Property/Control.tsx @@ -1,7 +1,6 @@ import { Field, useField } from "formik"; import React, { useCallback } from "react"; -import DatePicker from "components/ui/DatePicker"; import { DropDown } from "components/ui/DropDown"; import { Input } from "components/ui/Input"; import { Multiselect } from "components/ui/Multiselect"; @@ -14,6 +13,8 @@ import { isDefined } from "utils/common"; import SecretConfirmationControl from "./SecretConfirmationControl"; +const DatePicker = React.lazy(() => import("components/ui/DatePicker")); + interface ControlProps { property: FormBaseItem; name: string;