feat(core): expose createFlagEvaluationEndpointBuilder for external SDK packages#4528
Closed
typotter wants to merge 2 commits into
Closed
feat(core): expose createFlagEvaluationEndpointBuilder for external SDK packages#4528typotter wants to merge 2 commits into
typotter wants to merge 2 commits into
Conversation
External packages like @datadog/openfeature-browser need to build intake endpoint URLs for the flagevaluation track. Rather than exporting the generic createEndpointBuilder (which leaks TrackType), expose a purpose-specific wrapper so callers have a stable, narrowly-scoped API.
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 4a5b386 | Docs | Datadog PR Page | Give us feedback! |
Contributor
Author
|
Closing — investigation revealed flagEvaluationEndpointBuilder is already part of TransportConfiguration (since PR #3976) and available via validateAndBuildConfiguration. The explicit createEndpointBuilder call in openfeature-js-client was dead code overridden by ...baseConfiguration spread. No new public API needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
External packages (specifically
@datadog/openfeature-browserin DataDog/openfeature-js-client) need to build intake endpoint URLs for theflagevaluationtrack type. Currently there is no public API for this — the package resorts to a deep private subpath import (@datadog/browser-core/cjs/domain/configuration) to accesscreateEndpointBuilderdirectly.Solution
Add a purpose-specific public wrapper
createFlagEvaluationEndpointBuilderinstead of exporting the genericcreateEndpointBuilder.This approach:
TrackTypeand the'flagevaluation'literal from external callerscreateEndpointBuilderandTrackTypeoff the public surface of@datadog/browser-coreChanges
packages/core/src/domain/configuration/endpointBuilder.tsTrackTypeto reference the new public functioncreateFlagEvaluationEndpointBuilderas an exported functionpackages/core/src/domain/configuration/index.tscreateFlagEvaluationEndpointBuilderto the internal barrelpackages/core/src/index.tscreateFlagEvaluationEndpointBuilderto public exportscreateEndpointBuilderandTrackTypefrom public exports (kept internal)EndpointBuildertype remains exported so consumers can annotate variablesNotes
@datadog/openfeature-browserto use this function instead of the deep subpath import.createEndpointBuilderandTrackTyperemain available from the internal barrel for use by other packages in this repo.