@atlaskit/tmp-editor-statsig 4.14.0 → 4.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 4.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#145233](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145233)
8
+ [`bc70a53def230`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc70a53def230) -
9
+ Revert nullability checks on experiments package.
10
+
3
11
  ## 4.14.0
4
12
 
5
13
  ### Minor Changes
@@ -64,9 +64,15 @@ function editorExperiment(experimentName, expectedExperimentValue) {
64
64
  // This will be hit in the case of a test setting an override
65
65
  return _setup._overrides[experimentName] === expectedExperimentValue;
66
66
  }
67
+ if (experimentConfig === undefined) {
68
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
69
+ // it can cause the editor to crash here or if the experiment does not exist.
70
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
71
+ throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
72
+ }
67
73
  if (!_setup._product) {
68
74
  // This will be hit in the case of a product not having setup the editor experiment tooling
69
- return (experimentConfig === null || experimentConfig === void 0 ? void 0 : experimentConfig.defaultValue) === expectedExperimentValue;
75
+ return experimentConfig.defaultValue === expectedExperimentValue;
70
76
  }
71
77
 
72
78
  // Typescript is complaining here about accessing the productKeys property
@@ -56,9 +56,15 @@ export function editorExperiment(experimentName, expectedExperimentValue, option
56
56
  // This will be hit in the case of a test setting an override
57
57
  return _overrides[experimentName] === expectedExperimentValue;
58
58
  }
59
+ if (experimentConfig === undefined) {
60
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
61
+ // it can cause the editor to crash here or if the experiment does not exist.
62
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
63
+ throw new Error(`Editor experiment configuration is not defined ${experimentName}. Likely the experiment does not exist or editor package versions are misaligned`);
64
+ }
59
65
  if (!_product) {
60
66
  // This will be hit in the case of a product not having setup the editor experiment tooling
61
- return (experimentConfig === null || experimentConfig === void 0 ? void 0 : experimentConfig.defaultValue) === expectedExperimentValue;
67
+ return experimentConfig.defaultValue === expectedExperimentValue;
62
68
  }
63
69
 
64
70
  // Typescript is complaining here about accessing the productKeys property
@@ -57,9 +57,15 @@ export function editorExperiment(experimentName, expectedExperimentValue) {
57
57
  // This will be hit in the case of a test setting an override
58
58
  return _overrides[experimentName] === expectedExperimentValue;
59
59
  }
60
+ if (experimentConfig === undefined) {
61
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
62
+ // it can cause the editor to crash here or if the experiment does not exist.
63
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
64
+ throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
65
+ }
60
66
  if (!_product) {
61
67
  // This will be hit in the case of a product not having setup the editor experiment tooling
62
- return (experimentConfig === null || experimentConfig === void 0 ? void 0 : experimentConfig.defaultValue) === expectedExperimentValue;
68
+ return experimentConfig.defaultValue === expectedExperimentValue;
63
69
  }
64
70
 
65
71
  // Typescript is complaining here about accessing the productKeys property
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "4.14.0",
3
+ "version": "4.14.1",
4
4
  "description": "Temp plugin to ease use of statsig feature flags until platform feature flags are available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",