Skip to content

v2.0.0

Compare
Choose a tag to compare
@azjgard azjgard released this 09 Nov 18:49
· 187 commits to master since this release
f78a1fc

This is a new major version with breaking changes.

Breaking Changes

Output file structure

The way in which JSON files are written is now a function of how the variants and format options are configured. As specified in the latest README update:

  • If the variants and format options are unset, all data will be stored in a single file: text.json
  • If the variants option is true and the format option is unset, files will be written on a per-variant basis; base.json will contain all base (non-variant) text and all other files will follow the pattern [variant-api-id].json.
  • If the variants option is unset and the format open is flat or structured, files will be written on a per-project basis following the pattern [project-name].json.
  • If the variants option is true and the format option is flat or structured, files will be written on a per-project per-variant basis following the pattern [project-name__variant-api-id].json.

project-name used above represents a normalized version of the project's name in Ditto, where the name is lowercased and whitespace characters are replaced with hyphens.

structured and flat formats

When the structured or flat format is specified, the files that are written will not contain top-level keys that arbitrarily nest the data. These keys are legacy carryovers from when everything was written to a single file where the data needed to be separated by project.

Flat file examples

v1.1.1. (before):

{
  "projects": {
    "project_12345": {
      "key1": "value1",
      "key2": "value2",
      "key3": "value3"
    }
  }
}

v2.0.0 (now):

{
  "key1": "value1",
  "key2": "value2",
  "key3": "value3"
}

Empty variant files

Previously, if the variants option was specified, files (usually containing {}) were written for every variant in the workspace, independent of whether or not any of the specified projects had values for a given variant. Now, files will only be written for variants in the workspace that also have values for the specified projects -- no more empty files.

index.js driver file

The structure of the generated index.js is now always the same, independent of the CLI configuration used to generate it. This change is designed to reduce the amount of overhead required in the React SDK to support different CLI configurations.

We also added a warning to the README recommending against depending on this file, as its primary use case is to simplify CLI integration with other Ditto developer tools:
image

Other Changes

We made a handful of other low-impact miscellaneous bug fixes and stabilization improvements.