@atlaskit/tmp-editor-statsig 210.0.0 → 211.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-statsig-tmp
2
2
 
3
+ ## 211.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`034ef0dcd5baa`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/034ef0dcd5baa) -
8
+ Remove the shipped `cc_fix_hydration_ttvc` experiment configuration.
9
+
10
+ ### Minor Changes
11
+
12
+ - [`038da6c703ee9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/038da6c703ee9) -
13
+ `editorExperiment('platform_editor_controls', …)` now returns `variant1` for the Confluence and
14
+ Jira products, whose product code has been cleaned up to always behave as `variant1`.
15
+
16
+ Every other app (no product, or a product without a product key) now also returns `variant1`, so
17
+ the editor controls experience is enabled by default. It returns `control` only when the
18
+ `platform_editor_controls_other_apps_ks` kill switch is on for that app, or before the Statsig
19
+ client has initialised. Test overrides and the `test` product are unchanged.
20
+
3
21
  ## 210.0.0
4
22
 
5
23
  ### Major Changes
@@ -12,6 +12,40 @@ var _setup = require("./setup");
12
12
  /* eslint-disable @atlaskit/editor/no-re-export */
13
13
  // Entry file in package.json
14
14
 
15
+ var EDITOR_CONTROLS_EXPERIMENT = 'platform_editor_controls';
16
+ var EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH = 'platform_editor_controls_other_apps_ks';
17
+
18
+ /**
19
+ * Resolves the `platform_editor_controls` cohort while the experiment is being cleaned up.
20
+ *
21
+ * - Confluence and Jira always get `variant1`. Their product code has been cleaned up to always
22
+ * behave as `variant1` (EDITOR-9269, EDITOR-9270), so the editor must agree with it.
23
+ * - Every other app (no product, or a product without a product key such as Bitbucket) gets
24
+ * `variant1` unless the kill switch `platform_editor_controls_other_apps_ks` passes for that app,
25
+ * in which case it gets `control`. The kill switch defaults to false, so controls are on by
26
+ * default. Its exposure always fires so Statsig shows which apps run this code.
27
+ * - Before the Statsig client is initialised, other apps get the experiment's default value.
28
+ * - The `test` product keeps the experiment's default value.
29
+ *
30
+ * Remove together with the experiment in EDITOR-9262.
31
+ */
32
+ function getEditorControlsCohort(defaultValue) {
33
+ if (_setup._product === 'confluence' || _setup._product === 'jira') {
34
+ return 'variant1';
35
+ }
36
+ if (_setup._product === 'test') {
37
+ return defaultValue;
38
+ }
39
+ if (!_featureGates.default.initializeCompleted()) {
40
+ return defaultValue;
41
+ }
42
+
43
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
44
+ return _featureGates.default.checkGate(EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH, {
45
+ fireGateExposure: true
46
+ }) ? 'control' : 'variant1';
47
+ }
48
+
15
49
  /**
16
50
  * Check the value of an editor experiment.
17
51
  *
@@ -77,6 +111,15 @@ function editorExperiment(experimentName, expectedExperimentValue) {
77
111
  // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
78
112
  throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
79
113
  }
114
+ if (experimentName === EDITOR_CONTROLS_EXPERIMENT) {
115
+ var cohort = getEditorControlsCohort(experimentConfig.defaultValue);
116
+ if (
117
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
118
+ _featureGates.default.getExperimentValue('cc_editor_experiments_ufo_gate_reporting', 'isEnabled', false)) {
119
+ (0, _featureFlagsAccessed.addFeatureFlagAccessed)("".concat(experimentName, ":").concat(experimentConfig.param), cohort);
120
+ }
121
+ return cohort === expectedExperimentValue;
122
+ }
80
123
  if (!_setup._product) {
81
124
  // This will be hit in the case of a product not having setup the editor experiment tooling
82
125
  return experimentConfig.defaultValue === expectedExperimentValue;
@@ -77,14 +77,6 @@ var editorExperimentsConfig = exports.editorExperimentsConfig = {
77
77
  param: 'isEnabled',
78
78
  defaultValue: false
79
79
  }),
80
- // Added 02-12-2025
81
- cc_fix_hydration_ttvc: (0, _createBooleanExperiment.createBooleanExperiment)({
82
- productKeys: {
83
- confluence: 'cc_fix_hydration_ttvc'
84
- },
85
- param: 'isEnabled',
86
- defaultValue: false
87
- }),
88
80
  // Added 2026-03-25
89
81
  'editor_a11y__enghealth-46814_fy26': (0, _createBooleanExperiment.createBooleanExperiment)({
90
82
  productKeys: {
@@ -5,6 +5,39 @@ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
5
5
  import { addFeatureFlagAccessed } from '@atlaskit/react-ufo/feature-flags-accessed';
6
6
  import { editorExperimentsConfig } from './experiments-config';
7
7
  import { _overrides, _product } from './setup';
8
+ const EDITOR_CONTROLS_EXPERIMENT = 'platform_editor_controls';
9
+ const EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH = 'platform_editor_controls_other_apps_ks';
10
+
11
+ /**
12
+ * Resolves the `platform_editor_controls` cohort while the experiment is being cleaned up.
13
+ *
14
+ * - Confluence and Jira always get `variant1`. Their product code has been cleaned up to always
15
+ * behave as `variant1` (EDITOR-9269, EDITOR-9270), so the editor must agree with it.
16
+ * - Every other app (no product, or a product without a product key such as Bitbucket) gets
17
+ * `variant1` unless the kill switch `platform_editor_controls_other_apps_ks` passes for that app,
18
+ * in which case it gets `control`. The kill switch defaults to false, so controls are on by
19
+ * default. Its exposure always fires so Statsig shows which apps run this code.
20
+ * - Before the Statsig client is initialised, other apps get the experiment's default value.
21
+ * - The `test` product keeps the experiment's default value.
22
+ *
23
+ * Remove together with the experiment in EDITOR-9262.
24
+ */
25
+ function getEditorControlsCohort(defaultValue) {
26
+ if (_product === 'confluence' || _product === 'jira') {
27
+ return 'variant1';
28
+ }
29
+ if (_product === 'test') {
30
+ return defaultValue;
31
+ }
32
+ if (!FeatureGates.initializeCompleted()) {
33
+ return defaultValue;
34
+ }
35
+
36
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
37
+ return FeatureGates.checkGate(EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH, {
38
+ fireGateExposure: true
39
+ }) ? 'control' : 'variant1';
40
+ }
8
41
 
9
42
  /**
10
43
  * Check the value of an editor experiment.
@@ -70,6 +103,15 @@ export function editorExperiment(experimentName, expectedExperimentValue, option
70
103
  // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
71
104
  throw new Error(`Editor experiment configuration is not defined ${experimentName}. Likely the experiment does not exist or editor package versions are misaligned`);
72
105
  }
106
+ if (experimentName === EDITOR_CONTROLS_EXPERIMENT) {
107
+ const cohort = getEditorControlsCohort(experimentConfig.defaultValue);
108
+ if (
109
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
110
+ FeatureGates.getExperimentValue('cc_editor_experiments_ufo_gate_reporting', 'isEnabled', false)) {
111
+ addFeatureFlagAccessed(`${experimentName}:${experimentConfig.param}`, cohort);
112
+ }
113
+ return cohort === expectedExperimentValue;
114
+ }
73
115
  if (!_product) {
74
116
  // This will be hit in the case of a product not having setup the editor experiment tooling
75
117
  return experimentConfig.defaultValue === expectedExperimentValue;
@@ -71,14 +71,6 @@ export const editorExperimentsConfig = {
71
71
  param: 'isEnabled',
72
72
  defaultValue: false
73
73
  }),
74
- // Added 02-12-2025
75
- cc_fix_hydration_ttvc: createBooleanExperiment({
76
- productKeys: {
77
- confluence: 'cc_fix_hydration_ttvc'
78
- },
79
- param: 'isEnabled',
80
- defaultValue: false
81
- }),
82
74
  // Added 2026-03-25
83
75
  'editor_a11y__enghealth-46814_fy26': createBooleanExperiment({
84
76
  productKeys: {
@@ -5,6 +5,39 @@ import FeatureGates from '@atlaskit/feature-gate-js-client/feature-gates';
5
5
  import { addFeatureFlagAccessed } from '@atlaskit/react-ufo/feature-flags-accessed';
6
6
  import { editorExperimentsConfig } from './experiments-config';
7
7
  import { _overrides, _product } from './setup';
8
+ var EDITOR_CONTROLS_EXPERIMENT = 'platform_editor_controls';
9
+ var EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH = 'platform_editor_controls_other_apps_ks';
10
+
11
+ /**
12
+ * Resolves the `platform_editor_controls` cohort while the experiment is being cleaned up.
13
+ *
14
+ * - Confluence and Jira always get `variant1`. Their product code has been cleaned up to always
15
+ * behave as `variant1` (EDITOR-9269, EDITOR-9270), so the editor must agree with it.
16
+ * - Every other app (no product, or a product without a product key such as Bitbucket) gets
17
+ * `variant1` unless the kill switch `platform_editor_controls_other_apps_ks` passes for that app,
18
+ * in which case it gets `control`. The kill switch defaults to false, so controls are on by
19
+ * default. Its exposure always fires so Statsig shows which apps run this code.
20
+ * - Before the Statsig client is initialised, other apps get the experiment's default value.
21
+ * - The `test` product keeps the experiment's default value.
22
+ *
23
+ * Remove together with the experiment in EDITOR-9262.
24
+ */
25
+ function getEditorControlsCohort(defaultValue) {
26
+ if (_product === 'confluence' || _product === 'jira') {
27
+ return 'variant1';
28
+ }
29
+ if (_product === 'test') {
30
+ return defaultValue;
31
+ }
32
+ if (!FeatureGates.initializeCompleted()) {
33
+ return defaultValue;
34
+ }
35
+
36
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
37
+ return FeatureGates.checkGate(EDITOR_CONTROLS_OTHER_APPS_KILL_SWITCH, {
38
+ fireGateExposure: true
39
+ }) ? 'control' : 'variant1';
40
+ }
8
41
 
9
42
  /**
10
43
  * Check the value of an editor experiment.
@@ -71,6 +104,15 @@ export function editorExperiment(experimentName, expectedExperimentValue) {
71
104
  // We will definitely crash via any code path later in this function - this just makes the error explicit and clear.
72
105
  throw new Error("Editor experiment configuration is not defined ".concat(experimentName, ". Likely the experiment does not exist or editor package versions are misaligned"));
73
106
  }
107
+ if (experimentName === EDITOR_CONTROLS_EXPERIMENT) {
108
+ var cohort = getEditorControlsCohort(experimentConfig.defaultValue);
109
+ if (
110
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
111
+ FeatureGates.getExperimentValue('cc_editor_experiments_ufo_gate_reporting', 'isEnabled', false)) {
112
+ addFeatureFlagAccessed("".concat(experimentName, ":").concat(experimentConfig.param), cohort);
113
+ }
114
+ return cohort === expectedExperimentValue;
115
+ }
74
116
  if (!_product) {
75
117
  // This will be hit in the case of a product not having setup the editor experiment tooling
76
118
  return experimentConfig.defaultValue === expectedExperimentValue;
@@ -71,14 +71,6 @@ export var editorExperimentsConfig = {
71
71
  param: 'isEnabled',
72
72
  defaultValue: false
73
73
  }),
74
- // Added 02-12-2025
75
- cc_fix_hydration_ttvc: createBooleanExperiment({
76
- productKeys: {
77
- confluence: 'cc_fix_hydration_ttvc'
78
- },
79
- param: 'isEnabled',
80
- defaultValue: false
81
- }),
82
74
  // Added 2026-03-25
83
75
  'editor_a11y__enghealth-46814_fy26': createBooleanExperiment({
84
76
  productKeys: {
@@ -131,12 +131,6 @@ export declare const editorExperimentsConfig: {
131
131
  productKeys?: ProductKeys;
132
132
  typeGuard: IsBooleanType;
133
133
  };
134
- cc_fix_hydration_ttvc: {
135
- defaultValue: boolean;
136
- param: string;
137
- productKeys?: ProductKeys;
138
- typeGuard: IsBooleanType;
139
- };
140
134
  platform_editor_code_block_q4_lovability: {
141
135
  defaultValue: boolean;
142
136
  param: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/tmp-editor-statsig",
3
- "version": "210.0.0",
3
+ "version": "211.0.0",
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",