Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PC-32033) feat(Poc): bundle splitting #7116

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip
Co-authored-by: bebstein-pass <bebstein-pass@users.noreply.github.com>
cgerrard-pass and bebstein-pass committed Oct 30, 2024
commit 56c87d43e72b8975b48234cc644e0169994002c2
10 changes: 6 additions & 4 deletions src/features/navigation/RootNavigator/routes.tsx
Original file line number Diff line number Diff line change
@@ -90,11 +90,13 @@ import { TypoDS } from 'ui/theme'

import { RootRoute } from './types'

const LegalNotices = lazy(() =>
import('features/profile/pages/LegalNotices/LegalNotices').then((module) => ({
const LegalNotices = lazy(async () => {
const module = await import('features/profile/pages/LegalNotices/LegalNotices')
await new Promise((resolve) => setTimeout(resolve, 4_000))
return {
default: module.LegalNotices,
}))
)
}
})

export const routes: RootRoute[] = [
...accessibilityRoutes,
15 changes: 11 additions & 4 deletions src/features/navigation/RootNavigator/subscriptionRoutes.tsx
Original file line number Diff line number Diff line change
@@ -39,8 +39,15 @@ import {
} from 'features/navigation/RootNavigator/types'
import { TypoDS } from 'ui/theme'

const IdentityCheckModule = lazy(() =>
import('./subscriptionRoutesModule').then((module) => ({
const IdentityCheckModule = lazy(async () => {
const module = await import('./subscriptionRoutesModule')
// await new Promise<void>((resolve) => {
// setTimeout(() => {
// resolve()
// }, 4000)
// })
await new Promise((resolve) => setTimeout(resolve, 4000))
return {
default: module.BeneficiaryAccountCreated,
stepper: module.Stepper,
beneficiaryRequestSent: module.BeneficiaryRequestSent,
@@ -74,8 +81,8 @@ const IdentityCheckModule = lazy(() =>
navigationSignUp: module.NavigationSignUp,
navigationIdentityCheck: module.NavigationIdentityCheck,
newIdentificationFlow: module.NewIdentificationFlow,
}))
)
}
})

const LoadingComponent = () => <TypoDS.Title1>Chargement...</TypoDS.Title1>