Skip to content

Commit d7892ac

Browse files
authored
Remove LoadingEllipsis from initial document render (#102441)
* Remove LoadingEllipsis from initial document render * Import path.parse directly to avoid variable name conflict
1 parent 2413145 commit d7892ac

File tree

2 files changed

+26
-27
lines changed

2 files changed

+26
-27
lines changed

client/document/index.jsx

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import path from 'path';
1+
import { parse } from 'path';
22
import config from '@automattic/calypso-config';
33
import { isLocaleRtl } from '@automattic/i18n-utils';
44
import { Step } from '@automattic/onboarding';
@@ -18,7 +18,6 @@ import EnvironmentBadge, {
1818
import Head from 'calypso/components/head';
1919
import JetpackLogo from 'calypso/components/jetpack-logo';
2020
import Loading from 'calypso/components/loading';
21-
import { LoadingEllipsis } from 'calypso/components/loading-ellipsis';
2221
import WooCommerceLogo from 'calypso/components/woocommerce-logo';
2322
import WordPressLogo from 'calypso/components/wordpress-logo';
2423
import isA8CForAgencies from 'calypso/lib/a8c-for-agencies/is-a8c-for-agencies';
@@ -74,7 +73,7 @@ class Document extends Component {
7473

7574
const installedChunks = entrypoint.js
7675
.concat( chunkFiles.js )
77-
.map( ( chunk ) => path.parse( chunk ).name );
76+
.map( ( chunk ) => parse( chunk ).name );
7877

7978
const inlineScript =
8079
`var COMMIT_SHA = ${ jsonStringifyForHtml( commitSha ) };\n` +
@@ -134,15 +133,6 @@ class Document extends Component {
134133
}
135134
}
136135

137-
const shouldNotShowLoadingLogo =
138-
sectionName === 'checkout' || sectionName === 'stepper' || sectionName === 'signup';
139-
140-
const LoadingLogo = chooseLoadingLogo( this.props, {
141-
isWpMobileApp: app?.isWpMobileApp,
142-
isWcMobileApp: app?.isWcMobileApp,
143-
isWCCOM,
144-
} );
145-
146136
return (
147137
<html
148138
lang={ lang }
@@ -197,17 +187,12 @@ class Document extends Component {
197187
} ) }
198188
>
199189
<div className="layout__content">
200-
{ shouldNotShowLoadingLogo ? (
201-
<>
202-
{ showStepContainerV2Loader ? (
203-
<Step.Loading />
204-
) : (
205-
<Loading className="wpcom-loading__boot" />
206-
) }
207-
</>
208-
) : (
209-
<LoadingLogo size={ 72 } className="wpcom-site__logo" />
210-
) }
190+
<LoadingPlaceholder
191+
app={ app }
192+
sectionName={ sectionName }
193+
isWCCOM={ isWCCOM }
194+
showStepContainerV2Loader={ showStepContainerV2Loader }
195+
/>
211196
</div>
212197
</div>
213198
</div>
@@ -312,12 +297,27 @@ class Document extends Component {
312297
);
313298
}
314299
}
300+
function LoadingPlaceholder( { app, sectionName, isWCCOM, showStepContainerV2Loader } ) {
301+
const shouldNotShowLoadingLogo =
302+
sectionName === 'checkout' || sectionName === 'stepper' || sectionName === 'signup';
315303

316-
function chooseLoadingLogo( { useLoadingEllipsis }, { isWpMobileApp, isWcMobileApp, isWCCOM } ) {
317-
if ( useLoadingEllipsis ) {
318-
return LoadingEllipsis;
304+
if ( shouldNotShowLoadingLogo ) {
305+
return showStepContainerV2Loader ? (
306+
<Step.Loading />
307+
) : (
308+
<Loading className="wpcom-loading__boot" />
309+
);
319310
}
320311

312+
const LoadingLogo = chooseLoadingLogo( {
313+
isWpMobileApp: app?.isWpMobileApp,
314+
isWcMobileApp: app?.isWcMobileApp,
315+
isWCCOM,
316+
} );
317+
return <LoadingLogo size={ 72 } className="wpcom-site__logo" />;
318+
}
319+
320+
function chooseLoadingLogo( { isWpMobileApp, isWcMobileApp, isWCCOM } ) {
321321
if ( isWcMobileApp || isWCCOM ) {
322322
return WooCommerceLogo;
323323
}

client/server/pages/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ function getDefaultContext( request, response, entrypoint = 'entry-main' ) {
197197
config.isEnabled( 'use-translation-chunks' ) ||
198198
flags.includes( 'use-translation-chunks' ) ||
199199
request.query.hasOwnProperty( 'useTranslationChunks' ),
200-
useLoadingEllipsis: !! request.query.loading_ellipsis,
201200
showGdprBanner,
202201
showStepContainerV2Loader: isInStepContainerV2FlowContext( request.path, request.query ),
203202
} );

0 commit comments

Comments
 (0)