Socket
Socket
Sign inDemoInstall

@atlaskit/platform-feature-flags

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atlaskit/platform-feature-flags - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

6

CHANGELOG.md
# @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 @@

16

dist/cjs/resolvers.js

@@ -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) {

2

dist/cjs/version.json
{
"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/"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc