ClerkProvider mounts the `@clerk/ui` component renderer on every page load (~234 KB extra JS without any auth intent)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- next.js, node.js, react, typescript
調査の方向性
Start by tracing the provider effects in @clerk/react and how __internal_updateProps and ensureMounted() interact in @clerk/clerk-js; the issue cites their published package files and the related fixes #4498, #4876, and #7901. Reproduce with a Next.js App Router page that has no Clerk components, then inspect the network chunks. Done means the renderer and billing chunks do not load on an idle page while mount*() and open*() still work as expected.
索引モデルが issue の本文から書いたものです。
説明
Summary
With a plain <ClerkProvider> (Next.js App Router, UI loaded from the Clerk CDN, no ui prop), every page load
downloads and evaluates the full @clerk/ui renderer after v1/client, even if the page renders no Clerk component
and no modal is ever opened. We expected the renderer to mount on the first open*() / mount*() call.
Measured on a production app (signed out, no Clerk component on the page, transfer sizes):
| Chunk | Transfer |
|---|---|
framework_ui_*_1.25.0.js |
43 KB |
ui-common_ui_*_1.25.0.js |
122 KB |
vendors_ui_*_1.25.0.js |
64 KB |
subscriptionDetails_ui_*_1.25.0.js |
5 KB |
That is ~234 KB on the wire, ~765 KB of raw JS to parse and evaluate on every page view, plus ui.browser.js itself.
subscriptionDetails is loaded although Clerk Billing is not used. With the bundled ui prop the same chunks load,
from the app bundle instead.
Versions
@clerk/nextjs7.5.14,@clerk/react6.12.0,@clerk/shared4.25.0@clerk/clerk-js6.41.0 (CDN,@6),@clerk/ui1.25.0 (CDN, version pinned)- Next.js 16.4.3, React 19.3.0
- Same code paths in the latest versions as of 2026-11-05:
@clerk/react6.18.6,@clerk/clerk-js6.42.3,@clerk/ui1.42.4
Cause (code references in the published packages)
@clerk/react6.12.0,dist/ClerkProvider-GF8qvIpk.mjs:1544–1549:useLoadedIsomorphicClerkhas two effects that
callisomorphicClerk.__internal_updateProps(...), one forappearanceand one forlocalization. They run on the
first mount, even if the values equal the options already passed toclerk.load().@clerk/clerk-js6.41.0 (dist/clerk.browser.js):__internal_updatePropsalways mounts first:
return this.#eR?.then(e=>e.ensureMounted()).then(e=>e.updateProps(t)). This dates from #4498.@clerk/ui1.25.0,dist/Components.js:34–42: the firstensureMounted()importslazyModules/common.js
(framework, ui-common, vendors) and rendersComponents.@clerk/ui1.25.0,dist/Components.js:431–444anddist/lazyModules/drawers.js:Componentsalways renders
MountedCheckoutDrawer,MountedPlanDetailDrawerandMountedSubscriptionDetailDrawer. They areReact.lazy
modules, so rendering them while closed loads the billing chunk.
Expected
__internal_updatePropscalled before the renderer is mounted should store the props and apply them on mount,
instead of callingensureMounted(). A similar early mount was fixed for the keyless prompt in #4876. #7901 already
preloads component chunks onmount*()/open*(), so the first modal would not wait long.- The billing drawers should render only when opened, or only when Billing is enabled for the instance.
Steps to reproduce
- Create a Next.js App Router app and wrap the root layout in
<ClerkProvider>(CDN UI, nouiprop). Pass
localizationorappearance, or none: the effects run on mount either way. - Render a page without any Clerk component and do not interact with it.
- In the Network panel, after
v1/client, theframework_ui_*,ui-common_ui_*,vendors_ui_*and
subscriptionDetails_ui_*chunks load.
Related question: shared React variant
@clerk/react sets clerkUIVariant: "shared" for compatible React versions (ClerkProvider-GF8qvIpk.mjs:1536–1539),
and @clerk/ui ships dist/ui.shared.browser.js without its own React. The CDN loader in @clerk/shared 4.25.0
always requests dist/ui.browser.js (dist/loadClerkJsScript.js:141–149). We found no consumer of clerkUIVariant
in clerk.browser.js 6.41.0 or in ui.browser.js 1.25.0. As a result the CDN path always loads the variant with its
own React (framework_ui, ~43 KB). Is there a supported way to load the shared variant from the CDN, or is this
expected?
Thanks!
- 主要言語
- TypeScript
- スター
- 1.8k
- フォーク
- 492
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 374
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
clerk/javascript のほかの issue
-
<SignIn />: the reset password code step renders an empty, focusable back button with no accessible name対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
clerk/javascript#10708 ·
メンテナーはふだん 1 日以内に返信
-
Built-in reverification dialog lacks an accessible name (aria-dialog-name)対応中かも @ItsShivam05 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
clerk/javascript#10548 ·
メンテナーはふだん 1 日以内に返信
-
MFA enrollment QR SVG lacks an accessible name (svg-img-alt)対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
clerk/javascript#10547 ·
メンテナーはふだん 1 日以内に返信
-
<SignIn />: first "Use email" click switches back to phone when `initialValues.phoneNumber` is set対応中かも @twicestruck が 23 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
clerk/javascript#10487 ·
メンテナーはふだん 1 日以内に返信
-
useLoadedIsomorphicClerk misses "ready" when a ClerkProvider remounts after clerk-js has loaded — <ClerkLoading> never resolves再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
clerk/javascript#10462 ·
メンテナーはふだん 1 日以内に返信
clerk/javascript の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
milind-soni/OpenMausBot#6730 ·
メンテナーはふだん 1 日以内に返信
-
`@angular/[email protected]` depends on vulnerable Vite 7.3.7 - GHSA-p4f5-76q4-ffq7 (Critical RCE)オープンarea: @angular/build
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
angular/angular-cli#34764 ·
メンテナーはふだん 1 日以内に返信
-
status/need-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
google-gemini/gemini-cli#30384 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
P2
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
area:image documentation good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信