feat(AudienceEvaluator): Add the ability to provide custom condition evaluators#288
Merged
Merged
Conversation
rebase with latest audience editor changes updates per code review
0112ff9 to
2ff9d2e
Compare
lpappone
reviewed
Jun 7, 2019
| if (condition.type !== CUSTOM_ATTRIBUTE_CONDITION_TYPE) { | ||
| logger.log(LOG_LEVEL.WARNING, sprintf(LOG_MESSAGES.UNKNOWN_CONDITION_TYPE, MODULE_NAME, JSON.stringify(condition))); | ||
| return null; | ||
| } |
There was a problem hiding this comment.
delete? because we're handling this in typeToEvaluate - we only call this if there's a type.
mjc1283
reviewed
Jun 11, 2019
| * @constructor | ||
| */ | ||
| function AudienceEvaluator(logger, UNSTABLE_conditionEvaluators) { | ||
| this.logger = logger; |
Contributor
There was a problem hiding this comment.
Instead of passing logger, we can import a singleton logger and use it directly (example from project_config_manager)
Contributor
mikeproeng37
left a comment
There was a problem hiding this comment.
Mostly looks good. I just have a question.
| * @constructor | ||
| */ | ||
| function AudienceEvaluator(logger, UNSTABLE_conditionEvaluators) { | ||
| this.logger = logger; |
nchilada
suggested changes
Jun 13, 2019
Contributor
Summary
This PR (replacing #216) adds the ability for an SDK consumer to pass their own set of condition evaluators when creating an optimizely instance.
The core motivator for this is to be able to evaluate WEB audience conditions using the Javascript SDK as part of the EDGE project (go/edge).
Future fullstack use cases for this functionality might include audience condition plugins, where the customer would define their own match types and provide their own matchers.
Test plan
Fixed existing tests. May need to add more unit tests.
Issues
https://optimizely.atlassian.net/browse/CJS-3034