@atlaskit/tmp-editor-statsig 13.43.0 → 14.0.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.
- package/CHANGELOG.md +24 -0
- package/dist/cjs/editor-experiments-test-utils.js +4 -0
- package/dist/cjs/exp-test-overrides.js +0 -1
- package/dist/cjs/exp-val-equals-no-exposure.js +2 -2
- package/dist/cjs/exp-val-equals.js +2 -2
- package/dist/cjs/expVal.js +15 -17
- package/dist/cjs/experiments-config.js +25 -16
- package/dist/es2019/editor-experiments-test-utils.js +4 -0
- package/dist/es2019/exp-test-overrides.js +0 -1
- package/dist/es2019/exp-val-equals-no-exposure.js +2 -2
- package/dist/es2019/exp-val-equals.js +2 -2
- package/dist/es2019/expVal.js +17 -19
- package/dist/es2019/experiments-config.js +25 -16
- package/dist/esm/editor-experiments-test-utils.js +4 -0
- package/dist/esm/exp-test-overrides.js +0 -1
- package/dist/esm/exp-val-equals-no-exposure.js +2 -2
- package/dist/esm/exp-val-equals.js +2 -2
- package/dist/esm/expVal.js +15 -17
- package/dist/esm/experiments-config.js +25 -16
- package/dist/types/editor-experiments-test-utils.d.ts +13 -4
- package/dist/types/exp-val-equals-no-exposure.d.ts +4 -4
- package/dist/types/exp-val-equals.d.ts +4 -4
- package/dist/types/expVal.d.ts +4 -5
- package/dist/types/experiment-builders.d.ts +6 -6
- package/dist/types/experiments-config.d.ts +471 -462
- package/dist/types-ts4.5/editor-experiments-test-utils.d.ts +13 -4
- package/dist/types-ts4.5/exp-val-equals-no-exposure.d.ts +4 -4
- package/dist/types-ts4.5/exp-val-equals.d.ts +4 -4
- package/dist/types-ts4.5/expVal.d.ts +4 -5
- package/dist/types-ts4.5/experiment-builders.d.ts +7 -7
- package/dist/types-ts4.5/experiments-config.d.ts +471 -462
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-statsig-tmp
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [`66121121982b2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/66121121982b2) -
|
|
8
|
+
[EXP-CLEANUP] editor_ai_inline_suggestion_date_v2
|
|
9
|
+
|
|
10
|
+
### Minor Changes
|
|
11
|
+
|
|
12
|
+
- [`d84e4018e7a77`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d84e4018e7a77) -
|
|
13
|
+
ED-29689 create new exp
|
|
14
|
+
|
|
15
|
+
## 13.44.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`60c2daf68b2a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/60c2daf68b2a9) -
|
|
20
|
+
add type guard for expected value and default value in expVal, expValNoExposure, expValEquals and
|
|
21
|
+
expValEqualsNoExposure
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 13.43.0
|
|
4
28
|
|
|
5
29
|
### Minor Changes
|
|
@@ -89,6 +89,10 @@ function eeTest(experimentName, cases, otherExperiments) {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// Namespace declaration to add describe property to eeTest function type
|
|
93
|
+
// TypeScript automatically merges function and namespace declarations with the same name
|
|
94
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
95
|
+
|
|
92
96
|
/**
|
|
93
97
|
* eeTest.describe() Wrapper utility for describe() that runs a test with a editor experiment overides.
|
|
94
98
|
*
|
|
@@ -13,7 +13,6 @@ var testMultivariateOverrides = exports.testMultivariateOverrides = {
|
|
|
13
13
|
confluence_whiteboards_quick_insert: 'control',
|
|
14
14
|
confluence_whiteboards_quick_insert_localised: 'control',
|
|
15
15
|
confluence_whiteboards_quick_insert_localised_aa: 'control',
|
|
16
|
-
editor_ai_inline_suggestion_date_v2: 'control',
|
|
17
16
|
cc_editor_ai_content_mode: 'control',
|
|
18
17
|
platform_editor_add_orange_highlight_color: 'control',
|
|
19
18
|
platform_editor_ai_iw_adf_streaming: 'control',
|
|
@@ -28,8 +28,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
|
|
|
28
28
|
*
|
|
29
29
|
* @param experimentName - experiment key
|
|
30
30
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
31
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
32
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
31
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
32
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
33
33
|
*
|
|
34
34
|
* @returns boolean
|
|
35
35
|
*/
|
|
@@ -28,8 +28,8 @@ var _expValEqualsInternal = require("./exp-val-equals-internal");
|
|
|
28
28
|
*
|
|
29
29
|
* @param experimentName - experiment key
|
|
30
30
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
31
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
32
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
31
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
32
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
33
33
|
*
|
|
34
34
|
* @returns boolean
|
|
35
35
|
*/
|
package/dist/cjs/expVal.js
CHANGED
|
@@ -75,11 +75,11 @@ function expValInternal(_ref) {
|
|
|
75
75
|
* - is not being served to the client (ie. pre start)
|
|
76
76
|
* - or is not configured in experiments-config
|
|
77
77
|
*
|
|
78
|
-
* If you need to check a param value without an exposure check see {@link
|
|
78
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
79
79
|
*
|
|
80
80
|
* @example
|
|
81
81
|
* ```ts
|
|
82
|
-
* const delay =
|
|
82
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
83
83
|
* await new Promise(res => setTimeout(res, delay)
|
|
84
84
|
* ```
|
|
85
85
|
*/
|
|
@@ -90,21 +90,19 @@ function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
90
90
|
defaultValue: defaultValue,
|
|
91
91
|
fireExperimentExposure: true
|
|
92
92
|
});
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
* ```
|
|
107
|
-
*/
|
|
93
|
+
} /**
|
|
94
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
95
|
+
*
|
|
96
|
+
* **Note**: this will return the default value when the experiment;
|
|
97
|
+
* - is not being served to the client (ie. pre start)
|
|
98
|
+
* - or is not configured in experiments-config
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
103
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
108
106
|
function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
109
107
|
return expValInternal({
|
|
110
108
|
experimentName: experimentName,
|
|
@@ -8,6 +8,24 @@ var _experimentBuilders = require("./experiment-builders");
|
|
|
8
8
|
/* eslint-disable @atlaskit/editor/no-re-export */
|
|
9
9
|
// Entry file in package.json
|
|
10
10
|
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports -- Need value import for typeof
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Extract valid expected values.
|
|
15
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
16
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// Multivariate: use the default value type
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Extract valid default values.
|
|
23
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
24
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
// Multivariate: use the default value type
|
|
28
|
+
|
|
11
29
|
/**
|
|
12
30
|
* When adding a new experiment, you need to add it here.
|
|
13
31
|
* Please follow the pattern established in the examples and any
|
|
@@ -326,14 +344,13 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
|
|
|
326
344
|
param: 'isEnabled',
|
|
327
345
|
defaultValue: false
|
|
328
346
|
}),
|
|
329
|
-
// Added 2025-
|
|
330
|
-
|
|
347
|
+
// Added 2025-10-15
|
|
348
|
+
platform_editor_no_ssr: (0, _experimentBuilders.createBooleanExperiment)({
|
|
331
349
|
productKeys: {
|
|
332
|
-
confluence: '
|
|
350
|
+
confluence: 'platform_editor_no_ssr'
|
|
333
351
|
},
|
|
334
|
-
param: '
|
|
335
|
-
|
|
336
|
-
defaultValue: 'control'
|
|
352
|
+
param: 'isEnabled',
|
|
353
|
+
defaultValue: false
|
|
337
354
|
}),
|
|
338
355
|
// Added 2025-10-31
|
|
339
356
|
platform_editor_lovability_suppress_toolbar_event: (0, _experimentBuilders.createBooleanExperiment)({
|
|
@@ -400,14 +417,6 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
|
|
|
400
417
|
param: 'isEnabled',
|
|
401
418
|
defaultValue: false
|
|
402
419
|
}),
|
|
403
|
-
// Added 2025-10-15
|
|
404
|
-
platform_editor_no_ssr: (0, _experimentBuilders.createBooleanExperiment)({
|
|
405
|
-
productKeys: {
|
|
406
|
-
confluence: 'platform_editor_no_ssr'
|
|
407
|
-
},
|
|
408
|
-
param: 'isEnabled',
|
|
409
|
-
defaultValue: false
|
|
410
|
-
}),
|
|
411
420
|
// Added 2025-08-14
|
|
412
421
|
platform_editor_jira_advanced_code_blocks: (0, _experimentBuilders.createBooleanExperiment)({
|
|
413
422
|
productKeys: {
|
|
@@ -776,9 +785,9 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
|
|
|
776
785
|
defaultValue: false
|
|
777
786
|
}),
|
|
778
787
|
// Added 2025-08-05
|
|
779
|
-
|
|
788
|
+
platform_editor_native_anchor_with_dnd: (0, _experimentBuilders.createBooleanExperiment)({
|
|
780
789
|
productKeys: {
|
|
781
|
-
confluence: '
|
|
790
|
+
confluence: 'platform_editor_native_anchor_with_dnd'
|
|
782
791
|
},
|
|
783
792
|
param: 'isEnabled',
|
|
784
793
|
defaultValue: false
|
|
@@ -70,6 +70,10 @@ function eeTest(experimentName, cases, otherExperiments) {
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// Namespace declaration to add describe property to eeTest function type
|
|
74
|
+
// TypeScript automatically merges function and namespace declarations with the same name
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
76
|
+
|
|
73
77
|
/**
|
|
74
78
|
* eeTest.describe() Wrapper utility for describe() that runs a test with a editor experiment overides.
|
|
75
79
|
*
|
|
@@ -7,7 +7,6 @@ export const testMultivariateOverrides = {
|
|
|
7
7
|
confluence_whiteboards_quick_insert: 'control',
|
|
8
8
|
confluence_whiteboards_quick_insert_localised: 'control',
|
|
9
9
|
confluence_whiteboards_quick_insert_localised_aa: 'control',
|
|
10
|
-
editor_ai_inline_suggestion_date_v2: 'control',
|
|
11
10
|
cc_editor_ai_content_mode: 'control',
|
|
12
11
|
platform_editor_add_orange_highlight_color: 'control',
|
|
13
12
|
platform_editor_ai_iw_adf_streaming: 'control',
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
package/dist/es2019/expVal.js
CHANGED
|
@@ -68,11 +68,11 @@ function expValInternal({
|
|
|
68
68
|
* - is not being served to the client (ie. pre start)
|
|
69
69
|
* - or is not configured in experiments-config
|
|
70
70
|
*
|
|
71
|
-
* If you need to check a param value without an exposure check see {@link
|
|
71
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
72
72
|
*
|
|
73
73
|
* @example
|
|
74
74
|
* ```ts
|
|
75
|
-
* const delay =
|
|
75
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
76
76
|
* await new Promise(res => setTimeout(res, delay)
|
|
77
77
|
* ```
|
|
78
78
|
*/
|
|
@@ -80,29 +80,27 @@ export function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
80
80
|
return expValInternal({
|
|
81
81
|
experimentName,
|
|
82
82
|
experimentParam,
|
|
83
|
-
defaultValue,
|
|
83
|
+
defaultValue: defaultValue,
|
|
84
84
|
fireExperimentExposure: true
|
|
85
85
|
});
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
86
|
+
} /**
|
|
87
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
88
|
+
*
|
|
89
|
+
* **Note**: this will return the default value when the experiment;
|
|
90
|
+
* - is not being served to the client (ie. pre start)
|
|
91
|
+
* - or is not configured in experiments-config
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
96
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
101
99
|
export function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
102
100
|
return expValInternal({
|
|
103
101
|
experimentName,
|
|
104
102
|
experimentParam,
|
|
105
|
-
defaultValue,
|
|
103
|
+
defaultValue: defaultValue,
|
|
106
104
|
fireExperimentExposure: false
|
|
107
105
|
});
|
|
108
106
|
}
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
4
|
import { createBooleanExperiment, createMultivariateExperiment } from './experiment-builders';
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports -- Need value import for typeof
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extract valid expected values.
|
|
9
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
10
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Multivariate: use the default value type
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Extract valid default values.
|
|
17
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
18
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Multivariate: use the default value type
|
|
22
|
+
|
|
5
23
|
/**
|
|
6
24
|
* When adding a new experiment, you need to add it here.
|
|
7
25
|
* Please follow the pattern established in the examples and any
|
|
@@ -320,14 +338,13 @@ export const editorExperimentsConfig = {
|
|
|
320
338
|
param: 'isEnabled',
|
|
321
339
|
defaultValue: false
|
|
322
340
|
}),
|
|
323
|
-
// Added 2025-
|
|
324
|
-
|
|
341
|
+
// Added 2025-10-15
|
|
342
|
+
platform_editor_no_ssr: createBooleanExperiment({
|
|
325
343
|
productKeys: {
|
|
326
|
-
confluence: '
|
|
344
|
+
confluence: 'platform_editor_no_ssr'
|
|
327
345
|
},
|
|
328
|
-
param: '
|
|
329
|
-
|
|
330
|
-
defaultValue: 'control'
|
|
346
|
+
param: 'isEnabled',
|
|
347
|
+
defaultValue: false
|
|
331
348
|
}),
|
|
332
349
|
// Added 2025-10-31
|
|
333
350
|
platform_editor_lovability_suppress_toolbar_event: createBooleanExperiment({
|
|
@@ -394,14 +411,6 @@ export const editorExperimentsConfig = {
|
|
|
394
411
|
param: 'isEnabled',
|
|
395
412
|
defaultValue: false
|
|
396
413
|
}),
|
|
397
|
-
// Added 2025-10-15
|
|
398
|
-
platform_editor_no_ssr: createBooleanExperiment({
|
|
399
|
-
productKeys: {
|
|
400
|
-
confluence: 'platform_editor_no_ssr'
|
|
401
|
-
},
|
|
402
|
-
param: 'isEnabled',
|
|
403
|
-
defaultValue: false
|
|
404
|
-
}),
|
|
405
414
|
// Added 2025-08-14
|
|
406
415
|
platform_editor_jira_advanced_code_blocks: createBooleanExperiment({
|
|
407
416
|
productKeys: {
|
|
@@ -770,9 +779,9 @@ export const editorExperimentsConfig = {
|
|
|
770
779
|
defaultValue: false
|
|
771
780
|
}),
|
|
772
781
|
// Added 2025-08-05
|
|
773
|
-
|
|
782
|
+
platform_editor_native_anchor_with_dnd: createBooleanExperiment({
|
|
774
783
|
productKeys: {
|
|
775
|
-
confluence: '
|
|
784
|
+
confluence: 'platform_editor_native_anchor_with_dnd'
|
|
776
785
|
},
|
|
777
786
|
param: 'isEnabled',
|
|
778
787
|
defaultValue: false
|
|
@@ -86,6 +86,10 @@ function eeTest(experimentName, cases, otherExperiments) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
// Namespace declaration to add describe property to eeTest function type
|
|
90
|
+
// TypeScript automatically merges function and namespace declarations with the same name
|
|
91
|
+
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
92
|
+
|
|
89
93
|
/**
|
|
90
94
|
* eeTest.describe() Wrapper utility for describe() that runs a test with a editor experiment overides.
|
|
91
95
|
*
|
|
@@ -7,7 +7,6 @@ export var testMultivariateOverrides = {
|
|
|
7
7
|
confluence_whiteboards_quick_insert: 'control',
|
|
8
8
|
confluence_whiteboards_quick_insert_localised: 'control',
|
|
9
9
|
confluence_whiteboards_quick_insert_localised_aa: 'control',
|
|
10
|
-
editor_ai_inline_suggestion_date_v2: 'control',
|
|
11
10
|
cc_editor_ai_content_mode: 'control',
|
|
12
11
|
platform_editor_add_orange_highlight_color: 'control',
|
|
13
12
|
platform_editor_ai_iw_adf_streaming: 'control',
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
@@ -22,8 +22,8 @@ import { expValEqualsInternal } from './exp-val-equals-internal';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
package/dist/esm/expVal.js
CHANGED
|
@@ -67,11 +67,11 @@ function expValInternal(_ref) {
|
|
|
67
67
|
* - is not being served to the client (ie. pre start)
|
|
68
68
|
* - or is not configured in experiments-config
|
|
69
69
|
*
|
|
70
|
-
* If you need to check a param value without an exposure check see {@link
|
|
70
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
71
71
|
*
|
|
72
72
|
* @example
|
|
73
73
|
* ```ts
|
|
74
|
-
* const delay =
|
|
74
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
75
75
|
* await new Promise(res => setTimeout(res, delay)
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
@@ -82,21 +82,19 @@ export function expVal(experimentName, experimentParam, defaultValue) {
|
|
|
82
82
|
defaultValue: defaultValue,
|
|
83
83
|
fireExperimentExposure: true
|
|
84
84
|
});
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
85
|
+
} /**
|
|
86
|
+
* Use to check a any param value for an experiment without firing an exposure event
|
|
87
|
+
*
|
|
88
|
+
* **Note**: this will return the default value when the experiment;
|
|
89
|
+
* - is not being served to the client (ie. pre start)
|
|
90
|
+
* - or is not configured in experiments-config
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const delay = expParamEqualsNoExposure('experiment-name', 'param-name', defaultValue)
|
|
95
|
+
* await new Promise(res => setTimeout(res, delay)
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
100
98
|
export function expValNoExposure(experimentName, experimentParam, defaultValue) {
|
|
101
99
|
return expValInternal({
|
|
102
100
|
experimentName: experimentName,
|
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
// Entry file in package.json
|
|
3
3
|
|
|
4
4
|
import { createBooleanExperiment, createMultivariateExperiment } from './experiment-builders';
|
|
5
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-imports -- Need value import for typeof
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Extract valid expected values.
|
|
9
|
+
* - For multivariate experiments: returns union of valid string values (inferred from defaultValue type)
|
|
10
|
+
* - For boolean experiments: returns only 'true' literal (cannot use 'false' as expected value)
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Multivariate: use the default value type
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Extract valid default values.
|
|
17
|
+
* - For boolean experiments: returns only 'false' literal (cannot use 'true' as default value)
|
|
18
|
+
* - For multivariate experiments: returns the default value type (one of the string values)
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
// Multivariate: use the default value type
|
|
22
|
+
|
|
5
23
|
/**
|
|
6
24
|
* When adding a new experiment, you need to add it here.
|
|
7
25
|
* Please follow the pattern established in the examples and any
|
|
@@ -320,14 +338,13 @@ export var editorExperimentsConfig = {
|
|
|
320
338
|
param: 'isEnabled',
|
|
321
339
|
defaultValue: false
|
|
322
340
|
}),
|
|
323
|
-
// Added 2025-
|
|
324
|
-
|
|
341
|
+
// Added 2025-10-15
|
|
342
|
+
platform_editor_no_ssr: createBooleanExperiment({
|
|
325
343
|
productKeys: {
|
|
326
|
-
confluence: '
|
|
344
|
+
confluence: 'platform_editor_no_ssr'
|
|
327
345
|
},
|
|
328
|
-
param: '
|
|
329
|
-
|
|
330
|
-
defaultValue: 'control'
|
|
346
|
+
param: 'isEnabled',
|
|
347
|
+
defaultValue: false
|
|
331
348
|
}),
|
|
332
349
|
// Added 2025-10-31
|
|
333
350
|
platform_editor_lovability_suppress_toolbar_event: createBooleanExperiment({
|
|
@@ -394,14 +411,6 @@ export var editorExperimentsConfig = {
|
|
|
394
411
|
param: 'isEnabled',
|
|
395
412
|
defaultValue: false
|
|
396
413
|
}),
|
|
397
|
-
// Added 2025-10-15
|
|
398
|
-
platform_editor_no_ssr: createBooleanExperiment({
|
|
399
|
-
productKeys: {
|
|
400
|
-
confluence: 'platform_editor_no_ssr'
|
|
401
|
-
},
|
|
402
|
-
param: 'isEnabled',
|
|
403
|
-
defaultValue: false
|
|
404
|
-
}),
|
|
405
414
|
// Added 2025-08-14
|
|
406
415
|
platform_editor_jira_advanced_code_blocks: createBooleanExperiment({
|
|
407
416
|
productKeys: {
|
|
@@ -770,9 +779,9 @@ export var editorExperimentsConfig = {
|
|
|
770
779
|
defaultValue: false
|
|
771
780
|
}),
|
|
772
781
|
// Added 2025-08-05
|
|
773
|
-
|
|
782
|
+
platform_editor_native_anchor_with_dnd: createBooleanExperiment({
|
|
774
783
|
productKeys: {
|
|
775
|
-
confluence: '
|
|
784
|
+
confluence: 'platform_editor_native_anchor_with_dnd'
|
|
776
785
|
},
|
|
777
786
|
param: 'isEnabled',
|
|
778
787
|
defaultValue: false
|
|
@@ -43,10 +43,19 @@ declare function eeTest<ExperimentName extends keyof EditorExperimentsConfig>(ex
|
|
|
43
43
|
false: DescribeBody;
|
|
44
44
|
true: DescribeBody;
|
|
45
45
|
}, otherExperiments?: EditorExperimentOverrides): void;
|
|
46
|
+
interface EeTestDescribeReturn<ExperimentName extends keyof EditorExperimentsConfig> {
|
|
47
|
+
each: (describeBody: DescribeBody) => void;
|
|
48
|
+
variant: (value: EditorExperimentsConfig[ExperimentName]['defaultValue'], describeBody: DescribeBody) => void;
|
|
49
|
+
}
|
|
46
50
|
declare namespace eeTest {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
function describe<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, describeName: string): EeTestDescribeReturn<ExperimentName>;
|
|
52
|
+
}
|
|
53
|
+
interface EeTestFunction {
|
|
54
|
+
<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, cases: EditorExperimentsConfig[ExperimentName]['defaultValue'] extends string ? Record<EditorExperimentsConfig[ExperimentName]['defaultValue'], DescribeBody> : {
|
|
55
|
+
false: DescribeBody;
|
|
56
|
+
true: DescribeBody;
|
|
57
|
+
}, otherExperiments?: EditorExperimentOverrides): void;
|
|
58
|
+
describe: <ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, describeName: string) => EeTestDescribeReturn<ExperimentName>;
|
|
51
59
|
}
|
|
52
60
|
export { eeTest };
|
|
61
|
+
export type { EeTestFunction };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment without firing exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEqualsNoExposure<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorExperimentsConfig } from './experiments-config';
|
|
1
|
+
import { type EditorExperimentsConfig, type ExperimentDefaultValue, type ExperimentExpectedValue } from './experiments-config';
|
|
2
2
|
/**
|
|
3
3
|
* Check the value if an editor experiment and fire exposure.
|
|
4
4
|
*
|
|
@@ -22,9 +22,9 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
22
22
|
*
|
|
23
23
|
* @param experimentName - experiment key
|
|
24
24
|
* @param experimentParam - the name of the parameter to fetch from the experiment config
|
|
25
|
-
* @param experimentExpectedValue - expected value to compare with
|
|
26
|
-
* @param experimentDefaultValue - default value to use if the experiment is not defined.
|
|
25
|
+
* @param experimentExpectedValue - expected value to compare with. Can't use false for boolean experiments or invalid values for multivariate experiments.
|
|
26
|
+
* @param experimentDefaultValue - default value to use if the experiment is not defined. Can't use true for boolean experiments or invalid values for multivariate experiments.
|
|
27
27
|
*
|
|
28
28
|
* @returns boolean
|
|
29
29
|
*/
|
|
30
|
-
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue:
|
|
30
|
+
export declare function expValEquals<ExperimentName extends keyof EditorExperimentsConfig>(experimentName: ExperimentName, experimentParam: EditorExperimentsConfig[ExperimentName]['param'], experimentExpectedValue: ExperimentExpectedValue<ExperimentName>, experimentDefaultValue?: ExperimentDefaultValue<ExperimentName> | null): boolean;
|
package/dist/types/expVal.d.ts
CHANGED
|
@@ -6,16 +6,15 @@ import { type EditorExperimentsConfig } from './experiments-config';
|
|
|
6
6
|
* - is not being served to the client (ie. pre start)
|
|
7
7
|
* - or is not configured in experiments-config
|
|
8
8
|
*
|
|
9
|
-
* If you need to check a param value without an exposure check see {@link
|
|
9
|
+
* If you need to check a param value without an exposure check see {@link expValNoExposure}
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
|
-
* const delay =
|
|
13
|
+
* const delay = expVal('experiment-name', 'param-name', defaultValue)
|
|
14
14
|
* await new Promise(res => setTimeout(res, delay)
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
18
|
-
/**
|
|
17
|
+
export declare function expVal<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue; /**
|
|
19
18
|
* Use to check a any param value for an experiment without firing an exposure event
|
|
20
19
|
*
|
|
21
20
|
* **Note**: this will return the default value when the experiment;
|
|
@@ -28,4 +27,4 @@ export declare function expVal<ExperimentName extends keyof EditorExperimentsCon
|
|
|
28
27
|
* await new Promise(res => setTimeout(res, delay)
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
31
|
-
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue): DefaultValue;
|
|
30
|
+
export declare function expValNoExposure<ExperimentName extends keyof EditorExperimentsConfig, DefaultValue extends string | number | boolean>(experimentName: ExperimentName, experimentParam: string, defaultValue: DefaultValue extends boolean ? false : DefaultValue): DefaultValue;
|