Client config not render blocking (#12300)

Changes for performance improvement.
The primary improvements include replacing GraphQL queries with
REST-based client configuration fetching and making the client config
non render-blocking
This commit is contained in:
Félix Malfait
2025-05-27 00:06:48 +02:00
committed by GitHub
parent aa58259019
commit 4ce7fc6987
18 changed files with 776 additions and 148 deletions

View File

@ -124,6 +124,9 @@ export const graphqlMocks = {
},
});
}),
http.get(`${REACT_APP_SERVER_BASE_URL}/client-config`, () => {
return HttpResponse.json(mockedClientConfig);
}),
metadataGraphql.query(
getOperationName(FIND_MANY_OBJECT_METADATA_ITEMS) ?? '',
() => {

View File

@ -10,7 +10,6 @@ export const mockedClientConfig: ClientConfig = {
password: true,
microsoft: false,
sso: [],
__typename: 'AuthProviders',
},
frontDomain: 'localhost',
defaultSubdomain: 'app',
@ -20,35 +19,29 @@ export const mockedClientConfig: ClientConfig = {
support: {
supportDriver: 'front',
supportFrontChatId: null,
__typename: 'Support',
},
sentry: {
dsn: 'MOCKED_DSN',
release: 'MOCKED_RELEASE',
environment: 'MOCKED_ENVIRONMENT',
__typename: 'Sentry',
},
billing: {
isBillingEnabled: true,
billingUrl: '',
trialPeriods: [
{
__typename: 'BillingTrialPeriodDTO',
duration: 30,
isCreditCardRequired: true,
},
{
__typename: 'BillingTrialPeriodDTO',
duration: 7,
isCreditCardRequired: false,
},
],
__typename: 'Billing',
},
captcha: {
provider: CaptchaDriverType.GoogleRecaptcha,
siteKey: 'MOCKED_SITE_KEY',
__typename: 'Captcha',
},
api: { mutationMaximumAffectedRecords: 100 },
canManageFeatureFlags: true,