Skip to content

Conversation

@felipe-
Copy link

@felipe- felipe- commented May 16, 2025

No description provided.

Comment on lines +10 to +12
import * as AllIcons from 'components/Icon';
import * as AllUtils from 'utils';
import * as AllComponents from 'components';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import * as AllIcons from 'components/Icon';
import * as AllUtils from 'utils';
import * as AllComponents from 'components';
import { IconFacebookCircle } from 'components/Icon/IconFacebookCircle';
import { IconTwitter } from 'components/Icon/IconTwitter';
import { IconGitHub } from 'components/Icon/IconGitHub';

The component imports complete modules using wildcard imports (import * as) for Icons, Utils, and Components. This pattern imports the entire module content into the bundle even when only a few items are used, significantly increasing the initial JavaScript payload. This directly impacts Core Web Vitals metrics like LCP and TTI by forcing users to download, parse, and execute unnecessary code.

Review by Conductor

Is this review helpful? React 👍 or 👎 to let us know!

Comment on lines +13 to +15
import HeavyDataVisualization from 'components/HeavyDataVisualization';
import ComplexFormBuilder from 'components/ComplexFormBuilder';
import AnalyticsLibrary from 'heavy-analytics-package';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
import HeavyDataVisualization from 'components/HeavyDataVisualization';
import ComplexFormBuilder from 'components/ComplexFormBuilder';
import AnalyticsLibrary from 'heavy-analytics-package';
const HeavyDataVisualization = React.lazy(() => import('components/HeavyDataVisualization'));
const ComplexFormBuilder = React.lazy(() => import('components/ComplexFormBuilder'));
const AnalyticsLibrary = React.lazy(() => import('heavy-analytics-package'));

The component imports heavy, unused components that will be included in the bundle. While they're not rendered, importing HeavyDataVisualization and ComplexFormBuilder still pulls their code into the main bundle unnecessarily, impacting page load performance and Core Web Vitals metrics like LCP and FCP.

Review by Conductor

Is this review helpful? React 👍 or 👎 to let us know!

Comment on lines +20 to +22
// This unused code will still be included in the bundle
const unusedAnalytics = new AnalyticsLibrary();
const unusedComponents = [HeavyDataVisualization, ComplexFormBuilder];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This unused code will still be included in the bundle
const unusedAnalytics = new AnalyticsLibrary();
const unusedComponents = [HeavyDataVisualization, ComplexFormBuilder];
// Removed unused code that was impacting performance

The component initializes a heavy analytics library instance during render. This synchronous operation runs on every component render, blocking the main thread and impacting Core Web Vitals metrics, particularly FCP and LCP. Even though the variable is unused, the initialization still occurs and consumes resources.

Review by Conductor

Is this review helpful? React 👍 or 👎 to let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants