fix(electron,shared,ui): keep Clerk navigation inside the Electron renderer - #9529
fix(electron,shared,ui): keep Clerk navigation inside the Electron renderer#9529jeremy-clerk wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 5fac41b The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Disabled knowledge base sources:
📝 WalkthroughWalkthroughElectron Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: Comment |
API Changes Report
Summary
@clerk/sharedCurrent version: 4.29.3 Subpath
|
Description
When an Electron app supplied no
routerPush/routerReplace, clerk-js fell back to awindow.locationnavigation. Additional sign-in/up steps target the internal component router(
/CLERK-ROUTER/VIRTUAL/...), and a renderer served from a custom scheme would often result in navigation reloading the whole renderer, unmounting Clerk and breaking the auth flow.This PR makes
ClerkProvideralways supply arouterPush/routerReplace:host navigation, preserving current behavior for apps that supply no router.
isVirtualRouterPathmoves to@clerk/sharedso@clerk/electronand@clerk/uishare onedefinition;
@clerk/uire-exportsVIRTUAL_ROUTER_BASE_PATHunchanged.The
electron-viteintegration template passed no-op router functions to work around this, whichalso swallowed real destinations. Those are removed, and the suite now asserts that no
clerk:beforeunloadfires during sign-in, as that event is dispatched immediately before clerk-jsassigns
window.location.Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change