2026-09-05 10:56:28 +00:00
// Module ID: 1983
// Function ID: 1984
2026-09-10 05:38:07 +00:00
// Name: libdiscoreExperiments
2026-09-05 10:56:28 +00:00
// Dependencies: [1984, 3, 1351, 38, 2]
2026-07-20 16:05:17 +00:00
// Exports: clearLibdiscoreExperimentCache, isExperimentSyncDisabled
2026-09-10 05:38:07 +00:00
// Module 1983 (libdiscoreExperiments)
import LoggerDefault from "Logger" /* 3 */ ;
2026-08-24 06:08:38 +00:00
import _modDef38 from "module_38" /* 38 */ ;
2026-09-10 05:38:07 +00:00
import js_shim_shim from "js_shim/shim" /* 1351 */ ;
import BridgedStore from "BridgedStore" /* 1984 */ ;
import size from "module_2" /* 2 */ ;
2026-07-23 10:11:24 +00:00
2026-09-10 05:38:07 +00:00
const ensureValidMode = BridgedStore . ensureValidMode ;
const logger = new LoggerDefault ( "libdiscoreExperiments" ) ;
2026-07-29 08:29:29 +00:00
let items = [ ] ;
let closure_6 = Symbol ( "unknown" ) ;
class LibdiscoreCachedExperiment {
constructor ( arg0 ) {
2026-09-10 05:38:07 +00:00
merged = Object . assign ( { inner : null , cachedConfig : null } ) ;
merged [ 1 ] = closure_6 ;
merged . id = global ;
arr = closure_5 . push ( merged ) ;
return merged ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const prototype = LibdiscoreCachedExperiment . prototype ;
prototype [ "getEnabledFeatureName" ] = function getEnabledFeatureName() {
const cachedConfig = this . getCachedConfig ( ) ;
let combined = null ;
if ( undefined !== cachedConfig ) {
combined = null ;
if ( cachedConfig . treatmentId > 0 ) {
const _HermesInternal = HermesInternal ;
combined = "" + this . id + ":" + cachedConfig . treatmentId ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return combined ;
} ;
prototype [ "getCachedConfig" ] = function getCachedConfig() {
const self = this ;
if ( this . cachedConfig === closure_6 ) {
if ( obj . isLibdiscoreInitialized ( ) ) {
2026-09-05 10:56:28 +00:00
const experimentCacher = tmp ( 1351 ) . getExperimentCacher ( ) ;
2026-07-29 08:29:29 +00:00
self . cachedConfig = experimentCacher . getConfig ( self . id ) ;
2026-09-05 10:56:28 +00:00
const tmpResult = tmp ( 1351 ) ;
2026-07-29 08:29:29 +00:00
} else {
self . cachedConfig = undefined ;
2026-07-20 16:05:17 +00:00
}
2026-09-10 05:38:07 +00:00
obj = js_shim_shim ;
2026-07-29 08:29:29 +00:00
tmp = require ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return self . cachedConfig ;
} ;
prototype [ "setExperiment" ] = function setExperiment ( apexExperiment ) {
this . inner = apexExperiment ;
} ;
prototype [ "getCurrentConfig" ] = function getCurrentConfig() {
2026-08-24 06:08:38 +00:00
_modDef38 ( null != this . inner , "experiment must be set before calling getCurrentConfig" ) ;
2026-07-29 08:29:29 +00:00
const inner = this . inner ;
if ( "getCurrentConfig" in this . inner ) {
let currentConfig = inner . getCurrentConfig ( { location : "default" } ) ;
} else {
currentConfig = inner . getConfig ( { location : "default" } ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return currentConfig ;
} ;
class LibdiscoreWrapperSimpleExperiment extends LibdiscoreCachedExperiment {
constructor ( arg0 , arg1 ) {
flag = importDefault ;
if ( importDefault === undefined ) {
flag = false ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = new LibdiscoreWrapperSimpleExperiment ( global , tmp , new . target , new . target ) ;
tmp2 . label = require ;
tmp2 . defaultValue = flag ;
return tmp2 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype2 = LibdiscoreWrapperSimpleExperiment . prototype ;
prototype2 [ "getLabel" ] = function getLabel() {
return this . label ;
} ;
prototype2 [ "getTreatments" ] = function getTreatments() {
2026-08-24 06:08:38 +00:00
items = [ { treatmentId : 0 } , { treatmentId : 1 } ] ;
2026-07-29 08:29:29 +00:00
return items ;
} ;
prototype2 [ "getCachedEnabled" ] = function getCachedEnabled() {
const cachedConfig = this . getCachedConfig ( ) ;
if ( null != cachedConfig ) {
if ( - 1 !== cachedConfig . treatmentId ) {
let defaultValue = 1 === cachedConfig . treatmentId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return defaultValue ;
}
defaultValue = this . defaultValue ;
} ;
class LibdiscoreBridgedStoreExperiment extends LibdiscoreCachedExperiment {
constructor ( arg0 , arg1 , arg2 ) {
2026-09-10 05:38:07 +00:00
tmp1 = new tmp ( global , importDefault , new . target ) ;
tmp1 . storeName = require ;
return tmp1 ;
2026-07-29 08:29:29 +00:00
}
}
const prototype3 = LibdiscoreBridgedStoreExperiment . prototype ;
prototype3 [ "getCachedBridgedStoreMode" ] = function getCachedBridgedStoreMode() {
const cachedConfig = this . getCachedConfig ( ) ;
let num ;
if ( cachedConfig != null ) {
num = cachedConfig . treatmentId ;
}
if ( num == null ) {
num = - 1 ;
}
if ( 1 === num ) {
let str = "typescript-libdiscore-dual-read" ;
} else {
str = "libdiscore" ;
if ( 2 !== num ) {
str = "typescript" ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
return ensureValidMode ( str ) ;
} ;
prototype3 [ "getEnabledFeatureName" ] = function getEnabledFeatureName() {
const cachedBridgedStoreMode = this . getCachedBridgedStoreMode ( ) ;
let combined = null ;
if ( "typescript" !== cachedBridgedStoreMode ) {
const _HermesInternal = HermesInternal ;
combined = "BridgedStore[" + this . storeName + "," + cachedBridgedStoreMode + "]" ;
}
return combined ;
} ;
prototype3 [ "getLabel" ] = function getLabel() {
return "libdiscore '" + this . storeName + "' Migration" ;
} ;
prototype3 [ "getTreatments" ] = function getTreatments() {
2026-08-24 06:08:38 +00:00
items = [ { treatmentId : 0 } , { treatmentId : 1 } , { treatmentId : 2 } ] ;
2026-07-29 08:29:29 +00:00
return items ;
} ;
2026-09-02 09:53:35 +00:00
const tmp8 = new "getEnabledFeatureName" ( "2026-01-libdiscore-batch-store-refactor" , undefined , tmp5 , tmp4 , tmp3 , tmp2 , tmp , require , dependencyMap ) ;
tmp8 . storeName = "batch-store-refactor" ;
2026-07-29 08:29:29 +00:00
class LibdiscoreTelemetryExperiment extends LibdiscoreCachedExperiment {
constructor ( ) {
applyArgumentsResult = HermesBuiltin . applyArguments ( new . target , new . target ) ;
applyArgumentsResult . MAX_EMISSIONS_PER_APP_LAUNCH = 5 ;
applyArgumentsResult . emissionsCount = 0 ;
return applyArgumentsResult ;
}
}
const prototype4 = LibdiscoreTelemetryExperiment . prototype ;
prototype4 [ "getLabel" ] = function getLabel() {
return "libdiscore Telemetry" ;
} ;
prototype4 [ "getTreatments" ] = function getTreatments() {
2026-08-24 06:08:38 +00:00
items = [ { treatmentId : 0 } , { treatmentId : 1 } , { treatmentId : 2 } , { treatmentId : 3 } ] ;
2026-07-29 08:29:29 +00:00
return items ;
} ;
prototype4 [ "getMetricsSampleRate" ] = function getMetricsSampleRate() {
const cachedConfig = this . getCachedConfig ( ) ;
let treatmentId ;
if ( cachedConfig != null ) {
treatmentId = cachedConfig . treatmentId ;
}
if ( 1 === treatmentId ) {
return 0.01 ;
} else if ( 2 === treatmentId ) {
return 0.05 ;
} else if ( 3 === treatmentId ) {
return 1 ;
} else {
return 0 ;
}
} ;
prototype4 [ "didEmit" ] = function didEmit() {
this . emissionsCount = this . emissionsCount + 1 ;
} ;
prototype4 [ "shouldCollectMetrics" ] = function shouldCollectMetrics() {
const self = this ;
const metricsSampleRate = this . getMetricsSampleRate ( ) ;
let tmp2 = 0 !== metricsSampleRate ;
if ( tmp2 ) {
let tmp3 = 1 === metricsSampleRate ;
if ( ! tmp3 ) {
let tmp4 = self . emissionsCount < self . MAX_EMISSIONS_PER_APP_LAUNCH ;
if ( tmp4 ) {
const _Math = Math ;
tmp4 = Math . random ( ) < metricsSampleRate ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp4 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = tmp3 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2 ;
} ;
const libdiscoreTelemetryExperiment = new LibdiscoreTelemetryExperiment ( "2025-09-libdiscore-telemetry" ) ;
2026-09-02 09:53:35 +00:00
const tmp10 = new "shouldCollectMetrics" ( "2025-11-defer-load-late-lazy-cache" , undefined , tmp5 , tmp4 , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 ) ;
tmp10 . label = "Allow react to render before lazy cache is loaded" ;
tmp10 . defaultValue = false ;
2026-07-29 08:29:29 +00:00
class LibdiscoreCustomTreatmentsExperiment extends LibdiscoreCachedExperiment {
constructor ( arg0 , arg1 , arg2 ) {
2026-09-10 05:38:07 +00:00
tmp1 = new tmp ( global , new . target ) ;
tmp1 . label = require ;
tmp1 . treatmentCount = importDefault ;
return tmp1 ;
2026-07-29 08:29:29 +00:00
}
}
const prototype5 = LibdiscoreCustomTreatmentsExperiment . prototype ;
prototype5 [ "getLabel" ] = function getLabel() {
return this . label ;
} ;
2026-09-02 09:53:35 +00:00
function getTreatments() {
2026-07-29 08:29:29 +00:00
return Array . from ( { length : this.treatmentCount } , ( arg0 , treatmentId ) = > ( { treatmentId } ) ) ;
2026-09-02 09:53:35 +00:00
}
prototype5 [ "getTreatments" ] = getTreatments ;
const tmp11 = new "getTreatments" ( "2026-01-android-rmle" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 , libdiscoreTelemetryExperiment , tmp10 , prototype4 , "shouldCollectMetrics" , "getLabel" , "getTreatments" , new . target , getTreatments ) ;
tmp11 . label = "Android Pull Mode Rendering" ;
tmp11 . treatmentCount = 4 ;
const tmp12 = new "getTreatments" ( "2026-02-android-fresco-cache" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 , libdiscoreTelemetryExperiment , tmp10 , tmp11 , "shouldCollectMetrics" , "getLabel" , "getTreatments" , new . target , "Android Pull Mode Rendering" ) ;
tmp12 . label = "Android Fresco Cache" ;
tmp12 . treatmentCount = 3 ;
const tmp13 = new "getTreatments" ( "2026-02-android-chat-mosaic-shared-pool" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 ) ;
tmp13 . label = "Android Chat Mosaic Shared Pool" ;
tmp13 . defaultValue = false ;
const tmp14 = new "getTreatments" ( "2026-03-mobile-hermes-occupancy-target" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 ) ;
tmp14 . label = "Android Hermes Occupancy Target" ;
tmp14 . defaultValue = false ;
2026-09-10 05:38:07 +00:00
const tmp22 = new tmp2 ( "2026-08-android-rn-reparenting-flag" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , tmp2 , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 ) ;
tmp22 . label = "RN Flag, was false on RN 0.81 and true in RN 0.86, suspect of causing RMLE regressions" ;
tmp22 . defaultValue = false ;
const tmp32 = new tmp3 ( "2026-08-ios-objc-composed-image-cache" , undefined , tmp5 , LibdiscoreCustomTreatmentsExperiment , tmp3 , new . target , undefined , require , dependencyMap , items , LibdiscoreCachedExperiment , LibdiscoreWrapperSimpleExperiment , tmp8 , libdiscoreTelemetryExperiment , tmp10 , tmp11 , tmp12 , tmp13 , tmp14 , tmp22 , "RN Flag, was false on RN 0.81 and true in RN 0.86, suspect of causing RMLE regressions" ) ;
tmp32 . label = "iOS ObjC Composed Image Cache" ;
tmp32 . treatmentCount = 3 ;
2026-07-29 08:29:29 +00:00
let c7 = false ;
2026-09-10 05:38:07 +00:00
const result = size . fileFinishedImporting ( "modules/libdiscore/libdiscoreExperiments.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const ALL_LIBDISCORE_EXPERIMENTS = items ;
2026-07-29 08:29:29 +00:00
export { LibdiscoreCachedExperiment } ;
export { LibdiscoreWrapperSimpleExperiment } ;
2026-09-02 09:53:35 +00:00
export const LibdiscoreBatchStoreRefactorExperiment = tmp8 ;
2026-07-29 08:29:29 +00:00
export const TelemetryExperiment = libdiscoreTelemetryExperiment ;
2026-09-02 09:53:35 +00:00
export const DelayLoadLateLazyCacheHoldoutExperiment = tmp10 ;
export const AndroidPullModeRenderingExperiment = tmp11 ;
export const AndroidFrescoCacheExperiment = tmp12 ;
export const AndroidChatMosaicSharedPoolExperiment = tmp13 ;
export const AndroidHermesOccupancyTargetExperiment = tmp14 ;
2026-09-10 05:38:07 +00:00
export const AndroidRNFlagReparenting = tmp22 ;
export const IOSObjcComposedImageCacheExperiment = tmp32 ;
2026-07-20 16:05:17 +00:00
export function isExperimentSyncDisabled() {
2026-07-29 08:29:29 +00:00
return c7 ;
2026-07-20 16:05:17 +00:00
}
export const clearLibdiscoreExperimentCache = function clearLibdiscoreExperimentCache() {
if ( obj . isLibdiscoreInitialized ( ) ) {
2026-08-24 06:08:38 +00:00
logger . info ( "Clearing libdiscore experiment cache and disabling sync" ) ;
c7 = true ;
2026-09-10 05:38:07 +00:00
const experimentCacher = js_shim_shim . getExperimentCacher ( ) ;
2026-07-20 16:05:17 +00:00
experimentCacher . clearCache ( ) ;
2026-09-10 05:38:07 +00:00
const tmpResult = js_shim_shim ;
2026-07-20 16:05:17 +00:00
}
} ;