Skip to content

Comments

Fixed code splitting by refactoring index files#6333

Merged
witoszekdev merged 5 commits intomainfrom
fix-auth-import-warning
Feb 12, 2026
Merged

Fixed code splitting by refactoring index files#6333
witoszekdev merged 5 commits intomainfrom
fix-auth-import-warning

Conversation

@witoszekdev
Copy link
Member

@witoszekdev witoszekdev commented Feb 11, 2026

This PR resolves Vite warning during build:

#56 354.4 [warn] [plugin vite:reporter] 
#56 354.4 (!) /app/src/auth/index.tsx is dynamically imported by /app/src/index.tsx but also statically imported by /app/src/attributes/components/AttributePage/AttributePage.tsx, /app/src/auth/AuthProvider.tsx, /app/src/auth/components/Layout.tsx, /app/src/auth/components/LoginPage/LoginPage.tsx, /app/src/auth/components/SectionRoute.tsx, /app/src/auth/hooks/useAuthRedirection.ts, /app/src/auth/hooks/useUserAccessibleChannels.ts, /app/src/auth/hooks/useUserPermissions.ts, /app/src/auth/views/Login.tsx, /app/src/categories/components/CategoryUpdatePage/CategoryUpdatePage.tsx, /app/src/channels/views/ChannelCreate/useSaveChannel.ts, /app/src/collections/components/CollectionDetailsPage/CollectionDetailsPage.tsx, /app/src/components/AccountPermissions/AccountPermissions.tsx, /app/src/components/AppLayout/AppChannelContext.tsx, /app/src/components/AppLayout/TopNav/Root.tsx, /app/src/components/Datagrid/persistance/useMetadata.ts, /app/src/components/Shop/index.tsx, /app/src/components/Sidebar/menu/hooks/useMenuS
#56 354.4 
#56 354.4 [warn] [plugin vite:reporter] 
#56 354.4 (!) /app/src/configuration/index.tsx is dynamically imported by /app/src/index.tsx but also statically imported by /app/src/attributes/components/AttributeListPage/AttributeListPage.tsx, /app/src/channels/pages/ChannelsListPage/ChannelsListPage.tsx, /app/src/components/Sidebar/menu/hooks/useMenuStructure.tsx, /app/src/configuration/utils.ts, /app/src/permissionGroups/components/PermissionGroupListPage/PermissionGroupListPage.tsx, /app/src/productTypes/components/ProductTypeListPage/ProductTypeListPage.tsx, /app/src/refundsSettings/components/RefundsSettingsPage/RefundsSettingsPage.tsx, /app/src/shipping/components/ShippingZonesListPage/ShippingZonesListPage.tsx, /app/src/siteSettings/components/SiteSettingsPage/SiteSettingsPage.tsx, /app/src/staff/components/StaffListPage/StaffListPage.tsx, /app/src/taxes/pages/TaxChannelsPage/TaxChannelsPage.tsx, /app/src/taxes/pages/TaxClassesPage/TaxClassesPage.tsx, /app/src/taxes/pages/TaxCountriesPage/TaxCountriesPage.tsx, /app/src/warehouses/components/Warehou
#56 354.4 

It means that some domain-level index.tsx had code that could only be loaded from index.ts.

Because we are using dynamic imports for main app index.ts (e.g. importing configuration/index.tsx), this caused entire auth and configuration modules to be included in the main bundle.

@changeset-bot
Copy link

changeset-bot bot commented Feb 11, 2026

🦋 Changeset detected

Latest commit: a6acc7f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@witoszekdev witoszekdev marked this pull request as ready for review February 11, 2026 12:20
@witoszekdev witoszekdev requested a review from a team as a code owner February 11, 2026 12:20
@witoszekdev witoszekdev changed the title Fixed static imports which were meant for dynamic imports Fixed code splitting by refactoring index files Feb 11, 2026
@codecov
Copy link

codecov bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 96.61017% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 42.58%. Comparing base (b5d86ff) to head (a6acc7f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/configuration/createConfigurationMenu.tsx 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6333      +/-   ##
==========================================
- Coverage   42.79%   42.58%   -0.21%     
==========================================
  Files        2497     2495       -2     
  Lines       43406    43305     -101     
  Branches    10232    10249      +17     
==========================================
- Hits        18574    18442     -132     
+ Misses      24795    23547    -1248     
- Partials       37     1316    +1279     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@witoszekdev witoszekdev merged commit 1739498 into main Feb 12, 2026
13 of 14 checks passed
@witoszekdev witoszekdev deleted the fix-auth-import-warning branch February 12, 2026 10:42
This was referenced Feb 17, 2026
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