2.0.0-rc.1
Pre-release[2.0.0-rc.1] - 2021-11-19
This is the first release candidate version of the LaunchDarkly client-side .NET SDK 2.0-- a major rewrite that introduces a cleaner API design, adds new features, and makes the SDK code easier to maintain and extend. See the Xamarin 1.x to client-side .NET 2.0 migration guide for an in-depth look at the changes in 2.0; the following is a summary.
The LaunchDarkly client-side .NET SDK was formerly known as the LaunchDarkly Xamarin SDK. Xamarin for Android and iOS are among its supported platforms, but it can also be used on any platform that supports .NET Core 2+, .NET Standard 2, or .NET 5+. On those platforms, it does not use any Xamarin-specific runtime libraries. To learn more about the distinction between the client-side .NET SDK and the server-side .NET SDK, read: Client-side and server-side SDKs
Added:
LdClient.FlagTracker
provides the ability to get notifications when flag values have changed.LdClient.DataSourceStatusProvider
provides information on the status of the SDK's data source (which normally means the streaming connection to the LaunchDarkly service).LdClient.DoubleVariation
andDoubleVariationDetail
return a numeric flag variation using double-precision floating-point.HttpConfigurationBuilder.UseReport
tells the SDK to make HTTPREPORT
requests rather thanGET
requests to the LaunchDarkly service endpoints, which may be desirable in rare circumstances but is not available on all platforms.ConfigurationBuilder.Persistence
andPersistenceConfigurationBuilder.MaxCachedUsers
allow setting a limit on how many users' flag data can be saved in persistent local storage, or turning off persistence.- The
LaunchDarkly.Sdk.Json
namespace provides methods for converting types likeUser
andFeatureFlagsState
to and from JSON. - The
LaunchDarkly.Sdk.UserAttribute
type provides a less error-prone way to refer to user attribute names in configuration, and can also be used to get an arbitrary attribute from a user. - The
LaunchDarkly.Sdk.UnixMillisecondTime
type provides convenience methods for converting to and from the Unix epoch millisecond time format that LaunchDarkly uses for all timestamp values. - The SDK now periodically sends diagnostic data to LaunchDarkly, describing the version and configuration of the SDK, the architecture and version of the runtime platform, and performance statistics. No credentials, hostnames, or other identifiable values are included. This behavior can be disabled with
ConfigurationBuilder.DiagnosticOptOut
or configured withConfigurationBuilder.DiagnosticRecordingInterval
.
Changed (requirements/dependencies/build):
- .NET Standard 1.6 is no longer supported.
- The SDK no longer has a dependency on
Common.Logging
. Instead, it uses a similar but simpler logging facade, theLaunchDarkly.Logging
package, which has adapters for various logging destinations. - The SDK no longer has a dependency on the Json.NET library (a.k.a.
Newtonsoft.Json
), but instead uses a lightweight custom JSON serializer and deserializer. This removes the potential for dependency version conflicts in applications that use Json.NET for their own purposes, and reduces the number of dependencies in applications that do not use Json.NET. If you do use Json.NET and you want to use it with SDK data types likeUser
andLdValue
, seeLaunchDarkly.CommonSdk.JsonNet
. Those types also serialize/deserialize correctly with theSystem.Text.Json
API on platforms where that API is available.
Changed (API changes):
- The base namespace has changed: types that were previously in
LaunchDarkly.Client
are now inLaunchDarkly.Sdk
, and types that were previously inLaunchDarkly.Xamarin
are now inLaunchDarkly.Sdk.Client
. TheLaunchDarkly.Sdk
namespace contains types that are not specific to the client-side .NET SDK (that is, they are also used by the server-side .NET SDK):EvaluationDetail
,LdValue
,User
, andUserBuilder
. Types that are specific to the client-side .NET SDK, such asConfiguration
andLdClient
, are inLaunchDarkly.Sdk.Client
. User
andConfiguration
objects are now immutable. To specify properties for these classes, you must now useUser.Builder
andConfiguration.Builder
.Configuration.Builder
now returns a concrete type rather than an interface.EvaluationDetail
is now a struct type rather than a class.EvaluationReason
is now a single struct type rather than a base class with subclasses.EvaluationReasonKind
andEvaluationErrorKind
constants now use .Net-style naming (RuleMatch
) rather than Java-style naming (RULE_MATCH
). Their JSON representations are unchanged.- The
ILdClient
interface is now inLaunchDarkly.Sdk.Client.Interfaces
instead of the main namespace. - The
ILdClientExtensions
methodsEnumVariation<T>
andEnumVariationDetail<T>
now have type constraints to enforce thatT
really is anenum
type.
Changed (behavioral changes):
- The default event flush interval is now 30 seconds on mobile platforms, instead of 5 seconds. This is consistent with the other mobile SDKs and is intended to reduce network traffic.
- Logging now uses a simpler, more stable set of logger names instead of using the names of specific implementation classes that are subject to change. General messages are logged under
LaunchDarkly.Sdk.Xamarin.LdClient
, while messages about specific areas of functionality are logged under that name plus.DataSource
(streaming, polling, file data, etc.),.DataStore
(database integrations),.Evaluation
(unexpected errors during flag evaluations), or.Events
(analytics event processing).
Fixed:
- The SDK was deciding whether to send analytics events based on the
Offline
property of the original SDK configuration, rather than whether the SDK is currently in offline mode or not.
Removed:
- All types and methods that were shown as deprecated/
Obsolete
in the last 1.x release have been removed.