@atlaspack/feature-flags 2.16.0 → 2.17.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,15 @@
1
1
  # @atlaspack/feature-flags
2
2
 
3
+ ## 2.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#619](https://github.com/atlassian-labs/atlaspack/pull/619) [`73ea3c4`](https://github.com/atlassian-labs/atlaspack/commit/73ea3c4d85d4401fdd15abcbf988237e890e7ad3) Thanks [@matt-koko](https://github.com/matt-koko)! - export `CONSISTENCY_CHECK_VALUES` for consumption in other products
8
+
9
+ ### Patch Changes
10
+
11
+ - [#623](https://github.com/atlassian-labs/atlaspack/pull/623) [`b1b3693`](https://github.com/atlassian-labs/atlaspack/commit/b1b369317c66f8a431c170df2ebba4fa5b2e38ef) Thanks [@JakeLane](https://github.com/JakeLane)! - Load same conditional bundles as conditional manifest in HTML
12
+
3
13
  ## 2.16.0
4
14
 
5
15
  ### Minor Changes
package/lib/index.js CHANGED
@@ -3,13 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.DEFAULT_FEATURE_FLAGS = void 0;
6
+ exports.DEFAULT_FEATURE_FLAGS = exports.CONSISTENCY_CHECK_VALUES = void 0;
7
7
  exports.getFeatureFlag = getFeatureFlag;
8
8
  exports.getFeatureFlagValue = getFeatureFlagValue;
9
9
  exports.runWithConsistencyCheck = runWithConsistencyCheck;
10
10
  exports.setFeatureFlags = setFeatureFlags;
11
11
  // We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS,
12
12
  // but we want to export FeatureFlags for Flow
13
+ const CONSISTENCY_CHECK_VALUES = exports.CONSISTENCY_CHECK_VALUES = Object.freeze(['NEW', 'OLD', 'NEW_AND_CHECK', 'OLD_AND_CHECK']);
13
14
  const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
14
15
  exampleConsistencyCheckFeature: 'OLD',
15
16
  exampleFeature: false,
@@ -26,6 +27,7 @@ const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
26
27
  conditionalBundlingNestedRuntime: false,
27
28
  patchProjectPaths: false,
28
29
  cachePerformanceImprovements: process.env.NODE_ENV === 'test',
30
+ environmentDeduplication: false,
29
31
  granularTsConfigInvalidation: false,
30
32
  inlineStringReplacementPerf: false,
31
33
  conditionalBundlingAsyncRuntime: false,
@@ -33,7 +35,8 @@ const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
33
35
  verboseRequestInvalidationStats: true,
34
36
  conditionalBundlingReporterDuplicateFix: false,
35
37
  resolveBundlerConfigFromCwd: false,
36
- conditionalBundlingReporterSameConditionFix: false
38
+ conditionalBundlingReporterSameConditionFix: false,
39
+ condbHtmlPackagerChange: false
37
40
  };
38
41
  let featureFlagValues = {
39
42
  ...DEFAULT_FEATURE_FLAGS
package/lib/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { $ElementType } from "utility-types";
1
2
  export type FeatureFlags = {
2
3
  // This feature flag mostly exists to test the feature flag system, and doesn't have any build/runtime effect
3
4
  readonly exampleFeature: boolean;
@@ -56,6 +57,11 @@ export type FeatureFlags = {
56
57
  */
57
58
  cachePerformanceImprovements: boolean;
58
59
 
60
+ /**
61
+ * Deduplicates environments across cache / memory entities
62
+ */
63
+ environmentDeduplication: boolean;
64
+
59
65
  /**
60
66
  * Enable scanning for the presence of loadable to determine side effects
61
67
  */
@@ -112,6 +118,12 @@ export type FeatureFlags = {
112
118
  * Fix a bug where the conditional manifest reporter would drop bundles that have the same condition
113
119
  */
114
120
  conditionalBundlingReporterSameConditionFix: boolean;
121
+
122
+ /**
123
+ * Enable a change to the html packager to load more bundles when conditional bundling fallback mode is enabled
124
+ */
125
+ condbHtmlPackagerChange: boolean;
115
126
  };
116
- export type ConsistencyCheckFeatureFlagValue = "NEW" | "OLD" | "NEW_AND_CHECK" | "OLD_AND_CHECK";
127
+ export declare var CONSISTENCY_CHECK_VALUES: ReadonlyArray<string>;
128
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<typeof CONSISTENCY_CHECK_VALUES, number>;
117
129
  export declare var DEFAULT_FEATURE_FLAGS: FeatureFlags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/feature-flags",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "Provides internal feature-flags for the atlaspack codebase.",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
package/src/index.js CHANGED
@@ -5,6 +5,13 @@ import type {FeatureFlags as _FeatureFlags} from './types';
5
5
  // but we want to export FeatureFlags for Flow
6
6
  export type FeatureFlags = _FeatureFlags;
7
7
 
8
+ export const CONSISTENCY_CHECK_VALUES: $ReadOnlyArray<string> = Object.freeze([
9
+ 'NEW',
10
+ 'OLD',
11
+ 'NEW_AND_CHECK',
12
+ 'OLD_AND_CHECK',
13
+ ]);
14
+
8
15
  export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
9
16
  exampleConsistencyCheckFeature: 'OLD',
10
17
  exampleFeature: false,
@@ -21,6 +28,7 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
21
28
  conditionalBundlingNestedRuntime: false,
22
29
  patchProjectPaths: false,
23
30
  cachePerformanceImprovements: process.env.NODE_ENV === 'test',
31
+ environmentDeduplication: false,
24
32
  granularTsConfigInvalidation: false,
25
33
  inlineStringReplacementPerf: false,
26
34
  conditionalBundlingAsyncRuntime: false,
@@ -29,6 +37,7 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
29
37
  conditionalBundlingReporterDuplicateFix: false,
30
38
  resolveBundlerConfigFromCwd: false,
31
39
  conditionalBundlingReporterSameConditionFix: false,
40
+ condbHtmlPackagerChange: false,
32
41
  };
33
42
 
34
43
  let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS};
package/src/types.js CHANGED
@@ -48,6 +48,10 @@ export type FeatureFlags = {|
48
48
  * - Reduce size of the caches by deduplicating data
49
49
  */
50
50
  cachePerformanceImprovements: boolean,
51
+ /**
52
+ * Deduplicates environments across cache / memory entities
53
+ */
54
+ environmentDeduplication: boolean,
51
55
  /**
52
56
  * Enable scanning for the presence of loadable to determine side effects
53
57
  */
@@ -94,12 +98,16 @@ export type FeatureFlags = {|
94
98
  * Fix a bug where the conditional manifest reporter would drop bundles that have the same condition
95
99
  */
96
100
  conditionalBundlingReporterSameConditionFix: boolean,
101
+ /**
102
+ * Enable a change to the html packager to load more bundles when conditional bundling fallback mode is enabled
103
+ */
104
+ condbHtmlPackagerChange: boolean,
97
105
  |};
98
106
 
99
- export type ConsistencyCheckFeatureFlagValue =
100
- | 'NEW'
101
- | 'OLD'
102
- | 'NEW_AND_CHECK'
103
- | 'OLD_AND_CHECK';
107
+ declare export var CONSISTENCY_CHECK_VALUES: $ReadOnlyArray<string>;
108
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<
109
+ typeof CONSISTENCY_CHECK_VALUES,
110
+ number,
111
+ >;
104
112
 
105
113
  declare export var DEFAULT_FEATURE_FLAGS: FeatureFlags;