@atlaspack/feature-flags 2.16.0 → 2.18.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,28 @@
1
1
  # @atlaspack/feature-flags
2
2
 
3
+ ## 2.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#627](https://github.com/atlassian-labs/atlaspack/pull/627) [`85c52d3`](https://github.com/atlassian-labs/atlaspack/commit/85c52d3f7717b3c84a118d18ab98cfbfd71dcbd2) Thanks [@benjervis](https://github.com/benjervis)! - Adds a feature flag for `applyScopeHoistingImprovement`
8
+
9
+ ### Patch Changes
10
+
11
+ - [#632](https://github.com/atlassian-labs/atlaspack/pull/632) [`10fbcfb`](https://github.com/atlassian-labs/atlaspack/commit/10fbcfbfa49c7a83da5d7c40983e36e87f524a75) Thanks [@marcins](https://github.com/marcins)! - Added a new feature flag `inlineConstOptimisationFix` which when enabled changes the behaviour for output of constant modules. This fixes two issues with constant modules:
12
+
13
+ - Previously constant modules, if they needed a namespace anywhere, would have a namespace everywhere, with this change they only have a namespace in the bundles where needed.
14
+ - Previously in the case of wrapped assets, a constant module dependnecy of that wrapped asset would be rendered after the module - which meant the minifier would not be able to inline the constants safely. With this flag all constant modules are rendered at the top of the bundle.
15
+
16
+ ## 2.17.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#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
21
+
22
+ ### Patch Changes
23
+
24
+ - [#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
25
+
3
26
  ## 2.16.0
4
27
 
5
28
  ### 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,10 @@ 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,
40
+ applyScopeHoistingImprovement: false,
41
+ inlineConstOptimisationFix: false
37
42
  };
38
43
  let featureFlagValues = {
39
44
  ...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,23 @@ 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;
126
+
127
+ /**
128
+ * Enable a setting that allows for more assets to be scope hoisted, if
129
+ * they're safe to do so.
130
+ */
131
+ applyScopeHoistingImprovement: boolean;
132
+
133
+ /**
134
+ * Enable a change where a constant module only have the namespacing object added in bundles where it is required
135
+ */
136
+ inlineConstOptimisationFix: boolean;
115
137
  };
116
- export type ConsistencyCheckFeatureFlagValue = "NEW" | "OLD" | "NEW_AND_CHECK" | "OLD_AND_CHECK";
138
+ export declare var CONSISTENCY_CHECK_VALUES: ReadonlyArray<string>;
139
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<typeof CONSISTENCY_CHECK_VALUES, number>;
117
140
  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.18.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,9 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
29
37
  conditionalBundlingReporterDuplicateFix: false,
30
38
  resolveBundlerConfigFromCwd: false,
31
39
  conditionalBundlingReporterSameConditionFix: false,
40
+ condbHtmlPackagerChange: false,
41
+ applyScopeHoistingImprovement: false,
42
+ inlineConstOptimisationFix: false,
32
43
  };
33
44
 
34
45
  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,25 @@ 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,
105
+ /**
106
+ * Enable a setting that allows for more assets to be scope hoisted, if
107
+ * they're safe to do so.
108
+ */
109
+ applyScopeHoistingImprovement: boolean,
110
+ /**
111
+ * Enable a change where a constant module only have the namespacing object added in bundles where it is required
112
+ */
113
+ inlineConstOptimisationFix: boolean,
97
114
  |};
98
115
 
99
- export type ConsistencyCheckFeatureFlagValue =
100
- | 'NEW'
101
- | 'OLD'
102
- | 'NEW_AND_CHECK'
103
- | 'OLD_AND_CHECK';
116
+ declare export var CONSISTENCY_CHECK_VALUES: $ReadOnlyArray<string>;
117
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<
118
+ typeof CONSISTENCY_CHECK_VALUES,
119
+ number,
120
+ >;
104
121
 
105
122
  declare export var DEFAULT_FEATURE_FLAGS: FeatureFlags;