Skip to content

Conversation

@saas817
Copy link
Contributor

@saas817 saas817 commented Dec 11, 2025

Fixes #5

Changes

Group Operators - $inGroup / $notInGroup

  • Implement $inGroup and $notInGroup operators for saved group targeting
  • Add savedGroups configuration parameter
  • Enables beta tester targeting, VIP features, employee access, block lists

Deep Object/Array Equality

  • Implement _deepEqual() recursive comparison function
  • Handle nested objects, arrays, and primitives with proper null/undefined handling

$elemMatch Enhancements

  • Refactor for both primitive and object arrays
  • Optimize instance reuse for better performance with large arrays

Logical Operator Fixes

  • Fix top-level logical operator handling (AND logic between conditions)
  • Implement $not as attribute operator
  • Fix $or with multiple conditions edge case
  • Add unknown operator detection (return false for typos like $regx)

JavaScript Validator Enhancements

  • Implement full evalFeature() for end-to-end feature testing
  • Add force rule coverage, ranges, filters support
  • Add prerequisites with cycle detection
  • Add passthrough variations and forcedVariations support
  • Test coverage: 84.7% → 99.7% (261/308 → 307/308 tests passing)

Prerequisites Support

  • Add parentConditions handling in evalFeature with cycle detection

Async API Loading

  • Refactor _loadFeaturesFromAPI to non-blocking pattern with roMessagePort

Documentation

  • Update CHANGELOG, README, API.md, TESTING.md with v1.2.0
  • Document $inGroup, $notInGroup, savedGroups parameter
  • Add JavaScript validator test results

Working Examples

  • Add group_targeting.brs demonstrating savedGroups and group operators
  • Add complex_conditions.brs for $elemMatch and deep equality

Testing

  • ✅ Syntax validated (no linter errors)
  • ✅ evalCondition tests: 220/221 (99.5%)
  • ✅ hash tests: 15/15 (100%)
  • ✅ getBucketRange tests: 13/13 (100%)
  • ✅ chooseVariation tests: 13/13 (100%)
  • ✅ feature tests: 46/46 (100%)
  • ✅ Cross-SDK parity confirmed

Checklist

  • Follows code style guidelines
  • Clear commit messages
  • All features complete
  • Working examples complete
  • Documentation complete
  • Cross-SDK parity verified

@madhuchavva
Copy link
Collaborator

@saas817 it looks like the validator script is updated to include support for parentConditions (Prerequisites) but the source/GrowthBook.brs doesn't appear to have the corresponding logic added to evalFeature.

For $elemMatch, the SDK now creates a new GrowthBook({...}) instance for every item in an array being evaluated. If a user has an array with hundreds of items (e.g., watchHistory), this could trigger significant object creation overhead in BrightScript's single-threaded environment. Is there a way we could optimize it?

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.

BrightScript testing and missing group operators

2 participants