Skip to content

feat: removed data attribute from snapshot#96

Merged
petruki merged 1 commit intomasterfrom
staging
Oct 7, 2025
Merged

feat: removed data attribute from snapshot#96
petruki merged 1 commit intomasterfrom
staging

Conversation

@petruki
Copy link
Member

@petruki petruki commented Oct 7, 2025

This pull request updates the Switcher Client SDK for Deno to version 2.4.0 and refactors how snapshot data is handled throughout the codebase. The main change is the removal of the extra data property wrapper from snapshot objects, which simplifies the structure and usage of snapshots across the SDK. The changes affect core logic, tests, and configuration files.

Snapshot Structure Refactor

  • Removed the redundant data property from all snapshot objects, so snapshots now directly contain the domain property. This change is reflected across core files such as src/client.ts, src/lib/remote.ts, src/lib/resolver.ts, and src/lib/snapshot.ts, as well as all test and example snapshot JSON files. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Core Logic Updates

  • Updated all references to snapshot data in the client and resolver logic to use the new structure (snapshot.domain instead of snapshot.data.domain). This affects methods for accessing the snapshot version, checking snapshot availability, resolving criteria, and validating switchers. [1] [2] [3] [4]

Type and Interface Changes

  • Updated TypeScript type imports and usages to reflect the new direct Domain structure, removing references to SnapshotData and ensuring all functions and types use Domain as the main snapshot data type. [1] [2]

Breaking change

Snapshot content before:

{
   "data": {
        "domain": {
            "name": "switcher-domain",
            "activated": true,
            "group": [...]
        }
    }
}

Snapshot content now:

{
    "domain": {
        "name": "switcher-domain",
        "activated": true,
        "group": [...]
    }
}

@petruki petruki added this to the v2.4.0 milestone Oct 7, 2025
@petruki petruki self-assigned this Oct 7, 2025
@petruki petruki added the enhancement New feature or request label Oct 7, 2025
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

@petruki petruki merged commit 5c58255 into master Oct 7, 2025
7 checks passed
@petruki petruki deleted the staging branch October 7, 2025 03:34
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.

1 participant