@atlaspack/feature-flags 2.14.1-dev.15 → 2.14.1-dev.161

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,104 @@
1
1
  # @atlaspack/feature-flags
2
2
 
3
+ ## 2.18.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#652](https://github.com/atlassian-labs/atlaspack/pull/652) [`644b157`](https://github.com/atlassian-labs/atlaspack/commit/644b157dee72a871acc2d0facf0b87b8eea51956) Thanks [@yamadapc](https://github.com/yamadapc)! - Fix bugs related to build aborts. Builds and cache writes will no longer be aborted.
8
+
9
+ ## 2.18.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#633](https://github.com/atlassian-labs/atlaspack/pull/633) [`26aa9c5`](https://github.com/atlassian-labs/atlaspack/commit/26aa9c599d2be45ce1438a74c5fa22f39b9b554b) Thanks [@sbhuiyan-atlassian](https://github.com/sbhuiyan-atlassian)! - Ported various HMR changes from Parcel
14
+
15
+ - [#626](https://github.com/atlassian-labs/atlaspack/pull/626) [`0501255`](https://github.com/atlassian-labs/atlaspack/commit/05012550da35b05ce7d356a8cc29311e7f9afdca) Thanks [@yamadapc](https://github.com/yamadapc)! - Clean-up tsconfig invalidation improvements feature-flag
16
+
17
+ ## 2.18.0
18
+
19
+ ### Minor Changes
20
+
21
+ - [#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`
22
+
23
+ ### Patch Changes
24
+
25
+ - [#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:
26
+
27
+ - 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.
28
+ - 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.
29
+
30
+ ## 2.17.0
31
+
32
+ ### Minor Changes
33
+
34
+ - [#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
35
+
36
+ ### Patch Changes
37
+
38
+ - [#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
39
+
40
+ ## 2.16.0
41
+
42
+ ### Minor Changes
43
+
44
+ - [#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.
45
+
46
+ This will enable patterns like:
47
+
48
+ ```
49
+ import type { FeatureFlags } from '@atlaspack/feature-flags';
50
+ import { DEFAULT_FEATURE_FLAGS } from '@atlaspack/feature-flags';
51
+ ```
52
+
53
+ ### Patch Changes
54
+
55
+ - [#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
56
+
57
+ ## 2.15.1
58
+
59
+ ### Patch Changes
60
+
61
+ - [#551](https://github.com/atlassian-labs/atlaspack/pull/551) [`30f6017`](https://github.com/atlassian-labs/atlaspack/commit/30f60175ba4d272c5fc193973c63bc298584775b) Thanks [@yamadapc](https://github.com/yamadapc)! - Log request tracker invalidation counts on start-up
62
+
63
+ ## 2.15.0
64
+
65
+ ### Minor Changes
66
+
67
+ - [#547](https://github.com/atlassian-labs/atlaspack/pull/547) [`a1773d2`](https://github.com/atlassian-labs/atlaspack/commit/a1773d2a62d0ef7805ac7524621dcabcc1afe929) Thanks [@benjervis](https://github.com/benjervis)! - Add a feature flag for resolving the configuration for `@atlaspack/bundler-default` from CWD, rather than exclusively from the project root.
68
+
69
+ ## 2.14.4
70
+
71
+ ### Patch Changes
72
+
73
+ - [#542](https://github.com/atlassian-labs/atlaspack/pull/542) [`e0f5337`](https://github.com/atlassian-labs/atlaspack/commit/e0f533757bd1019dbd108a04952c87da15286e09) Thanks [@yamadapc](https://github.com/yamadapc)! - Add feature-flagged option to use rayon thread-pool to optimize inline requires
74
+
75
+ ## 2.14.3
76
+
77
+ ### Patch Changes
78
+
79
+ - [#511](https://github.com/atlassian-labs/atlaspack/pull/511) [`11d6f16`](https://github.com/atlassian-labs/atlaspack/commit/11d6f16b6397dee2f217167e5c98b39edb63f7a7) Thanks [@yamadapc](https://github.com/yamadapc)! - Clean-up dylib worker threads segmentation fault bug fix feature-flag
80
+
81
+ ## 2.14.2
82
+
83
+ ### Patch Changes
84
+
85
+ - [#494](https://github.com/atlassian-labs/atlaspack/pull/494) [`9b85d3e`](https://github.com/atlassian-labs/atlaspack/commit/9b85d3e645b10bd027eed2304afc970a5ba40062) Thanks [@JakeLane](https://github.com/JakeLane)! - When conditionalBundlingReporterDuplicateFix is enabled, avoid duplicated writes to the descriptor and logging
86
+
87
+ - [#510](https://github.com/atlassian-labs/atlaspack/pull/510) [`17b9579`](https://github.com/atlassian-labs/atlaspack/commit/17b9579484eced0ed8f23e2aba6d23b3c7238c39) Thanks [@yamadapc](https://github.com/yamadapc)! - Add unused feature-flag for cache rework changes
88
+
89
+ - [#512](https://github.com/atlassian-labs/atlaspack/pull/512) [`8f4e6c1`](https://github.com/atlassian-labs/atlaspack/commit/8f4e6c1b0e7c1fd48624afda48c1dcc599f1460f) Thanks [@yamadapc](https://github.com/yamadapc)! - Remove LMDB cache back-end
90
+
91
+ ## 2.14.1
92
+
93
+ ### Patch Changes
94
+
95
+ - [#388](https://github.com/atlassian-labs/atlaspack/pull/388) [`4aab060`](https://github.com/atlassian-labs/atlaspack/commit/4aab0605c0d4ee8e0dcc3ffa1162eae5b360b677) Thanks [@yamadapc](https://github.com/yamadapc)! - Set LMDB.js Lite as the default cache back-end
96
+
97
+ - [#420](https://github.com/atlassian-labs/atlaspack/pull/420) [`e1422ad`](https://github.com/atlassian-labs/atlaspack/commit/e1422ad0a801faaa4bc4f1023bed042ffe236e9b) Thanks [@JakeLane](https://github.com/JakeLane)! - Support async script runtime in conditional bundling
98
+
99
+ - [#478](https://github.com/atlassian-labs/atlaspack/pull/478) [`570493b`](https://github.com/atlassian-labs/atlaspack/commit/570493beaf754e7985aebc7daaaf6dfcfa8fe56b) Thanks [@yamadapc](https://github.com/yamadapc)! - The first attempt at Version Packages didn't include the built artifacts.
100
+ This has hopefully been fixed, so this change will force those packages to re-release.
101
+
3
102
  ## 2.14.0
4
103
 
5
104
  ### 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,
@@ -17,15 +18,28 @@ const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = {
17
18
  useWatchmanWatcher: false,
18
19
  importRetry: false,
19
20
  fixQuadraticCacheInvalidation: 'OLD',
20
- useLmdbJsLite: false,
21
21
  conditionalBundlingApi: false,
22
+ inlineRequiresMultiThreading: false,
22
23
  vcsMode: 'OLD',
23
24
  loadableSideEffects: false,
24
25
  reduceResolverStringCreation: false,
25
26
  inlineBundlesSourceMapFixes: false,
26
27
  conditionalBundlingNestedRuntime: false,
27
28
  patchProjectPaths: false,
28
- inlineStringReplacementPerf: false
29
+ cachePerformanceImprovements: process.env.NODE_ENV === 'test',
30
+ environmentDeduplication: false,
31
+ inlineStringReplacementPerf: false,
32
+ conditionalBundlingAsyncRuntime: false,
33
+ fixBuildAbortCorruption: false,
34
+ // Default to true as it's a monitoring change. Can be turned off if necessary.
35
+ verboseRequestInvalidationStats: true,
36
+ conditionalBundlingReporterDuplicateFix: false,
37
+ resolveBundlerConfigFromCwd: false,
38
+ conditionalBundlingReporterSameConditionFix: false,
39
+ condbHtmlPackagerChange: false,
40
+ applyScopeHoistingImprovement: false,
41
+ inlineConstOptimisationFix: false,
42
+ hmrImprovements: false
29
43
  };
30
44
  let featureFlagValues = {
31
45
  ...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;
@@ -18,11 +19,6 @@ export type FeatureFlags = {
18
19
  */
19
20
  importRetry: boolean;
20
21
 
21
- /**
22
- * Enable Rust based LMDB wrapper library
23
- */
24
- useLmdbJsLite: boolean;
25
-
26
22
  /**
27
23
  * Fixes quadratic cache invalidation issue
28
24
  */
@@ -35,6 +31,16 @@ export type FeatureFlags = {
35
31
  */
36
32
  conditionalBundlingApi: boolean;
37
33
 
34
+ /**
35
+ * Run inline requires optimizer in the rayon thread pool.
36
+ */
37
+ inlineRequiresMultiThreading: boolean;
38
+
39
+ /**
40
+ * Disables aborting of builds and fixes bugs related to state corruption on abort.
41
+ */
42
+ fixBuildAbortCorruption: boolean;
43
+
38
44
  /**
39
45
  * Enable VCS mode. Expected values are:
40
46
  * - OLD - default value, return watchman result
@@ -43,6 +49,19 @@ export type FeatureFlags = {
43
49
  */
44
50
  vcsMode: ConsistencyCheckFeatureFlagValue;
45
51
 
52
+ /**
53
+ * Refactor cache to:
54
+ * - Split writes into multiple entries
55
+ * - Remove "large file blob" writes
56
+ * - Reduce size of the caches by deduplicating data
57
+ */
58
+ cachePerformanceImprovements: boolean;
59
+
60
+ /**
61
+ * Deduplicates environments across cache / memory entities
62
+ */
63
+ environmentDeduplication: boolean;
64
+
46
65
  /**
47
66
  * Enable scanning for the presence of loadable to determine side effects
48
67
  */
@@ -54,6 +73,11 @@ export type FeatureFlags = {
54
73
  */
55
74
  reduceResolverStringCreation: boolean;
56
75
 
76
+ /**
77
+ * Add verbose metrics for request tracker invalidation
78
+ */
79
+ verboseRequestInvalidationStats: boolean;
80
+
57
81
  /**
58
82
  * Fixes source maps for inline bundles
59
83
  */
@@ -74,5 +98,50 @@ export type FeatureFlags = {
74
98
  * Used heavily for inline bundles.
75
99
  */
76
100
  inlineStringReplacementPerf: boolean;
101
+
102
+ /**
103
+ * Enable support for the async bundle runtime (unstable_asyncBundleRuntime) in conditional bundling
104
+ */
105
+ conditionalBundlingAsyncRuntime: boolean;
106
+
107
+ /**
108
+ * Fix a bug where the conditional manifest reporter would report and write the same manifest multiple times
109
+ */
110
+ conditionalBundlingReporterDuplicateFix: boolean;
111
+
112
+ /**
113
+ * Enable resolution of bundler config starting from the CWD
114
+ */
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;
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;
137
+
138
+ /**
139
+ * Improves/fixes HMR behaviour by:
140
+ * - Fixing HMR behaviour with lazy bundle edges
141
+ * - Moving the functionality of the react-refresh runtime into the react-refresh-wrap transformer
142
+ */
143
+ hmrImprovements: boolean;
77
144
  };
78
- export type ConsistencyCheckFeatureFlagValue = "NEW" | "OLD" | "NEW_AND_CHECK" | "OLD_AND_CHECK";
145
+ export declare var CONSISTENCY_CHECK_VALUES: ReadonlyArray<string>;
146
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<typeof CONSISTENCY_CHECK_VALUES, number>;
147
+ 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.14.1-dev.15+30b65feb9",
3
+ "version": "2.14.1-dev.161+207d003c0",
4
4
  "description": "Provides internal feature-flags for the atlaspack codebase.",
5
5
  "license": "(MIT OR Apache-2.0)",
6
6
  "publishConfig": {
@@ -21,5 +21,5 @@
21
21
  "node": ">= 16.0.0"
22
22
  },
23
23
  "type": "commonjs",
24
- "gitHead": "30b65feb98113722e721c7cdee547765d195b65a"
24
+ "gitHead": "207d003c0f1d4ffa6a1c52d2f8841d998616c523"
25
25
  }
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,
@@ -12,15 +19,28 @@ export const DEFAULT_FEATURE_FLAGS: FeatureFlags = {
12
19
  useWatchmanWatcher: false,
13
20
  importRetry: false,
14
21
  fixQuadraticCacheInvalidation: 'OLD',
15
- useLmdbJsLite: false,
16
22
  conditionalBundlingApi: false,
23
+ inlineRequiresMultiThreading: false,
17
24
  vcsMode: 'OLD',
18
25
  loadableSideEffects: false,
19
26
  reduceResolverStringCreation: false,
20
27
  inlineBundlesSourceMapFixes: false,
21
28
  conditionalBundlingNestedRuntime: false,
22
29
  patchProjectPaths: false,
30
+ cachePerformanceImprovements: process.env.NODE_ENV === 'test',
31
+ environmentDeduplication: false,
23
32
  inlineStringReplacementPerf: false,
33
+ conditionalBundlingAsyncRuntime: false,
34
+ fixBuildAbortCorruption: false,
35
+ // Default to true as it's a monitoring change. Can be turned off if necessary.
36
+ verboseRequestInvalidationStats: true,
37
+ conditionalBundlingReporterDuplicateFix: false,
38
+ resolveBundlerConfigFromCwd: false,
39
+ conditionalBundlingReporterSameConditionFix: false,
40
+ condbHtmlPackagerChange: false,
41
+ applyScopeHoistingImprovement: false,
42
+ inlineConstOptimisationFix: false,
43
+ hmrImprovements: false,
24
44
  };
25
45
 
26
46
  let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS};
package/src/types.js CHANGED
@@ -16,10 +16,6 @@ export type FeatureFlags = {|
16
16
  * Configure runtime to enable retriable dynamic imports
17
17
  */
18
18
  importRetry: boolean,
19
- /**
20
- * Enable Rust based LMDB wrapper library
21
- */
22
- useLmdbJsLite: boolean,
23
19
  /**
24
20
  * Fixes quadratic cache invalidation issue
25
21
  */
@@ -30,6 +26,14 @@ export type FeatureFlags = {|
30
26
  * and requires server-side support.
31
27
  */
32
28
  conditionalBundlingApi: boolean,
29
+ /**
30
+ * Run inline requires optimizer in the rayon thread pool.
31
+ */
32
+ inlineRequiresMultiThreading: boolean,
33
+ /**
34
+ * Disables aborting of builds and fixes bugs related to state corruption on abort.
35
+ */
36
+ fixBuildAbortCorruption: boolean,
33
37
  /**
34
38
  * Enable VCS mode. Expected values are:
35
39
  * - OLD - default value, return watchman result
@@ -37,6 +41,17 @@ export type FeatureFlags = {|
37
41
  * - NEW: Return VCS result, but don't call watchman
38
42
  */
39
43
  vcsMode: ConsistencyCheckFeatureFlagValue,
44
+ /**
45
+ * Refactor cache to:
46
+ * - Split writes into multiple entries
47
+ * - Remove "large file blob" writes
48
+ * - Reduce size of the caches by deduplicating data
49
+ */
50
+ cachePerformanceImprovements: boolean,
51
+ /**
52
+ * Deduplicates environments across cache / memory entities
53
+ */
54
+ environmentDeduplication: boolean,
40
55
  /**
41
56
  * Enable scanning for the presence of loadable to determine side effects
42
57
  */
@@ -46,6 +61,10 @@ export type FeatureFlags = {|
46
61
  * conversions
47
62
  */
48
63
  reduceResolverStringCreation: boolean,
64
+ /**
65
+ * Add verbose metrics for request tracker invalidation
66
+ */
67
+ verboseRequestInvalidationStats: boolean,
49
68
  /**
50
69
  * Fixes source maps for inline bundles
51
70
  */
@@ -58,16 +77,52 @@ export type FeatureFlags = {|
58
77
  * This feature is experimental and should not be used in production. It will used to test downloadble cache artefacts.
59
78
  */
60
79
  patchProjectPaths: boolean,
61
-
62
80
  /**
63
81
  * Enables optimized inline string replacement perf for the packager.
64
82
  * Used heavily for inline bundles.
65
83
  */
66
84
  inlineStringReplacementPerf: boolean,
85
+ /**
86
+ * Enable support for the async bundle runtime (unstable_asyncBundleRuntime) in conditional bundling
87
+ */
88
+ conditionalBundlingAsyncRuntime: boolean,
89
+ /**
90
+ * Fix a bug where the conditional manifest reporter would report and write the same manifest multiple times
91
+ */
92
+ conditionalBundlingReporterDuplicateFix: boolean,
93
+ /**
94
+ * Enable resolution of bundler config starting from the CWD
95
+ */
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,
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,
114
+ /**
115
+ * Improves/fixes HMR behaviour by:
116
+ * - Fixing HMR behaviour with lazy bundle edges
117
+ * - Moving the functionality of the react-refresh runtime into the react-refresh-wrap transformer
118
+ */
119
+ hmrImprovements: boolean,
67
120
  |};
68
121
 
69
- export type ConsistencyCheckFeatureFlagValue =
70
- | 'NEW'
71
- | 'OLD'
72
- | 'NEW_AND_CHECK'
73
- | 'OLD_AND_CHECK';
122
+ declare export var CONSISTENCY_CHECK_VALUES: $ReadOnlyArray<string>;
123
+ export type ConsistencyCheckFeatureFlagValue = $ElementType<
124
+ typeof CONSISTENCY_CHECK_VALUES,
125
+ number,
126
+ >;
127
+
128
+ declare export var DEFAULT_FEATURE_FLAGS: FeatureFlags;