Skip to content

Commit

Permalink
chore(clerk-js): Lazily load VirtualBodyRootPortal (#3519)
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef authored Jun 5, 2024
1 parent 1ef332c commit c054dcb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/soft-beers-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@clerk/clerk-js': patch
---

Bug fix: statically loading a resource would result in an increase in bundle size for `clerk.browser.js`.
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/lazyModules/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Appearance } from '@clerk/types';
import React, { lazy, Suspense } from 'react';

import type { FlowMetadata } from '../elements';
import { VirtualBodyRootPortal } from '../portal';
import type { ThemableCssProp } from '../styledSystem';
import type { ClerkComponentName } from './components';
import { ClerkComponents } from './components';
Expand All @@ -14,6 +13,7 @@ const AppearanceProvider = lazy(() => import('../customizables').then(m => ({ de
const VirtualRouter = lazy(() => import('../router').then(m => ({ default: m.VirtualRouter })));
const InternalThemeProvider = lazy(() => import('../styledSystem').then(m => ({ default: m.InternalThemeProvider })));
const Portal = lazy(() => import('./../portal').then(m => ({ default: m.Portal })));
const VirtualBodyRootPortal = lazy(() => import('./../portal').then(m => ({ default: m.VirtualBodyRootPortal })));
const FlowMetadataProvider = lazy(() => import('./../elements').then(m => ({ default: m.FlowMetadataProvider })));
const Modal = lazy(() => import('./../elements').then(m => ({ default: m.Modal })));

Expand Down

0 comments on commit c054dcb

Please sign in to comment.