@atlaskit/tmp-editor-statsig 147.1.0 → 148.1.0

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/dist/cjs/create-boolean-experiment.js +20 -0
  3. package/dist/cjs/{experiment-builders.js → create-multivariate-experiment.js} +2 -13
  4. package/dist/cjs/editor-experiment.js +107 -0
  5. package/dist/cjs/exp-val-equals-internal.js +0 -2
  6. package/dist/cjs/exp-val-no-exposure.js +15 -0
  7. package/dist/cjs/exp-val.js +31 -0
  8. package/dist/cjs/expVal.js +29 -51
  9. package/dist/cjs/experiments-config.js +298 -305
  10. package/dist/cjs/experiments.js +12 -129
  11. package/dist/cjs/is-boolean.js +9 -0
  12. package/dist/cjs/one-of.js +20 -0
  13. package/dist/cjs/setup.js +0 -1
  14. package/dist/cjs/type-guards.js +1 -27
  15. package/dist/cjs/unstable-editor-experiment-param.js +37 -0
  16. package/dist/es2019/create-boolean-experiment.js +11 -0
  17. package/dist/es2019/{experiment-builders.js → create-multivariate-experiment.js} +1 -12
  18. package/dist/es2019/editor-experiment.js +100 -0
  19. package/dist/es2019/exp-val-equals-internal.js +0 -2
  20. package/dist/es2019/exp-val-no-exposure.js +9 -0
  21. package/dist/es2019/exp-val.js +26 -0
  22. package/dist/es2019/expVal.js +11 -46
  23. package/dist/es2019/experiments-config.js +2 -9
  24. package/dist/es2019/experiments.js +5 -121
  25. package/dist/es2019/is-boolean.js +3 -0
  26. package/dist/es2019/one-of.js +14 -0
  27. package/dist/es2019/setup.js +0 -1
  28. package/dist/es2019/type-guards.js +0 -20
  29. package/dist/es2019/unstable-editor-experiment-param.js +31 -0
  30. package/dist/esm/create-boolean-experiment.js +13 -0
  31. package/dist/esm/{experiment-builders.js → create-multivariate-experiment.js} +1 -11
  32. package/dist/esm/editor-experiment.js +101 -0
  33. package/dist/esm/exp-val-equals-internal.js +0 -2
  34. package/dist/esm/exp-val-no-exposure.js +9 -0
  35. package/dist/esm/exp-val.js +26 -0
  36. package/dist/esm/expVal.js +11 -46
  37. package/dist/esm/experiments-config.js +2 -9
  38. package/dist/esm/experiments.js +5 -122
  39. package/dist/esm/is-boolean.js +3 -0
  40. package/dist/esm/one-of.js +14 -0
  41. package/dist/esm/setup.js +0 -1
  42. package/dist/esm/type-guards.js +0 -20
  43. package/dist/esm/unstable-editor-experiment-param.js +31 -0
  44. package/dist/types/create-boolean-experiment.d.ts +11 -0
  45. package/dist/types/create-multivariate-experiment.d.ts +11 -0
  46. package/dist/types/editor-experiment.d.ts +52 -0
  47. package/dist/types/exp-val-no-exposure.d.ts +2 -0
  48. package/dist/types/exp-val.d.ts +18 -0
  49. package/dist/types/expVal.d.ts +11 -26
  50. package/dist/types/experiments-config.d.ts +1 -7
  51. package/dist/types/experiments.d.ts +4 -63
  52. package/dist/types/is-boolean.d.ts +1 -0
  53. package/dist/types/one-of.d.ts +1 -0
  54. package/dist/types/type-guards.d.ts +8 -2
  55. package/dist/types/unstable-editor-experiment-param.d.ts +15 -0
  56. package/package.json +2 -2
  57. package/dist/types/experiment-builders.d.ts +0 -21
@@ -1,136 +1,19 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.editorExperiment = editorExperiment;
8
- exports.unstable_editorExperimentParam = unstable_editorExperimentParam;
9
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
10
- var _featureFlagsAccessed = require("@atlaskit/react-ufo/feature-flags-accessed");
11
- var _experimentsConfig = require("./experiments-config");
12
- var _setup = require("./setup");
13
- /* eslint-disable @atlaskit/editor/no-re-export */
14
- // Entry file in package.json
15
-
16
- /**
17
- * Check the value of an editor experiment.
18
- *
19
- * Note: By default this will not fire an [exposure event](https://hello.atlassian.net/wiki/spaces/~732385844/pages/3187295823/Exposure+Events+101).
20
- *
21
- * You need explicitly call it using the exposure property when you need an exposure event to be fired (all experiments should fire exposure events).
22
- *
23
- * @example Boolean experiment
24
- * ```ts
25
- * if (editorExperiment('example-boolean', true)) {
26
- * // Run code for on variant
27
- * } else {
28
- * // Run code for off variant
29
- * }
30
- * ```
31
- *
32
- * @example Multivariate experiment
33
- * ```ts
34
- * switch (true) {
35
- * case editorExperiment('example-multivariate', 'one'):
36
- * // Run code for variant one
37
- * break;
38
- * case editorExperiment('example-multivariate', 'two'):
39
- * // Run code for variant two
40
- * break;
41
- * case editorExperiment('example-multivariate', 'three'):
42
- * // Run code for variant three
43
- * break;
44
- * }
45
- * }
46
- *```
47
-
48
- @example Experiment with exposure event
49
- * ```ts
50
- * // Inside feature surface where either the control or variant should be shown
51
- * if (editorExperiment('example-boolean', true, { exposure: true })) {
52
- * // Run code for on variant
53
- * } else {
54
- * // Run code for off variant
55
- * }
56
- * ```
57
- *
58
- * @private
59
- * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
60
- * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
61
- * It also closely aligns with similar utilities in other Atlassian products.
62
- * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
63
- */
64
- function editorExperiment(experimentName, expectedExperimentValue) {
65
- var _experimentConfig$pro;
66
- var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
67
- exposure: false
68
- };
69
- var experimentConfig = _experimentsConfig.editorExperimentsConfig[experimentName];
70
- if (_setup._overrides[experimentName] !== undefined) {
71
- // This will be hit in the case of a test setting an override
72
- return _setup._overrides[experimentName] === expectedExperimentValue;
73
- }
74
- if (experimentConfig === undefined) {
75
- // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
76
- // it can cause the editor to crash here or if the experiment does not exist.
77
- // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
78
- throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
79
- }
80
- if (!_setup._product) {
81
- // This will be hit in the case of a product not having setup the editor experiment tooling
82
- return experimentConfig.defaultValue === expectedExperimentValue;
83
- }
84
-
85
- // Typescript is complaining here about accessing the productKeys property
86
- // Ignored via go/ees005
87
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
88
- var experimentKey = experimentConfig === null || experimentConfig === void 0 || (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_setup._product];
89
- if (!experimentKey) {
90
- var _editorExperimentsCon;
91
- // This will be hit in the case of an experiment not being set up for the product
92
- return ((_editorExperimentsCon = _experimentsConfig.editorExperimentsConfig[experimentName]) === null || _editorExperimentsCon === void 0 ? void 0 : _editorExperimentsCon.defaultValue) === expectedExperimentValue;
93
- }
94
-
95
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
96
- var experimentValue = _featureGateJsClient.default.getExperimentValue(
97
- // @ts-ignore
98
- experimentKey, experimentConfig.param, experimentConfig.defaultValue, {
99
- typeGuard: experimentConfig.typeGuard,
100
- fireExperimentExposure: options.exposure
101
- });
102
- if (
103
- // When cleaning this gate up -- `calling where the experiments have the product key set`
104
- // in __tests__/experiments should be updated (as it's had the count bumped to include these).
105
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
106
- _featureGateJsClient.default.getExperimentValue('cc_editor_experiments_ufo_gate_reporting', 'isEnabled', false)) {
107
- (0, _featureFlagsAccessed.addFeatureFlagAccessed)("".concat(experimentName, ":").concat(experimentConfig.param), experimentValue);
6
+ Object.defineProperty(exports, "editorExperiment", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _editorExperiment.editorExperiment;
108
10
  }
109
- return expectedExperimentValue === experimentValue;
110
- }
111
-
112
- // eslint-disable-next-line @typescript-eslint/no-empty-object-type
113
-
114
- /**
115
- * @warning This currently lacks type safety on the param names and return values
116
- * and has limited associated test tooling.
117
- *
118
- * It also only works for experiments where the key matches the productKey used.
119
- *
120
- * The typeguard and default value is also expected to move to the experiment config
121
- */
122
- function unstable_editorExperimentParam(experimentName, paramName, options) {
123
- var _paramOverrides$exper, _options$exposure;
124
- if (((_paramOverrides$exper = _setup._paramOverrides[experimentName]) === null || _paramOverrides$exper === void 0 ? void 0 : _paramOverrides$exper[paramName]) !== undefined) {
125
- // This will be hit in the case of a test setting an override
126
-
127
- return _setup._paramOverrides[experimentName][paramName];
11
+ });
12
+ Object.defineProperty(exports, "unstable_editorExperimentParam", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _unstableEditorExperimentParam.unstable_editorExperimentParam;
128
16
  }
129
-
130
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
131
- var experimentValue = _featureGateJsClient.default.getExperimentValue(experimentName, paramName, options.defaultValue, {
132
- typeGuard: options.typeGuard,
133
- fireExperimentExposure: (_options$exposure = options.exposure) !== null && _options$exposure !== void 0 ? _options$exposure : false
134
- });
135
- return experimentValue;
136
- }
17
+ });
18
+ var _editorExperiment = require("./editor-experiment");
19
+ var _unstableEditorExperimentParam = require("./unstable-editor-experiment-param");
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isBoolean = isBoolean;
7
+ function isBoolean(value) {
8
+ return typeof value === 'boolean';
9
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.oneOf = oneOf;
7
+ var _process, _process2;
8
+ var IS_TESTING_ENV = typeof process !== 'undefined' && (((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) === 'test' || ((_process2 = process) === null || _process2 === void 0 || (_process2 = _process2.env) === null || _process2 === void 0 ? void 0 : _process2.JEST_WORKER_ID) !== undefined);
9
+ function oneOf(values) {
10
+ function typeGuard(value) {
11
+ return values.includes(value);
12
+ }
13
+ /**
14
+ * This is used by test utils to get the variants when running describe.each
15
+ */
16
+ if (IS_TESTING_ENV) {
17
+ typeGuard.values = values;
18
+ }
19
+ return typeGuard;
20
+ }
package/dist/cjs/setup.js CHANGED
@@ -43,7 +43,6 @@ paramOverrides, options) {
43
43
  // values.
44
44
  // For production usage -- this is done via the feature flag client which takes the type
45
45
  // and performs equivalent logic.
46
- // @ts-ignore
47
46
  groupOverrides = Object.entries(groupOverrides).reduce(function (acc, _ref) {
48
47
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
49
48
  key = _ref2[0],
@@ -1,27 +1 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isBoolean = isBoolean;
7
- exports.oneOf = oneOf;
8
- var _process, _process2;
9
- function isBoolean(value) {
10
- return typeof value === 'boolean';
11
- }
12
- function oneOf(values) {
13
- function typeGuard(value) {
14
- return values.includes(value);
15
- }
16
- /**
17
- * This is used by test utils to get the variants when running describe.each
18
- */
19
- if (IS_TESTING_ENV) {
20
- typeGuard.values = values;
21
- }
22
- return typeGuard;
23
- }
24
-
25
- // @ts-ignore
26
-
27
- var IS_TESTING_ENV = typeof process !== 'undefined' && (((_process = process) === null || _process === void 0 || (_process = _process.env) === null || _process === void 0 ? void 0 : _process.NODE_ENV) === 'test' || ((_process2 = process) === null || _process2 === void 0 || (_process2 = _process2.env) === null || _process2 === void 0 ? void 0 : _process2.JEST_WORKER_ID) !== undefined);
1
+ "use strict";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.unstable_editorExperimentParam = unstable_editorExperimentParam;
8
+ var _featureGates = _interopRequireDefault(require("@atlaskit/feature-gate-js-client/feature-gates"));
9
+ var _setup = require("./setup");
10
+ /* eslint-disable @atlaskit/editor/no-re-export */
11
+ // Entry file in package.json
12
+
13
+ // eslint-disable-next-line @typescript-eslint/no-empty-object-type
14
+
15
+ /**
16
+ * @warning This currently lacks type safety on the param names and return values
17
+ * and has limited associated test tooling.
18
+ *
19
+ * It also only works for experiments where the key matches the productKey used.
20
+ *
21
+ * The typeguard and default value is also expected to move to the experiment config
22
+ */
23
+ function unstable_editorExperimentParam(experimentName, paramName, options) {
24
+ var _paramOverrides$exper, _options$exposure;
25
+ if (((_paramOverrides$exper = _setup._paramOverrides[experimentName]) === null || _paramOverrides$exper === void 0 ? void 0 : _paramOverrides$exper[paramName]) !== undefined) {
26
+ // This will be hit in the case of a test setting an override
27
+
28
+ return _setup._paramOverrides[experimentName][paramName];
29
+ }
30
+
31
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
32
+ var experimentValue = _featureGates.default.getExperimentValue(experimentName, paramName, options.defaultValue, {
33
+ typeGuard: options.typeGuard,
34
+ fireExperimentExposure: (_options$exposure = options.exposure) !== null && _options$exposure !== void 0 ? _options$exposure : false
35
+ });
36
+ return experimentValue;
37
+ }
@@ -0,0 +1,11 @@
1
+ import { isBoolean } from './is-boolean';
2
+ /**
3
+ * Helper to create a boolean experiment configuration
4
+ */
5
+ export function createBooleanExperiment(config) {
6
+ return {
7
+ ...config,
8
+ typeGuard: isBoolean,
9
+ defaultValue: config.defaultValue
10
+ };
11
+ }
@@ -1,15 +1,4 @@
1
- import { isBoolean, oneOf } from './type-guards';
2
- /**
3
- * Helper to create a boolean experiment configuration
4
- */
5
- export function createBooleanExperiment(config) {
6
- return {
7
- ...config,
8
- typeGuard: isBoolean,
9
- defaultValue: config.defaultValue
10
- };
11
- }
12
-
1
+ import { oneOf } from './one-of';
13
2
  /**
14
3
  * Helper to create a multivariate experiment configuration
15
4
  */
@@ -0,0 +1,100 @@
1
+ /* eslint-disable @atlaskit/editor/no-re-export */
2
+ // Entry file in package.json
3
+
4
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
5
+ import { addFeatureFlagAccessed } from '@atlaskit/react-ufo/feature-flags-accessed';
6
+ import { editorExperimentsConfig } from './experiments-config';
7
+ import { _overrides, _product } from './setup';
8
+
9
+ /**
10
+ * Check the value of an editor experiment.
11
+ *
12
+ * Note: By default this will not fire an [exposure event](https://hello.atlassian.net/wiki/spaces/~732385844/pages/3187295823/Exposure+Events+101).
13
+ *
14
+ * You need explicitly call it using the exposure property when you need an exposure event to be fired (all experiments should fire exposure events).
15
+ *
16
+ * @example Boolean experiment
17
+ * ```ts
18
+ * if (editorExperiment('example-boolean', true)) {
19
+ * // Run code for on variant
20
+ * } else {
21
+ * // Run code for off variant
22
+ * }
23
+ * ```
24
+ *
25
+ * @example Multivariate experiment
26
+ * ```ts
27
+ * switch (true) {
28
+ * case editorExperiment('example-multivariate', 'one'):
29
+ * // Run code for variant one
30
+ * break;
31
+ * case editorExperiment('example-multivariate', 'two'):
32
+ * // Run code for variant two
33
+ * break;
34
+ * case editorExperiment('example-multivariate', 'three'):
35
+ * // Run code for variant three
36
+ * break;
37
+ * }
38
+ * }
39
+ *```
40
+
41
+ @example Experiment with exposure event
42
+ * ```ts
43
+ * // Inside feature surface where either the control or variant should be shown
44
+ * if (editorExperiment('example-boolean', true, { exposure: true })) {
45
+ * // Run code for on variant
46
+ * } else {
47
+ * // Run code for off variant
48
+ * }
49
+ * ```
50
+ *
51
+ * @private
52
+ * @deprecated This utility is deprecated in favour of using `expValEquals` from `@atlaskit/tmp-editor-statsig/exp-val-equals`.
53
+ * ExpValEquals fires exposure events by default preventing cases when consumers of exitorExperiment forget to pass the `exposure` option.
54
+ * It also closely aligns with similar utilities in other Atlassian products.
55
+ * For no exposure option use `expValEqualsNoExposure` from `@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure`.
56
+ */
57
+ export function editorExperiment(experimentName, expectedExperimentValue, options = {
58
+ exposure: false
59
+ }) {
60
+ var _experimentConfig$pro;
61
+ const experimentConfig = editorExperimentsConfig[experimentName];
62
+ if (_overrides[experimentName] !== undefined) {
63
+ // This will be hit in the case of a test setting an override
64
+ return _overrides[experimentName] === expectedExperimentValue;
65
+ }
66
+ if (experimentConfig === undefined) {
67
+ // Warning! If a product is improperly configured (ie. their editor packages are misaligned)
68
+ // it can cause the editor to crash here or if the experiment does not exist.
69
+ // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
70
+ throw new Error(`Editor experiment configuration is not defined ${experimentName}. Likely the experiment does not exist or editor package versions are misaligned`);
71
+ }
72
+ if (!_product) {
73
+ // This will be hit in the case of a product not having setup the editor experiment tooling
74
+ return experimentConfig.defaultValue === expectedExperimentValue;
75
+ }
76
+
77
+ // Typescript is complaining here about accessing the productKeys property
78
+ // Ignored via go/ees005
79
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
80
+ const experimentKey = experimentConfig === null || experimentConfig === void 0 ? void 0 : (_experimentConfig$pro = experimentConfig.productKeys) === null || _experimentConfig$pro === void 0 ? void 0 : _experimentConfig$pro[_product];
81
+ if (!experimentKey) {
82
+ var _editorExperimentsCon;
83
+ // This will be hit in the case of an experiment not being set up for the product
84
+ return ((_editorExperimentsCon = editorExperimentsConfig[experimentName]) === null || _editorExperimentsCon === void 0 ? void 0 : _editorExperimentsCon.defaultValue) === expectedExperimentValue;
85
+ }
86
+
87
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
88
+ const experimentValue = FeatureGates.getExperimentValue(experimentKey, experimentConfig.param, experimentConfig.defaultValue, {
89
+ typeGuard: experimentConfig.typeGuard,
90
+ fireExperimentExposure: options.exposure
91
+ });
92
+ if (
93
+ // When cleaning this gate up -- `calling where the experiments have the product key set`
94
+ // in __tests__/experiments should be updated (as it's had the count bumped to include these).
95
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
96
+ FeatureGates.getExperimentValue('cc_editor_experiments_ufo_gate_reporting', 'isEnabled', false)) {
97
+ addFeatureFlagAccessed(`${experimentName}:${experimentConfig.param}`, experimentValue);
98
+ }
99
+ return expectedExperimentValue === experimentValue;
100
+ }
@@ -25,10 +25,8 @@ const allowsProductKeys = ['cc-maui-experiment', 'cc_maui_create_keyword', 'cc_m
25
25
  */
26
26
  export function expValEqualsInternal(experimentName, experimentParam, experimentExpectedValue, experimentDefaultValue, experimentExposure) {
27
27
  var _editorExperimentsCon, _editorExperimentsCon2, _editorExperimentsCon3;
28
- // @ts-ignore need to loosen the type here to allow for any experiment name
29
28
  if (_overrides[experimentName] !== undefined) {
30
29
  // This will be hit in the case of a test setting an override
31
- // @ts-ignore need to loosen the type here to allow for any experiment name
32
30
  return _overrides[experimentName] === experimentExpectedValue;
33
31
  }
34
32
 
@@ -0,0 +1,9 @@
1
+ import { expValInternal } from './expVal';
2
+ export function expValNoExposure(experimentName, experimentParam, defaultValue) {
3
+ return expValInternal({
4
+ experimentName,
5
+ experimentParam,
6
+ defaultValue: defaultValue,
7
+ fireExperimentExposure: false
8
+ });
9
+ }
@@ -0,0 +1,26 @@
1
+ import { expValInternal } from './expVal';
2
+
3
+ /**
4
+ * Use to check a any param value for an experiment
5
+ *
6
+ * **Note**: this will return the default value when the experiment;
7
+ * - is not being served to the client (ie. pre start)
8
+ * - or is not configured in experiments-config
9
+ *
10
+ * If you need to check a param value without an exposure check see
11
+ * {@link import('./exp-val-no-exposure').expValNoExposure}
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const delay = expVal('experiment-name', 'param-name', defaultValue)
16
+ * await new Promise(res => setTimeout(res, delay)
17
+ * ```
18
+ */
19
+ export function expVal(experimentName, experimentParam, defaultValue) {
20
+ return expValInternal({
21
+ experimentName,
22
+ experimentParam,
23
+ defaultValue: defaultValue,
24
+ fireExperimentExposure: true
25
+ });
26
+ }
@@ -1,9 +1,11 @@
1
- import FeatureGates from '@atlaskit/feature-gate-js-client';
2
- import { fg } from '@atlaskit/platform-feature-flags';
1
+ /* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
2
+ /* eslint-disable @atlaskit/editor/no-re-export -- deprecated shims re-exporting the split `expVal`/`expValNoExposure` modules for backwards compatibility (VOLTC-139). */
3
+ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
4
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
3
5
  import { addFeatureFlagAccessed } from '@atlaskit/react-ufo/feature-flags-accessed';
4
6
  import { disallowsProductKeys, editorExperimentsConfig } from './experiments-config';
5
7
  import { _overrides, _paramOverrides, _product } from './setup';
6
- function expValInternal({
8
+ export function expValInternal({
7
9
  experimentName,
8
10
  experimentParam,
9
11
  defaultValue,
@@ -17,8 +19,6 @@ function expValInternal({
17
19
  // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
18
20
  throw new Error(`Editor experiment configuration is not defined ${experimentName}. Likely the experiment does not exist or editor package versions are misaligned`);
19
21
  }
20
-
21
- // @ts-ignore need to loosen the type here to allow for any experiment name
22
22
  if (_overrides[experimentName] !== undefined) {
23
23
  // This will be hit in the case of a test setting an override
24
24
  // @ts-ignore need to loosen the type here to allow for any experiment name
@@ -64,45 +64,10 @@ function expValInternal({
64
64
  }
65
65
 
66
66
  /**
67
- * Use to check a any param value for an experiment
68
- *
69
- * **Note**: this will return the default value when the experiment;
70
- * - is not being served to the client (ie. pre start)
71
- * - or is not configured in experiments-config
72
- *
73
- * If you need to check a param value without an exposure check see {@link expValNoExposure}
74
- *
75
- * @example
76
- * ```ts
77
- * const delay = expVal('experiment-name', 'param-name', defaultValue)
78
- * await new Promise(res => setTimeout(res, delay)
79
- * ```
67
+ * @deprecated Use `import { expVal } from '@atlaskit/tmp-editor-statsig/expVal'` instead.
80
68
  */
81
- export function expVal(experimentName, experimentParam, defaultValue) {
82
- return expValInternal({
83
- experimentName,
84
- experimentParam,
85
- defaultValue: defaultValue,
86
- fireExperimentExposure: true
87
- });
88
- } /**
89
- * Use to check a any param value for an experiment without firing an exposure event
90
- *
91
- * **Note**: this will return the default value when the experiment;
92
- * - is not being served to the client (ie. pre start)
93
- * - or is not configured in experiments-config
94
- *
95
- * @example
96
- * ```ts
97
- * const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
98
- * await new Promise(res => setTimeout(res, delay)
99
- * ```
100
- */
101
- export function expValNoExposure(experimentName, experimentParam, defaultValue) {
102
- return expValInternal({
103
- experimentName,
104
- experimentParam,
105
- defaultValue: defaultValue,
106
- fireExperimentExposure: false
107
- });
108
- }
69
+ export { expVal } from './exp-val';
70
+ /**
71
+ * @deprecated Use `import { expValNoExposure } from '@atlaskit/tmp-editor-statsig/expVal'` instead.
72
+ */
73
+ export { expValNoExposure } from './exp-val-no-exposure';
@@ -2,7 +2,8 @@
2
2
  /* eslint-disable @atlaskit/editor/no-re-export */
3
3
  // Entry file in package.json
4
4
 
5
- import { createBooleanExperiment, createMultivariateExperiment } from './experiment-builders';
5
+ import { createBooleanExperiment } from './create-boolean-experiment';
6
+ import { createMultivariateExperiment } from './create-multivariate-experiment';
6
7
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports -- Need value import for typeof
7
8
 
8
9
  // These experiments have a jira-specific key that differs from the experiment name,
@@ -208,14 +209,6 @@ export const editorExperimentsConfig = {
208
209
  param: 'isEnabled',
209
210
  defaultValue: false
210
211
  }),
211
- // Added 2026-07-14
212
- platform_editor_dom_node_count: createBooleanExperiment({
213
- productKeys: {
214
- confluence: 'platform_editor_dom_node_count'
215
- },
216
- param: 'isEnabled',
217
- defaultValue: false
218
- }),
219
212
  // Added 2026-03-26
220
213
  cc_editor_fix_insm_inp_buffer: createBooleanExperiment({
221
214
  productKeys: {