@parcel/feature-flags
Advanced tools
Comparing version 2.12.1-dev.3238 to 2.12.1-dev.3260
@@ -7,6 +7,20 @@ "use strict"; | ||
exports.DEFAULT_FEATURE_FLAGS = void 0; | ||
exports.getFeatureFlag = getFeatureFlag; | ||
exports.setFeatureFlags = setFeatureFlags; | ||
// We need to do these gymnastics as we don't want flow-to-ts to touch DEFAULT_FEATURE_FLAGS, | ||
// but we want to export FeatureFlags for Flow | ||
const DEFAULT_FEATURE_FLAGS = exports.DEFAULT_FEATURE_FLAGS = { | ||
exampleFeature: false | ||
}; | ||
exampleFeature: false, | ||
configKeyInvalidation: false, | ||
parcelV3: false, | ||
dfsFasterRefactor: false | ||
}; | ||
let featureFlagValues = { | ||
...DEFAULT_FEATURE_FLAGS | ||
}; | ||
function setFeatureFlags(flags) { | ||
featureFlagValues = flags; | ||
} | ||
function getFeatureFlag(flagName) { | ||
return featureFlagValues[flagName]; | ||
} |
export type FeatureFlags = { | ||
// This feature flag mostly exists to test the feature flag system, and doesn't have any build/runtime effect | ||
readonly exampleFeature: boolean; | ||
/** | ||
* Enables content hash based invalidation for config keys used in plugins. | ||
* This allows Assets not to be invalidated when using | ||
* `config.getConfigFrom(..., {packageKey: '...'})` and the value itself hasn't changed. | ||
*/ | ||
readonly configKeyInvalidation: boolean; | ||
/** | ||
* Refactors dfsNew to use an iterative approach. | ||
*/ | ||
readonly dfsFasterRefactor: boolean; | ||
/** | ||
* Rust backed requests | ||
*/ | ||
readonly parcelV3: boolean; | ||
}; |
{ | ||
"name": "@parcel/feature-flags", | ||
"version": "2.12.1-dev.3238+7f6b4dbbc", | ||
"description": "Blazing fast, zero configuration web application bundler", | ||
"version": "2.12.1-dev.3260+339350eb3", | ||
"description": "Provides internal feature-flags for the parcel codebase.", | ||
"license": "MIT", | ||
@@ -27,3 +27,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "7f6b4dbbc56a203e0fce8794856c03598c4f6708" | ||
"gitHead": "339350eb31fd33849cb1efe5fd7ad2cb096319f0" | ||
} |
@@ -10,2 +10,15 @@ // @flow strict | ||
exampleFeature: false, | ||
configKeyInvalidation: false, | ||
parcelV3: false, | ||
dfsFasterRefactor: false, | ||
}; | ||
let featureFlagValues: FeatureFlags = {...DEFAULT_FEATURE_FLAGS}; | ||
export function setFeatureFlags(flags: FeatureFlags) { | ||
featureFlagValues = flags; | ||
} | ||
export function getFeatureFlag(flagName: $Keys<FeatureFlags>): boolean { | ||
return featureFlagValues[flagName]; | ||
} |
@@ -6,2 +6,16 @@ // @flow strict | ||
+exampleFeature: boolean, | ||
/** | ||
* Enables content hash based invalidation for config keys used in plugins. | ||
* This allows Assets not to be invalidated when using | ||
* `config.getConfigFrom(..., {packageKey: '...'})` and the value itself hasn't changed. | ||
*/ | ||
+configKeyInvalidation: boolean, | ||
/** | ||
* Refactors dfsNew to use an iterative approach. | ||
*/ | ||
+dfsFasterRefactor: boolean, | ||
/** | ||
* Rust backed requests | ||
*/ | ||
+parcelV3: boolean, | ||
|}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
5041
8
96