@atlaskit/tmp-editor-statsig 5.14.0 → 5.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
+ ## 5.14.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#167332](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/167332)
8
+ [`5d312dcfaa21a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d312dcfaa21a) -
9
+ Fix expValEquals should work when FeatureGate client is not initialised
10
+
3
11
  ## 5.14.0
4
12
 
5
13
  ### Minor Changes
@@ -30,6 +30,11 @@ function expValEqualsInternal(experimentName, experimentParam, experimentExpecte
30
30
  return _setup._overrides[experimentName] === experimentExpectedValue;
31
31
  }
32
32
 
33
+ // If client is not initialized, we compare with the default value
34
+ if (!_featureGateJsClient.default.initializeCompleted()) {
35
+ return experimentDefaultValue === experimentExpectedValue;
36
+ }
37
+
33
38
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
34
39
  var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, experimentParam, experimentDefaultValue, {
35
40
  fireExperimentExposure: experimentExposure
@@ -56,9 +56,9 @@ var _setup = require("./setup");
56
56
  *
57
57
  * @private
58
58
  * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
59
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
60
- * It also closely aligns with similar utilities in other Atlassian products.
61
- * For no expisure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
59
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
60
+ * It also closely aligns with similar utilities in other Atlassian products.
61
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
62
62
  */
63
63
  function editorExperiment(experimentName, expectedExperimentValue) {
64
64
  var _experimentConfig$pro;
@@ -24,6 +24,11 @@ export function expValEqualsInternal(experimentName, experimentParam, experiment
24
24
  return _overrides[experimentName] === experimentExpectedValue;
25
25
  }
26
26
 
27
+ // If client is not initialized, we compare with the default value
28
+ if (!FeatureGates.initializeCompleted()) {
29
+ return experimentDefaultValue === experimentExpectedValue;
30
+ }
31
+
27
32
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
28
33
  const experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, experimentDefaultValue, {
29
34
  fireExperimentExposure: experimentExposure
@@ -49,9 +49,9 @@ import { _overrides, _paramOverrides, _product } from './setup';
49
49
  *
50
50
  * @private
51
51
  * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
52
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
53
- * It also closely aligns with similar utilities in other Atlassian products.
54
- * For no expisure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
52
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
53
+ * It also closely aligns with similar utilities in other Atlassian products.
54
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
55
55
  */
56
56
  export function editorExperiment(experimentName, expectedExperimentValue, options = {
57
57
  exposure: false
@@ -24,6 +24,11 @@ export function expValEqualsInternal(experimentName, experimentParam, experiment
24
24
  return _overrides[experimentName] === experimentExpectedValue;
25
25
  }
26
26
 
27
+ // If client is not initialized, we compare with the default value
28
+ if (!FeatureGates.initializeCompleted()) {
29
+ return experimentDefaultValue === experimentExpectedValue;
30
+ }
31
+
27
32
  // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
28
33
  var experimentValue = FeatureGates.getExperimentValue(experimentName, experimentParam, experimentDefaultValue, {
29
34
  fireExperimentExposure: experimentExposure
@@ -49,9 +49,9 @@ import { _overrides, _paramOverrides, _product } from './setup';
49
49
  *
50
50
  * @private
51
51
  * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
52
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
53
- * It also closely aligns with similar utilities in other Atlassian products.
54
- * For no expisure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
52
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
53
+ * It also closely aligns with similar utilities in other Atlassian products.
54
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
55
55
  */
56
56
  export function editorExperiment(experimentName, expectedExperimentValue) {
57
57
  var _experimentConfig$pro;
@@ -43,9 +43,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
43
43
  *
44
44
  * @private
45
45
  * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
46
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
47
- * It also closely aligns with similar utilities in other Atlassian products.
48
- * For no expisure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
46
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
47
+ * It also closely aligns with similar utilities in other Atlassian products.
48
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
49
49
  */
50
50
  export declare function editorExperiment<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, expectedExperimentValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], options?: {
51
51
  exposure: boolean;
@@ -43,9 +43,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
43
43
  *
44
44
  * @private
45
45
  * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
46
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
47
- * It also closely aligns with similar utilities in other Atlassian products.
48
- * For no expisure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
46
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
47
+ * It also closely aligns with similar utilities in other Atlassian products.
48
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
49
49
  */
50
50
  export declare function editorExperiment<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, expectedExperimentValue: EditorExperimentsConfig[ExperimentName]['defaultValue'], options?: {
51
51
  exposure: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "5.14.0",
3
+ "version": "5.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",