Skip to content

Comments

chore(electron): add renderer implementation#1110

Open
joker23 wants to merge 2 commits intomainfrom
skz/electron-renderer-impl
Open

chore(electron): add renderer implementation#1110
joker23 wants to merge 2 commits intomainfrom
skz/electron-renderer-impl

Conversation

@joker23
Copy link
Contributor

@joker23 joker23 commented Feb 18, 2026

This PR will add in the renderer implementation. There is an example of how this is used in https://github.com/launchdarkly/js-core/tree/skz/electron-sdk-next/packages/sdk/electron/example

with the change from initInRenderer -> createRendererClient.


Note

Medium Risk
Touches cross-process IPC wiring and event subscription lifecycle/cleanup; failures could cause leaked ports/listeners or missing renderer updates, though coverage is strong and changes are largely additive.

Overview
Adds a full renderer-to-main IPC bridge for the Electron SDK. The main-process ElectronClient now registers ipcMain handlers for all flag/identify/flush/connection-mode APIs and supports renderer event subscriptions via MessagePort broadcasting, including cleanup on close() and a guard for add/remove ordering races.

Introduces the preload bridge (src/bridge) that exposes window.ldClientBridge and a new renderer client (createRendererClient / ElectronRendererClient) that delegates all calls over IPC and implements handle-based on()/off() subscription management with automatic teardown on close().

Includes small robustness/docs updates (safer ElectronDataManager start, typo fixes, updated IPC docs) and adds comprehensive Jest tests covering IPC calls, event subscription behavior, and resource cleanup.

Written by Cursor Bugbot for commit c552382. This will update automatically on new commits. Configure here.

@joker23 joker23 requested a review from a team as a code owner February 18, 2026 23:25
@github-actions
Copy link
Contributor

@launchdarkly/js-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 25394 bytes
Compressed size limit: 26000
Uncompressed size: 124693 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk size report
This is the brotli compressed size of the ESM build.
Compressed size: 23336 bytes
Compressed size limit: 25000
Uncompressed size: 81070 bytes

@github-actions
Copy link
Contributor

@launchdarkly/browser size report
This is the brotli compressed size of the ESM build.
Compressed size: 171507 bytes
Compressed size limit: 200000
Uncompressed size: 798175 bytes

@github-actions
Copy link
Contributor

@launchdarkly/js-client-sdk-common size report
This is the brotli compressed size of the ESM build.
Compressed size: 19331 bytes
Compressed size limit: 20000
Uncompressed size: 99578 bytes

@joker23 joker23 force-pushed the skz/electron-renderer-impl branch from 4b3ecc3 to 4c90a3a Compare February 18, 2026 23:27
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

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.

1 participant