Skip to content

Conversation

@Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Sep 18, 2025

Closes #198

In this PR, we:

  • Add EvaluationResult getEvaluationResult(EvaluationContext context) and remove all of the old engine APIs.
  • Add support for JSONPath-enabled context values.
  • Add evaluationContext/mappers for engine-API data interop
  • Add script generate-engine-types to generate from flagsmith/sdk/evaluation-*-schema -> in pre-commit

Couple of questions concerning:

  • hide_disabled_flags deprecation => ready to remove the commented code
  • offlineHandler: It is wrapped between a wider getEnvironment that also includes getEnvironmentFromApi. I'm not seeing a huge value to migrate it but maybe I am missing something ? this would getEnvironmentFlagsFromDocument/getIdentityFlagsFromDocument -> getEnvironment -> this.offlineHandler.getEnvironment -> getEvaluationContext (using environment)
    Happy to change if misunderstood
    /**
     * Returns the current environment, fetching it from the API if needed.
     *
     * Calling this method concurrently while the environment is being fetched will not cause additional requests.
     */
    async getEnvironment(): Promise<EnvironmentModel> {
        if (this.offlineHandler) {
            return this.offlineHandler.getEnvironment();
        }
        if (this.environment) {
            return this.environment;
        }
        if (!this.environmentPromise) {
            this.environmentPromise = this.fetchEnvironment();
        }
        return this.environmentPromise;
    }

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner September 18, 2025 15:50
@Zaimwa9 Zaimwa9 requested review from khvn26 and removed request for a team September 18, 2025 15:50
@Zaimwa9 Zaimwa9 changed the title feat: implement context values [DRAFT] feat: implement context values Sep 18, 2025
@Zaimwa9 Zaimwa9 changed the title [DRAFT] feat: implement context values feat: implement context values Sep 19, 2025
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

In general, the PR looks solid to me — just a handful of comments to address.

Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

We're close... just one comment from my side to resolve.

gagantrivedi
gagantrivedi previously approved these changes Oct 21, 2025
Copy link
Member

@khvn26 khvn26 left a comment

Choose a reason for hiding this comment

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

LGTM

@Zaimwa9 Zaimwa9 merged commit fdf86bf into main Oct 22, 2025
3 checks passed
khvn26 added a commit that referenced this pull request Nov 4, 2025
khvn26 added a commit that referenced this pull request Nov 4, 2025
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.

Implement Context Values

4 participants