You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: openfeature-provider/cloudflare/PLAN.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,6 +197,36 @@ No WASM dependency, no proto generation — this stage is fast and self-containe
197
197
198
198
No `@bufbuild/protobuf`, no `debug`, no React/Next.js. The package is tiny.
199
199
200
+
## Future: Unified provider with pluggable resolver
201
+
202
+
The shared code extraction in PR 1 and the CF provider in PR 2 are stepping stones toward a single `ConfidenceProvider` with a pluggable `Resolver` interface:
|`RemoteResolver`| HTTP to `resolver.confidence.dev`| Simple setups, low-volume backends |
219
+
220
+
**What this PR already does toward that goal:**
221
+
-`js-shared/flag-bundle.ts` extracts the shared `FlagBundle` type and `resolve()`/`evaluateAssignment()` — this becomes the contract between provider and resolver
222
+
- The CF provider's `evaluate()` method is essentially the unified provider pattern already (FlagBundle in, ResolutionDetails out)
223
+
224
+
**What a follow-up would need to change:**
225
+
-**Refactor `ConfidenceServerProviderLocal`** — move state polling, log flushing, materialization orchestration, and WASM lifecycle out of the provider class and into a `LocalResolver` implementation. This is the bulk of the work (~400 LOC moves from provider to resolver).
226
+
-**Extract the provider shell** — the ~50 LOC of OpenFeature glue (`evaluate()`, `resolveBooleanEvaluation()`, etc.) becomes the shared `ConfidenceProvider` class.
227
+
-**Unify `FlagBundle` creation** — each resolver normalizes its response format (protobuf, JSON, etc.) to `FlagBundle` internally, so the provider never sees protocol-specific types.
228
+
-**Package consolidation** — either merge into one package with entry points (`/local`, `/cloudflare`, `/remote`) or keep a core + resolver packages. A single package with entry points is simpler but means renaming from `@spotify-confidence/openfeature-server-provider-local` (breaking change). Separate resolver packages avoid the rename but add maintenance surface.
0 commit comments