Skip to content

Commit

Permalink
Add a comment explaining why we're not loading async components throu…
Browse files Browse the repository at this point in the history
…gh index file
  • Loading branch information
yakhinvadim committed Jun 10, 2021
1 parent 2425821 commit 1880755
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions x-pack/plugins/security/public/ui_api/components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import React from 'react';

import type { CoreStart } from 'src/core/public';

/**
* We're importing specific files here instead of passing them
* through the index file. It helps to keep the bundle size low.
*
* Importing async components through the index file increases the bundle size.
* It happens because the bundle starts to also include all the sync dependencies
* available through the index file.
*/
import { getChangePasswordComponent } from '../account_management/change_password/change_password_async';
import { getPersonalInfoComponent } from '../account_management/personal_info/personal_info_async';
import { LazyWrapper } from './lazy_wrapper';
Expand Down

0 comments on commit 1880755

Please sign in to comment.