Skip to content

Commit ed37925

Browse files
authored
feat: avoid pulling entire lodash library into build (#515)
Importing from lodash was causing the entire library to be pulled. This change reduces the compressed production build size of frontend-app-profile by 6kB.
1 parent ebb8707 commit ed37925

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/studio-footer/StudioFooter.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useContext, useState } from 'react';
2-
import _ from 'lodash';
2+
import isEmpty from 'lodash/isEmpty';
33
import { useIntl, FormattedMessage } from '@edx/frontend-platform/i18n';
44
import { ensureConfig } from '@edx/frontend-platform';
55
import { AppContext } from '@edx/frontend-platform/react';
@@ -88,7 +88,7 @@ const StudioFooter = ({
8888
>
8989
<FormattedMessage {...messages.studioXButtonLabel} />
9090
</Button>
91-
{!_.isEmpty(config.SUPPORT_EMAIL) && (
91+
{!isEmpty(config.SUPPORT_EMAIL) && (
9292
<Button
9393
as="a"
9494
href={`mailto:${config.SUPPORT_EMAIL}`}
@@ -105,11 +105,11 @@ const StudioFooter = ({
105105
<ActionRow className="pt-3 m-0 x-small">
106106
© {new Date().getFullYear()} <Hyperlink destination={config.MARKETING_SITE_BASE_URL} target="_blank" className="ml-2">{config.SITE_NAME}</Hyperlink>
107107
<ActionRow.Spacer />
108-
{!_.isEmpty(config.TERMS_OF_SERVICE_URL) && (
108+
{!isEmpty(config.TERMS_OF_SERVICE_URL) && (
109109
<Hyperlink destination={config.TERMS_OF_SERVICE_URL} data-testid="termsOfService">
110110
{intl.formatMessage(messages.termsOfServiceLinkLabel)}
111111
</Hyperlink>
112-
)}{!_.isEmpty(config.PRIVACY_POLICY_URL) && (
112+
)}{!isEmpty(config.PRIVACY_POLICY_URL) && (
113113
<Hyperlink destination={config.PRIVACY_POLICY_URL} data-testid="privacyPolicy">
114114
{intl.formatMessage(messages.privacyPolicyLinkLabel)}
115115
</Hyperlink>

0 commit comments

Comments
 (0)