@atlaspack/feature-flags 2.15.1 → 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 +27 -0
- package/lib/index.js +8 -3
- package/lib/types.d.ts +24 -1
- package/package.json +1 -1
- package/src/index.js +12 -1
- package/src/types.js +23 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
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
|
+
|
|
13
|
+
## 2.16.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- [#582](https://github.com/atlassian-labs/atlaspack/pull/582) [`f4da1e1`](https://github.com/atlassian-labs/atlaspack/commit/f4da1e120e73eeb5e8b8927f05e88f04d6148c7b) Thanks [@matt-koko](https://github.com/matt-koko)! - Export DEFAULT_FEATURE_FLAGS so it will be included in the associate type declaration file and able to be imported elsewhere.
|
|
18
|
+
|
|
19
|
+
This will enable patterns like:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
import type { FeatureFlags } from '@atlaspack/feature-flags';
|
|
23
|
+
import { DEFAULT_FEATURE_FLAGS } from '@atlaspack/feature-flags';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#503](https://github.com/atlassian-labs/atlaspack/pull/503) [`209692f`](https://github.com/atlassian-labs/atlaspack/commit/209692ffb11eae103a0d65c5e1118a5aa1625818) Thanks [@JakeLane](https://github.com/JakeLane)! - Fix conditional bundling reporter when condition is reused
|
|
29
|
+
|
|
3
30
|
## 2.15.1
|
|
4
31
|
|
|
5
32
|
### Patch 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,
|
|
@@ -25,13 +26,17 @@ const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
|
|
|
25
26
|
inlineBundlesSourceMapFixes: false,
|
|
26
27
|
conditionalBundlingNestedRuntime: false,
|
|
27
28
|
patchProjectPaths: false,
|
|
28
|
-
cachePerformanceImprovements:
|
|
29
|
+
cachePerformanceImprovements: process.env.NODE_ENV === 'test',
|
|
30
|
+
environmentDeduplication: false,
|
|
31
|
+
granularTsConfigInvalidation: false,
|
|
29
32
|
inlineStringReplacementPerf: false,
|
|
30
33
|
conditionalBundlingAsyncRuntime: false,
|
|
31
34
|
// Default to true as it's a monitoring change. Can be turned off if necessary.
|
|
32
35
|
verboseRequestInvalidationStats: true,
|
|
33
36
|
conditionalBundlingReporterDuplicateFix: false,
|
|
34
|
-
resolveBundlerConfigFromCwd: false
|
|
37
|
+
resolveBundlerConfigFromCwd: false,
|
|
38
|
+
conditionalBundlingReporterSameConditionFix: false,
|
|
39
|
+
condbHtmlPackagerChange: false
|
|
35
40
|
};
|
|
36
41
|
let featureFlagValues = {
|
|
37
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;
|
|
@@ -43,6 +44,11 @@ export type FeatureFlags = {
|
|
|
43
44
|
*/
|
|
44
45
|
vcsMode: ConsistencyCheckFeatureFlagValue;
|
|
45
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Enable granular TS config invalidation
|
|
49
|
+
*/
|
|
50
|
+
granularTsConfigInvalidation: boolean;
|
|
51
|
+
|
|
46
52
|
/**
|
|
47
53
|
* Refactor cache to:
|
|
48
54
|
* - Split writes into multiple entries
|
|
@@ -51,6 +57,11 @@ export type FeatureFlags = {
|
|
|
51
57
|
*/
|
|
52
58
|
cachePerformanceImprovements: boolean;
|
|
53
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Deduplicates environments across cache / memory entities
|
|
62
|
+
*/
|
|
63
|
+
environmentDeduplication: boolean;
|
|
64
|
+
|
|
54
65
|
/**
|
|
55
66
|
* Enable scanning for the presence of loadable to determine side effects
|
|
56
67
|
*/
|
|
@@ -102,5 +113,17 @@ export type FeatureFlags = {
|
|
|
102
113
|
* Enable resolution of bundler config starting from the CWD
|
|
103
114
|
*/
|
|
104
115
|
resolveBundlerConfigFromCwd: boolean;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Fix a bug where the conditional manifest reporter would drop bundles that have the same condition
|
|
119
|
+
*/
|
|
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;
|
|
105
126
|
};
|
|
106
|
-
export
|
|
127
|
+
export declare var CONSISTENCY_CHECK_VALUES: ReadonlyArray<string>;
|
|
128
|
+
export type ConsistencyCheckFeatureFlagValue = $ElementType<typeof CONSISTENCY_CHECK_VALUES, number>;
|
|
129
|
+
export declare var DEFAULT_FEATURE_FLAGS: FeatureFlags;
|
package/package.json
CHANGED
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,
|
|
@@ -20,13 +27,17 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
|
|
|
20
27
|
inlineBundlesSourceMapFixes: false,
|
|
21
28
|
conditionalBundlingNestedRuntime: false,
|
|
22
29
|
patchProjectPaths: false,
|
|
23
|
-
cachePerformanceImprovements:
|
|
30
|
+
cachePerformanceImprovements: process.env.NODE_ENV === 'test',
|
|
31
|
+
environmentDeduplication: false,
|
|
32
|
+
granularTsConfigInvalidation: false,
|
|
24
33
|
inlineStringReplacementPerf: false,
|
|
25
34
|
conditionalBundlingAsyncRuntime: false,
|
|
26
35
|
// Default to true as it's a monitoring change. Can be turned off if necessary.
|
|
27
36
|
verboseRequestInvalidationStats: true,
|
|
28
37
|
conditionalBundlingReporterDuplicateFix: false,
|
|
29
38
|
resolveBundlerConfigFromCwd: false,
|
|
39
|
+
conditionalBundlingReporterSameConditionFix: false,
|
|
40
|
+
condbHtmlPackagerChange: false,
|
|
30
41
|
};
|
|
31
42
|
|
|
32
43
|
let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS};
|
package/src/types.js
CHANGED
|
@@ -37,6 +37,10 @@ export type FeatureFlags = {|
|
|
|
37
37
|
* - NEW: Return VCS result, but don't call watchman
|
|
38
38
|
*/
|
|
39
39
|
vcsMode: ConsistencyCheckFeatureFlagValue,
|
|
40
|
+
/**
|
|
41
|
+
* Enable granular TS config invalidation
|
|
42
|
+
*/
|
|
43
|
+
granularTsConfigInvalidation: boolean,
|
|
40
44
|
/**
|
|
41
45
|
* Refactor cache to:
|
|
42
46
|
* - Split writes into multiple entries
|
|
@@ -44,6 +48,10 @@ export type FeatureFlags = {|
|
|
|
44
48
|
* - Reduce size of the caches by deduplicating data
|
|
45
49
|
*/
|
|
46
50
|
cachePerformanceImprovements: boolean,
|
|
51
|
+
/**
|
|
52
|
+
* Deduplicates environments across cache / memory entities
|
|
53
|
+
*/
|
|
54
|
+
environmentDeduplication: boolean,
|
|
47
55
|
/**
|
|
48
56
|
* Enable scanning for the presence of loadable to determine side effects
|
|
49
57
|
*/
|
|
@@ -86,10 +94,20 @@ export type FeatureFlags = {|
|
|
|
86
94
|
* Enable resolution of bundler config starting from the CWD
|
|
87
95
|
*/
|
|
88
96
|
resolveBundlerConfigFromCwd: boolean,
|
|
97
|
+
/**
|
|
98
|
+
* Fix a bug where the conditional manifest reporter would drop bundles that have the same condition
|
|
99
|
+
*/
|
|
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,
|
|
89
105
|
|};
|
|
90
106
|
|
|
91
|
-
export
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
107
|
+
declare export var CONSISTENCY_CHECK_VALUES: $ReadOnlyArray<string>;
|
|
108
|
+
export type ConsistencyCheckFeatureFlagValue = $ElementType<
|
|
109
|
+
typeof CONSISTENCY_CHECK_VALUES,
|
|
110
|
+
number,
|
|
111
|
+
>;
|
|
112
|
+
|
|
113
|
+
declare export var DEFAULT_FEATURE_FLAGS: FeatureFlags;
|