Skip to content

Conversation

@joker23
Copy link

@joker23 joker23 commented Dec 19, 2025

Description

This change will update the LD Browser SDK to major version 4. I am marking it as a breaking change due to having to do a major version bump on a key dependency, but this change has been tested with Browser SDK 3.9.0.

What does this PR do?

  • Replaced instances of 'launchdarkly-js-client-sdk' with '@launchdarkly/js-client-sdk' across various files.
  • Updated package.json files in demo and toolbar to include the new SDK version.
  • Adjusted imports in several components to align with the new SDK structure.
  • Ensured compatibility with existing code by handling type mismatches where necessary.
  • Changed import paths in test files to reflect the new SDK structure.
  • Updated mock implementations to align with the new SDK methods.
  • Ensured compatibility with existing tests by adjusting mock behavior.
  • Added new compat interfaces so that toolbar could recognize browser v3 and v4 clients.
  • Changed import paths to use '@launchdarkly/toolbar' and updated related types.

Caveats

  • Eventually we should probably provide this compat layer in the browser SDK code itself.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation (changes to documentation only)
  • 🔧 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🎨 Style (formatting, missing semicolons, etc; no production code change)
  • Performance (code change that improves performance)
  • Test (adding missing tests, refactoring tests; no production code change)
  • 🔨 Chore (updating grunt tasks, build process, etc; no production code change)

Screenshots/Videos


@joker23 joker23 force-pushed the skz/sdk-1565/update-browser-sdk branch from 433d561 to 5d0f08d Compare December 19, 2025 00:40
@joker23 joker23 force-pushed the skz/sdk-1565/update-browser-sdk branch from 5d0f08d to 8402b84 Compare December 22, 2025 16:51

// Subscribe to changes with incremental updates
const handleChange = (changes: Record<string, { current: any }>) => {
// NOTE: we are overloading this function so that it can handle both the old and new browser SDKs
Copy link
Author

Choose a reason for hiding this comment

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

REVIEWER: we'll need to make sure we make super clear what is going on here. Am open to suggestions on what is more standard practice to support different event payloads.

@joker23 joker23 force-pushed the skz/sdk-1565/update-browser-sdk branch 3 times, most recently from c9348ce to e6738af Compare December 24, 2025 15:49
….11.0

- Replaced instances of 'launchdarkly-js-client-sdk' with '@launchdarkly/js-client-sdk' across various files.
- Updated package.json files in demo and toolbar to include the new SDK version.
- Adjusted imports in several components to align with the new SDK structure.
- Ensured compatibility with existing code by handling type mismatches where necessary.
- Changed import paths in test files to reflect the new SDK structure.
- Updated mock implementations to align with the new SDK methods.
- Ensured compatibility with existing tests by adjusting mock behavior.
@joker23 joker23 force-pushed the skz/sdk-1565/update-browser-sdk branch from e6738af to 0bd4867 Compare January 7, 2026 22:41
- Added new compat interfaces so that toolbar could recognize browser v3 and v4 clients.
- Changed import paths to use '@launchdarkly/toolbar' and updated related types.

> Eventually we should probably provide this compat layer in the browser SDK code itself.
@joker23 joker23 force-pushed the skz/sdk-1565/update-browser-sdk branch from 0bd4867 to df4936a Compare January 7, 2026 23:01
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.

2 participants