@atlaskit/platform-feature-flags
Advanced tools
Comparing version 0.2.2 to 0.2.3
# @atlaskit/platform-feature-flags | ||
## 0.2.3 | ||
### Patch Changes | ||
- [`71902efa32d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/71902efa32d) - Added logging for any feature flags that are called before the platform feature flags resolver is created | ||
## 0.2.2 | ||
@@ -4,0 +10,0 @@ |
@@ -24,3 +24,11 @@ "use strict"; | ||
var ENABLE_GLOBAL_PLATFORM_FF_OVERRIDE = ENV_ENABLE_PLATFORM_FF || ENV_STORYBOOK_ENABLE_PLATFORM_FF; | ||
var booleanResolver = function booleanResolver() { | ||
// In development mode we want to capture any feature flag checks that happen using the default resolver and log this result when the resolver is replaced. | ||
// This is because evaluating feature flags when the resolver/FF client is loaded asynchronously could cause unexpected issues. | ||
var flagsResolvedEarly = new Map(); | ||
var booleanResolver = function booleanResolver(flagKey) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
var _flagsResolvedEarly$g; | ||
var unresolvedFlagCount = (_flagsResolvedEarly$g = flagsResolvedEarly.get(flagKey)) !== null && _flagsResolvedEarly$g !== void 0 ? _flagsResolvedEarly$g : 0; | ||
flagsResolvedEarly.set(flagKey, unresolvedFlagCount + 1); | ||
} | ||
return false; | ||
@@ -30,2 +38,8 @@ }; | ||
booleanResolver = resolver; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (flagsResolvedEarly.size > 0) { | ||
(0, _debug.debug)("[%s]: The following list of Feature Flags were called, the following number of times, before setBooleanResolver.", pkgName, Array.from(flagsResolvedEarly.entries())); | ||
flagsResolvedEarly.clear(); | ||
} | ||
} | ||
} | ||
@@ -32,0 +46,0 @@ function resolveBooleanFlag(flagKey) { |
{ | ||
"name": "@atlaskit/platform-feature-flags", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"sideEffects": false | ||
} |
@@ -17,5 +17,21 @@ import { debug } from './debug'; | ||
const ENABLE_GLOBAL_PLATFORM_FF_OVERRIDE = ENV_ENABLE_PLATFORM_FF || ENV_STORYBOOK_ENABLE_PLATFORM_FF; | ||
let booleanResolver = () => false; | ||
// In development mode we want to capture any feature flag checks that happen using the default resolver and log this result when the resolver is replaced. | ||
// This is because evaluating feature flags when the resolver/FF client is loaded asynchronously could cause unexpected issues. | ||
const flagsResolvedEarly = new Map(); | ||
let booleanResolver = flagKey => { | ||
if (process.env.NODE_ENV !== 'production') { | ||
var _flagsResolvedEarly$g; | ||
const unresolvedFlagCount = (_flagsResolvedEarly$g = flagsResolvedEarly.get(flagKey)) !== null && _flagsResolvedEarly$g !== void 0 ? _flagsResolvedEarly$g : 0; | ||
flagsResolvedEarly.set(flagKey, unresolvedFlagCount + 1); | ||
} | ||
return false; | ||
}; | ||
export function setBooleanResolver(resolver) { | ||
booleanResolver = resolver; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (flagsResolvedEarly.size > 0) { | ||
debug(`[%s]: The following list of Feature Flags were called, the following number of times, before setBooleanResolver.`, pkgName, Array.from(flagsResolvedEarly.entries())); | ||
flagsResolvedEarly.clear(); | ||
} | ||
} | ||
} | ||
@@ -22,0 +38,0 @@ export function resolveBooleanFlag(flagKey) { |
{ | ||
"name": "@atlaskit/platform-feature-flags", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"sideEffects": false | ||
} |
@@ -17,3 +17,11 @@ import { debug } from './debug'; | ||
var ENABLE_GLOBAL_PLATFORM_FF_OVERRIDE = ENV_ENABLE_PLATFORM_FF || ENV_STORYBOOK_ENABLE_PLATFORM_FF; | ||
var booleanResolver = function booleanResolver() { | ||
// In development mode we want to capture any feature flag checks that happen using the default resolver and log this result when the resolver is replaced. | ||
// This is because evaluating feature flags when the resolver/FF client is loaded asynchronously could cause unexpected issues. | ||
var flagsResolvedEarly = new Map(); | ||
var booleanResolver = function booleanResolver(flagKey) { | ||
if (process.env.NODE_ENV !== 'production') { | ||
var _flagsResolvedEarly$g; | ||
var unresolvedFlagCount = (_flagsResolvedEarly$g = flagsResolvedEarly.get(flagKey)) !== null && _flagsResolvedEarly$g !== void 0 ? _flagsResolvedEarly$g : 0; | ||
flagsResolvedEarly.set(flagKey, unresolvedFlagCount + 1); | ||
} | ||
return false; | ||
@@ -23,2 +31,8 @@ }; | ||
booleanResolver = resolver; | ||
if (process.env.NODE_ENV !== 'production') { | ||
if (flagsResolvedEarly.size > 0) { | ||
debug("[%s]: The following list of Feature Flags were called, the following number of times, before setBooleanResolver.", pkgName, Array.from(flagsResolvedEarly.entries())); | ||
flagsResolvedEarly.clear(); | ||
} | ||
} | ||
} | ||
@@ -25,0 +39,0 @@ export function resolveBooleanFlag(flagKey) { |
{ | ||
"name": "@atlaskit/platform-feature-flags", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"sideEffects": false | ||
} |
{ | ||
"name": "@atlaskit/platform-feature-flags", | ||
"version": "0.2.2", | ||
"description": "Platform Feature Flags - DO NOT USE (yet)", | ||
"version": "0.2.3", | ||
"description": "Platform Feature Flags", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "registry": "https://registry.npmjs.org/" |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
22024
304
15