-
Notifications
You must be signed in to change notification settings - Fork 3
feat: move client-side config headers to client-sdk #211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This pull request has been linked to Shortcut Story #214574: Move client-side config bindings to dedicated folder. |
#include <launchdarkly/bindings/c/context_builder.h> | ||
#include <launchdarkly/client_side/bindings/c/config/builder.h> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This demonstrates the customer change necessary: append client_side
to the left of /bindings
.
@@ -0,0 +1,487 @@ | |||
/** @file */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly moving the old builder.h
to this new location. Log related config was removed and remains in common (<launchdarkly/bindings/c/config/logging_builder.h>
)
@@ -0,0 +1,27 @@ | |||
/** @file */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just moving the file from the old location.
@@ -43,21 +45,21 @@ add_library(${LIBNAME} | |||
flag_manager/flag_persistence.cpp | |||
bindings/c/sdk.cpp) | |||
|
|||
if(MSVC OR (NOT BUILD_SHARED_LIBS)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this got auto formatted.
|
||
// NOLINTEND modernize-use-using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are the messages.
} | ||
#endif | ||
|
||
// NOLINTEND modernize-use-using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More messages.
@@ -0,0 +1,134 @@ | |||
/** @file */ | |||
// NOLINTBEGIN modernize-use-using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was extracted out of sdk.h
. It can remain in common because it'll be shared by the client and server.
f75aabd
to
e545cec
Compare
This is the first in a series of PRs to re-organize the config related C bindings.
Why now?
We need the client and server SDKs to have different configs, because different options apply. At the same time, some config is sharable - such as loggers. The original 1.0 release of the client-side SDK mixed these concerns unintentionally.
This PR focuses on moving the client-side
LDClientConfig
andLDClientConfigBuilder
out ofcommon
and intoclient-sdk
.This should be backwards compatible enough for a minor release, with some callouts in the release notes. Although the header locations are moving, no symbol name or function/struct definition is changing.
For
config.h
:sdk.h
, we can change the path. Upgrade pain should be zero, unless a user has included it elsewhere in their application (withoutsdk.h
.)For
builder.h
:sdk.h
doesn't include theconfig_builder.h
, people would have had to manually include it. Those builds will now break because the header has moved.To ease this transition, I've kept stub headers in the original locations which log messages using
#pragma message
. They can't automatically include the new location headers because that'd introduce a circular dependency.Future work includes potentially renaming the sub-builders (such as
LDDataSourceStreamBuilder
) to include theClient
prefix (e.g.LDClientDataSourceStreamBuilder
).We could achieve this with some typedefs + forwarding functions in a backwards compatible manner.
BEGIN_COMMIT_OVERRIDE
refactor: move client-side config headers to client_side/config
END_COMMIT_OVERRIDE