Skip to content

Conversation

@petruki
Copy link
Member

@petruki petruki commented Jul 4, 2025

This pull request introduces several updates across the codebase, including dependency upgrades, enhancements to the Cache class, and minor adjustments to test files for consistency. Below is a summary of the most important changes grouped by theme:

Dependency Updates

  • Upgraded mongoose to version 8.16.1, switcher-client to version 4.3.0, eslint to version 9.30.1, and jest to version 30.0.4 in package.json. These upgrades improve compatibility and address potential bugs.

Enhancements to the Cache Class

  • Refactored the Cache class to use a singleton pattern with a private #instance property. This ensures a single shared instance of the cache throughout the application.
  • Modified methods in the Cache class (#set, get, getAll) to use the private #instance property instead of a public cache property. This improves encapsulation and data security.

Test File Updates

  • Standardized comments in test files by changing comment prefixes (e.g., // Given, // Test) to lowercase (// given, // test, // mock) for consistency across all test cases. This change affects multiple test files, including client-api.test.js, component.test.js, relay.test.js, and unit-test/client/relay.test.js. [1] [2] [3] [4]
  • Updated unit tests for the Cache class to use the singleton instance (Cache.getInstance()) and added assertions to validate cache initialization.

These changes collectively improve the maintainability, consistency, and functionality of the codebase.

@petruki petruki added this to the v1.1.0 milestone Jul 4, 2025
@petruki petruki self-assigned this Jul 4, 2025
@petruki petruki added the enhancement New feature or request label Jul 4, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 4, 2025

@petruki petruki merged commit ba737bc into master Jul 4, 2025
5 checks passed
@petruki petruki deleted the staging branch July 4, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants