@buoy-gg/highlight-updates 2.0.2
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/README.md +210 -0
- package/lib/commonjs/highlight-updates/HighlightUpdatesOverlay.js +1 -0
- package/lib/commonjs/highlight-updates/components/HighlightFilterView.js +1 -0
- package/lib/commonjs/highlight-updates/components/HighlightUpdatesModal.js +1 -0
- package/lib/commonjs/highlight-updates/components/IdentifierBadge.js +1 -0
- package/lib/commonjs/highlight-updates/components/IsolatedRenderList.js +1 -0
- package/lib/commonjs/highlight-updates/components/ModalHeaderContent.js +1 -0
- package/lib/commonjs/highlight-updates/components/RenderCauseBadge.js +1 -0
- package/lib/commonjs/highlight-updates/components/RenderDetailView.js +1 -0
- package/lib/commonjs/highlight-updates/components/RenderHistoryViewer.js +1 -0
- package/lib/commonjs/highlight-updates/components/RenderListItem.js +1 -0
- package/lib/commonjs/highlight-updates/components/StatsDisplay.js +1 -0
- package/lib/commonjs/highlight-updates/components/index.js +1 -0
- package/lib/commonjs/highlight-updates/utils/HighlightUpdatesController.js +1 -0
- package/lib/commonjs/highlight-updates/utils/PerformanceLogger.js +1 -0
- package/lib/commonjs/highlight-updates/utils/ProfilerInterceptor.js +1 -0
- package/lib/commonjs/highlight-updates/utils/RenderCauseDetector.js +1 -0
- package/lib/commonjs/highlight-updates/utils/RenderTracker.js +1 -0
- package/lib/commonjs/highlight-updates/utils/ViewTypeMapper.js +1 -0
- package/lib/commonjs/index.js +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/preset.js +1 -0
- package/lib/module/highlight-updates/HighlightUpdatesOverlay.js +1 -0
- package/lib/module/highlight-updates/components/HighlightFilterView.js +1 -0
- package/lib/module/highlight-updates/components/HighlightUpdatesModal.js +1 -0
- package/lib/module/highlight-updates/components/IdentifierBadge.js +1 -0
- package/lib/module/highlight-updates/components/IsolatedRenderList.js +1 -0
- package/lib/module/highlight-updates/components/ModalHeaderContent.js +1 -0
- package/lib/module/highlight-updates/components/RenderCauseBadge.js +1 -0
- package/lib/module/highlight-updates/components/RenderDetailView.js +1 -0
- package/lib/module/highlight-updates/components/RenderHistoryViewer.js +1 -0
- package/lib/module/highlight-updates/components/RenderListItem.js +1 -0
- package/lib/module/highlight-updates/components/StatsDisplay.js +1 -0
- package/lib/module/highlight-updates/components/index.js +1 -0
- package/lib/module/highlight-updates/utils/HighlightUpdatesController.js +1 -0
- package/lib/module/highlight-updates/utils/PerformanceLogger.js +1 -0
- package/lib/module/highlight-updates/utils/ProfilerInterceptor.js +1 -0
- package/lib/module/highlight-updates/utils/RenderCauseDetector.js +1 -0
- package/lib/module/highlight-updates/utils/RenderTracker.js +1 -0
- package/lib/module/highlight-updates/utils/ViewTypeMapper.js +1 -0
- package/lib/module/index.js +1 -0
- package/lib/module/preset.js +1 -0
- package/lib/typescript/highlight-updates/HighlightUpdatesOverlay.d.ts +18 -0
- package/lib/typescript/highlight-updates/components/HighlightFilterView.d.ts +27 -0
- package/lib/typescript/highlight-updates/components/HighlightUpdatesModal.d.ts +36 -0
- package/lib/typescript/highlight-updates/components/IdentifierBadge.d.ts +39 -0
- package/lib/typescript/highlight-updates/components/IsolatedRenderList.d.ts +32 -0
- package/lib/typescript/highlight-updates/components/ModalHeaderContent.d.ts +68 -0
- package/lib/typescript/highlight-updates/components/RenderCauseBadge.d.ts +43 -0
- package/lib/typescript/highlight-updates/components/RenderDetailView.d.ts +29 -0
- package/lib/typescript/highlight-updates/components/RenderHistoryViewer.d.ts +36 -0
- package/lib/typescript/highlight-updates/components/RenderListItem.d.ts +16 -0
- package/lib/typescript/highlight-updates/components/StatsDisplay.d.ts +18 -0
- package/lib/typescript/highlight-updates/components/index.d.ts +12 -0
- package/lib/typescript/highlight-updates/utils/HighlightUpdatesController.d.ts +132 -0
- package/lib/typescript/highlight-updates/utils/PerformanceLogger.d.ts +135 -0
- package/lib/typescript/highlight-updates/utils/ProfilerInterceptor.d.ts +91 -0
- package/lib/typescript/highlight-updates/utils/RenderCauseDetector.d.ts +68 -0
- package/lib/typescript/highlight-updates/utils/RenderTracker.d.ts +407 -0
- package/lib/typescript/highlight-updates/utils/ViewTypeMapper.d.ts +66 -0
- package/lib/typescript/index.d.ts +43 -0
- package/lib/typescript/preset.d.ts +187 -0
- package/package.json +73 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{getComponentDisplayName}from"./ViewTypeMapper";import{PerformanceLogger}from"./PerformanceLogger";const MAX_TRACKED_COMPONENTS=200,DEFAULT_BATCH_SIZE=150;class RenderTrackerSingleton{renders=new Map;listeners=new Set;stateListeners=new Set;settingsListeners=new Set;filterListeners=new Set;isTracking=!1;isPaused=!1;settings={batchSize:150,showRenderCount:!0,performanceLogging:!1,trackRenderCauses:!1,enableRenderHistory:!0,maxRenderHistoryPerComponent:20,capturePropsOnRender:!1,captureStateOnRender:!1,debugLogLevel:"off",debugRawFiberLogging:!1};isBatchMode=!1;batchDirty=!1;filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[]};trackRender(e){if(this.isPaused)return;const t=String(e.nativeTag),s=Date.now(),i=this.renders.get(t);if(i)i.renderCount=e.count,i.lastRenderTime=s,i.color=e.color,e.measurements&&(i.measurements=e.measurements),e.testID&&!i.testID&&(i.testID=e.testID),e.nativeID&&!i.nativeID&&(i.nativeID=e.nativeID),e.accessibilityLabel&&!i.accessibilityLabel&&(i.accessibilityLabel=e.accessibilityLabel),e.componentName&&!i.componentName&&(i.componentName=e.componentName),e.renderCause&&(i.lastRenderCause=e.renderCause),this.settings.enableRenderHistory&&e.renderCause&&this.addRenderEvent(i,e.renderCause,e.capturedProps,e.capturedState);else{const i={id:t,nativeTag:e.nativeTag,viewType:e.viewType,displayName:getComponentDisplayName(e.viewType),testID:e.testID,nativeID:e.nativeID,accessibilityLabel:e.accessibilityLabel,componentName:e.componentName,renderCount:e.count,firstRenderTime:s,lastRenderTime:s,measurements:e.measurements,color:e.color,lastRenderCause:e.renderCause};if(this.settings.enableRenderHistory&&e.renderCause&&(i.renderHistory=[],this.addRenderEvent(i,e.renderCause,e.capturedProps,e.capturedState)),this.renders.set(t,i),this.renders.size>200){const e=Array.from(this.renders.values()).sort((e,t)=>e.lastRenderTime-t.lastRenderTime).slice(0,this.renders.size-200);for(const t of e)this.renders.delete(t.id)}}this.isBatchMode?this.batchDirty=!0:this.notifyListeners()}addRenderEvent(e,t,s,i){e.renderHistory||(e.renderHistory=[]);const n={id:`${e.nativeTag}-${t.timestamp}`,timestamp:t.timestamp,cause:t,renderNumber:e.renderCount,capturedProps:this.settings.capturePropsOnRender?s:void 0,capturedState:this.settings.captureStateOnRender?i:void 0};e.renderHistory.push(n);const r=Math.max(5,Math.min(50,this.settings.maxRenderHistoryPerComponent));e.renderHistory.length>r&&(e.renderHistory=e.renderHistory.slice(-r))}startBatch(){this.isBatchMode=!0,this.batchDirty=!1}endBatch(){this.isBatchMode=!1,this.batchDirty&&(this.batchDirty=!1,this.notifyListeners())}getRenders(){return Array.from(this.renders.values()).map(e=>({...e}))}passesFilters(e){if(this.filters.includePatterns.length>0&&!this.matchesAnyPatternForInfo(e,this.filters.includePatterns))return!1;if(this.filters.excludePatterns.length>0&&this.matchesAnyPatternForInfo(e,this.filters.excludePatterns))return!1;if(this.filters.includeViewType.size>0){const t=e.viewType||"",s=e.displayName||"";if(!this.matchesPattern(t,this.filters.includeViewType)&&!this.matchesPattern(s,this.filters.includeViewType))return!1}if(this.filters.includeTestID.size>0&&(!e.testID||!this.matchesPattern(e.testID,this.filters.includeTestID)))return!1;if(this.filters.includeNativeID.size>0&&(!e.nativeID||!this.matchesPattern(e.nativeID,this.filters.includeNativeID)))return!1;if(this.filters.includeComponent.size>0&&(!e.componentName||!this.matchesPattern(e.componentName,this.filters.includeComponent)))return!1;if(this.filters.excludeViewType.size>0){const t=e.viewType||"",s=e.displayName||"";if(this.matchesPattern(t,this.filters.excludeViewType)||this.matchesPattern(s,this.filters.excludeViewType))return!1}return!(this.filters.excludeTestID.size>0&&e.testID&&this.matchesPattern(e.testID,this.filters.excludeTestID)||this.filters.excludeNativeID.size>0&&e.nativeID&&this.matchesPattern(e.nativeID,this.filters.excludeNativeID)||this.filters.excludeComponent.size>0&&e.componentName&&this.matchesPattern(e.componentName,this.filters.excludeComponent))}matchesAnyPatternForInfo(e,t){for(const s of t){const t=s.value.toLowerCase();switch(s.type){case"any":if(e.viewType.toLowerCase().includes(t)||e.displayName?.toLowerCase().includes(t)||e.testID?.toLowerCase().includes(t)||e.nativeID?.toLowerCase().includes(t)||e.componentName?.toLowerCase().includes(t)||e.accessibilityLabel?.toLowerCase().includes(t))return!0;break;case"viewType":if(e.viewType.toLowerCase().includes(t)||e.displayName?.toLowerCase().includes(t))return!0;break;case"testID":if(e.testID?.toLowerCase().includes(t))return!0;break;case"nativeID":if(e.nativeID?.toLowerCase().includes(t))return!0;break;case"component":if(e.componentName?.toLowerCase().includes(t))return!0;break;case"accessibilityLabel":if(e.accessibilityLabel?.toLowerCase().includes(t))return!0}}return!1}hasActiveFilters(){return this.filters.includePatterns.length>0||this.filters.excludePatterns.length>0||this.filters.includeViewType.size>0||this.filters.includeTestID.size>0||this.filters.includeNativeID.size>0||this.filters.includeComponent.size>0||this.filters.excludeViewType.size>0||this.filters.excludeTestID.size>0||this.filters.excludeNativeID.size>0||this.filters.excludeComponent.size>0||void 0!==this.filters.minRenderCount||void 0!==this.filters.maxRenderCount}getFilteredRenders(e=""){let t=this.getRenders();if(e.trim()){const s=e.toLowerCase();t=t.filter(e=>e.viewType.toLowerCase().includes(s)||e.displayName.toLowerCase().includes(s)||e.testID?.toLowerCase().includes(s)||e.nativeID?.toLowerCase().includes(s)||e.accessibilityLabel?.toLowerCase().includes(s)||e.componentName?.toLowerCase().includes(s)||String(e.nativeTag).includes(s))}return t=t.filter(e=>this.passesFilters(e)),void 0!==this.filters.minRenderCount&&(t=t.filter(e=>e.renderCount>=this.filters.minRenderCount)),void 0!==this.filters.maxRenderCount&&(t=t.filter(e=>e.renderCount<=this.filters.maxRenderCount)),t.sort((e,t)=>t.lastRenderTime-e.lastRenderTime)}matchesPattern(e,t){const s=e.toLowerCase();for(const e of t){const t=e.toLowerCase();if(s.includes(t))return!0}return!1}getRender(e){return this.renders.get(e)}clear(){this.renders.clear(),this.notifyListeners()}resetRenderCount(e){const t=this.renders.get(e);t&&(t.renderCount=0,this.notifyListeners())}start(){this.isTracking=!0,this.isPaused=!1,this.notifyStateListeners()}stop(){this.isTracking=!1,this.isPaused=!1,this.notifyStateListeners()}pause(){this.isPaused=!0,this.notifyStateListeners()}resume(){this.isPaused=!1,this.notifyStateListeners()}togglePause(){this.isPaused=!this.isPaused,this.notifyStateListeners()}getState(){return{isTracking:this.isTracking,isPaused:this.isPaused}}getFilters(){return this.filters}setFilters(e){this.filters={...this.filters,...e},this.notifyListeners(),this.notifyFilterListeners()}addIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t),this.notifyListeners()}removeIncludePattern(e,t){const s=`include${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t),this.notifyListeners()}addExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].add(t),this.notifyListeners()}removeExcludePattern(e,t){const s=`exclude${e.charAt(0).toUpperCase()+e.slice(1)}`;this.filters[s].delete(t),this.notifyListeners()}clearFilters(){this.filters={includeTestID:new Set,includeNativeID:new Set,includeViewType:new Set,includeComponent:new Set,excludeTestID:new Set,excludeNativeID:new Set,excludeViewType:new Set,excludeComponent:new Set,includePatterns:[],excludePatterns:[],minRenderCount:void 0,maxRenderCount:void 0},this.notifyListeners()}getAvailableProps(){const e=new Set,t=new Set,s=new Set,i=new Set,n=new Set;for(const r of this.renders.values())r.viewType&&e.add(r.viewType),r.testID&&t.add(r.testID),r.nativeID&&s.add(r.nativeID),r.componentName&&i.add(r.componentName),r.accessibilityLabel&&n.add(r.accessibilityLabel);return{viewTypes:Array.from(e).sort(),testIDs:Array.from(t).sort(),nativeIDs:Array.from(s).sort(),componentNames:Array.from(i).sort(),accessibilityLabels:Array.from(n).sort()}}getStats(){let e=0;for(const t of this.renders.values())e+=t.renderCount;return{totalComponents:this.renders.size,totalRenders:e}}subscribe(e){return this.listeners.add(e),e(this.getRenders()),()=>{this.listeners.delete(e)}}subscribeToState(e){return this.stateListeners.add(e),e(this.getState()),()=>{this.stateListeners.delete(e)}}subscribeToSettings(e){return this.settingsListeners.add(e),e(this.settings),()=>{this.settingsListeners.delete(e)}}subscribeToFilters(e){return this.filterListeners.add(e),e(this.filters),()=>{this.filterListeners.delete(e)}}shouldShowRender(e){const t=this.filters;return!(t.includePatterns.length>0&&!this.matchesAnyPatternForInfo(e,t.includePatterns))&&(!(t.excludePatterns.length>0&&this.matchesAnyPatternForInfo(e,t.excludePatterns))&&(!((t.includeViewType.size>0||t.includeTestID.size>0||t.includeNativeID.size>0||t.includeComponent.size>0)&&!(t.includeViewType.size>0&&t.includeViewType.has(e.viewType)||t.includeTestID.size>0&&e.testID&&t.includeTestID.has(e.testID)||t.includeNativeID.size>0&&e.nativeID&&t.includeNativeID.has(e.nativeID)||t.includeComponent.size>0&&e.componentName&&t.includeComponent.has(e.componentName)))&&!(t.excludeViewType.has(e.viewType)||e.testID&&t.excludeTestID.has(e.testID)||e.nativeID&&t.excludeNativeID.has(e.nativeID)||e.componentName&&t.excludeComponent.has(e.componentName))))}getSettings(){return{...this.settings}}setSettings(e){void 0!==e.batchSize&&(e.batchSize=Math.max(10,Math.min(500,e.batchSize))),void 0!==e.maxRenderHistoryPerComponent&&(e.maxRenderHistoryPerComponent=Math.max(5,Math.min(50,e.maxRenderHistoryPerComponent))),e.enableRenderHistory&&!this.settings.trackRenderCauses&&(e.trackRenderCauses=!0),!1===e.trackRenderCauses&&this.settings.enableRenderHistory&&(e.enableRenderHistory=!1),this.settings={...this.settings,...e},void 0!==e.performanceLogging&&PerformanceLogger.setEnabled(e.performanceLogging),this.notifySettingsListeners()}clearAllRenderHistory(){for(const e of this.renders.values())e.renderHistory=[];this.notifyListeners()}clearRenderHistory(e){const t=this.renders.get(e);t&&(t.renderHistory=[],this.notifyListeners())}getRenderHistoryStats(){let e=0,t=0;for(const s of this.renders.values())s.renderHistory&&s.renderHistory.length>0&&(e+=s.renderHistory.length,t++);return{totalEvents:e,componentsWithHistory:t,averageEventsPerComponent:t>0?e/t:0}}getBatchSize(){return this.settings.batchSize}setBatchSize(e){this.setSettings({batchSize:e})}notifyListeners(){const e=this.getRenders();for(const t of this.listeners)try{t(e)}catch(e){console.error("[RenderTracker] Error in listener:",e)}}notifyStateListeners(){const e=this.getState();for(const t of this.stateListeners)try{t(e)}catch(e){console.error("[RenderTracker] Error in state listener:",e)}}notifySettingsListeners(){const e=this.getSettings();for(const t of this.settingsListeners)try{t(e)}catch(e){console.error("[RenderTracker] Error in settings listener:",e)}}notifyFilterListeners(){const e=this.getFilters();for(const t of this.filterListeners)try{t(e)}catch(e){console.error("[RenderTracker] Error in filter listener:",e)}}}export const RenderTracker=new RenderTrackerSingleton;export default RenderTracker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export const VIEW_TYPE_MAP={RCTView:"View",RCTSafeAreaView:"SafeAreaView",RCTModalHostView:"Modal",RCTText:"Text",RCTRawText:"RawText",RCTVirtualText:"VirtualText",RCTTextInlineImage:"TextInlineImage",RCTImageView:"Image",RCTImage:"Image",RCTScrollView:"ScrollView",RCTScrollContentView:"ScrollContentView",AndroidHorizontalScrollView:"HorizontalScrollView",AndroidHorizontalScrollContentView:"HorizontalScrollContentView",RCTSinglelineTextInputView:"TextInput",RCTMultilineTextInputView:"TextInput (Multiline)",AndroidTextInput:"TextInput",RCTInputAccessoryView:"InputAccessoryView",RCTRefreshControl:"RefreshControl",AndroidSwipeRefreshLayout:"RefreshControl",PullToRefreshView:"RefreshControl",RCTSwitch:"Switch",AndroidSwitch:"Switch",RCTSlider:"Slider",RCTActivityIndicatorView:"ActivityIndicator",AndroidProgressBar:"ActivityIndicator",AndroidDrawerLayout:"DrawerLayout",VirtualView:"VirtualView",VirtualViewExperimental:"VirtualView",DebuggingOverlay:"DebuggingOverlay",LayoutConformance:"LayoutConformance",UnimplementedNativeView:"UnimplementedView",RKShimmeringView:"ShimmeringView",RCTTemplateView:"TemplateView",RCTAxialGradientView:"AxialGradientView",RCTMap:"Map",RCTWebView:"WebView",RCTKeyframes:"Keyframes",RCTImpressionTrackingView:"ImpressionTrackingView",RNSVGSvgView:"Svg",RNSVGGroup:"G",RNSVGPath:"Path",RNSVGText:"SvgText",RNSVGTSpan:"TSpan",RNSVGTextPath:"TextPath",RNSVGImage:"SvgImage",RNSVGCircle:"Circle",RNSVGEllipse:"Ellipse",RNSVGLine:"Line",RNSVGRect:"Rect",RNSVGClipPath:"ClipPath",RNSVGDefs:"Defs",RNSVGUse:"Use",RNSVGSymbol:"Symbol",RNSVGPattern:"Pattern",RNSVGMask:"Mask",RNSVGForeignObject:"ForeignObject",RNSVGMarker:"Marker",RNSVGLinearGradient:"LinearGradient",RNSVGRadialGradient:"RadialGradient",RNSVGFilter:"Filter",RNSVGFeBlend:"FeBlend",RNSVGFeColorMatrix:"FeColorMatrix",RNSVGFeComposite:"FeComposite",RNSVGFeFlood:"FeFlood",RNSVGFeGaussianBlur:"FeGaussianBlur",RNSVGFeMerge:"FeMerge",RNSVGFeOffset:"FeOffset",RNSVGPolygon:"Polygon",RNSVGPolyline:"Polyline",RNSVGStop:"Stop",RNGestureHandlerRootView:"GestureHandlerRootView",RNGestureHandlerButton:"GestureHandlerButton",RNCSafeAreaProvider:"SafeAreaProvider",RNCSafeAreaView:"SafeAreaView",RNSScreen:"Screen",RNSScreenContainer:"ScreenContainer",RNSScreenStack:"ScreenStack",RNSScreenStackHeaderConfig:"ScreenStackHeaderConfig",RNSScreenStackHeaderSubview:"ScreenStackHeaderSubview",RNSSearchBar:"SearchBar",RNSFullWindowOverlay:"FullWindowOverlay",RNSModalScreen:"ModalScreen",ReanimatedView:"Animated.View",ExpoView:"ExpoView",ExpoBlurView:"BlurView",ExpoLinearGradient:"LinearGradient",ExpoImage:"ExpoImage",ExpoVideoView:"VideoView",ExpoCamera:"Camera",ExpoBarCodeScannerView:"BarCodeScanner",RNCWebView:"WebView",AIRMap:"MapView",AIRMapMarker:"Marker",AIRMapPolyline:"Polyline",AIRMapPolygon:"Polygon",AIRMapCircle:"Circle",AIRMapCallout:"Callout",RCTVideo:"Video",LottieAnimationView:"LottieView",FastImageView:"FastImage"};export function getComponentDisplayName(e){return VIEW_TYPE_MAP[e]||e}export function getNativeViewType(e){for(const[i,t]of Object.entries(VIEW_TYPE_MAP))if(t===e)return i;return null}export function isKnownViewType(e){return e in VIEW_TYPE_MAP}export function getAllNativeViewTypes(){return Object.keys(VIEW_TYPE_MAP)}export function getAllComponentNames(){return[...new Set(Object.values(VIEW_TYPE_MAP))]}export default{VIEW_TYPE_MAP:VIEW_TYPE_MAP,getComponentDisplayName:getComponentDisplayName,getNativeViewType:getNativeViewType,isKnownViewType:isKnownViewType,getAllNativeViewTypes:getAllNativeViewTypes,getAllComponentNames:getAllComponentNames};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";export{highlightUpdatesPreset,createHighlightUpdatesTool,highlightUpdatesModalPreset,createHighlightUpdatesModalTool}from"./preset";export{default as HighlightUpdatesController}from"./highlight-updates/utils/HighlightUpdatesController";export{HighlightUpdatesOverlay}from"./highlight-updates/HighlightUpdatesOverlay";export{installProfilerInterceptor,uninstallProfilerInterceptor,setComparisonCallback,isInterceptorInstalled,enableProfilerLogging,disableProfilerLogging,isLoggingEnabled}from"./highlight-updates/utils/ProfilerInterceptor";export{RenderTracker}from"./highlight-updates/utils/RenderTracker";export{detectRenderCause,clearRenderCauseState,removeRenderCauseState,getRenderCauseStats,safeCloneForHistory,capturePropsSnapshot,captureStateSnapshot}from"./highlight-updates/utils/RenderCauseDetector";export{PerformanceLogger}from"./highlight-updates/utils/PerformanceLogger";export{VIEW_TYPE_MAP,getComponentDisplayName,getNativeViewType,isKnownViewType,getAllNativeViewTypes,getAllComponentNames}from"./highlight-updates/utils/ViewTypeMapper";export{HighlightUpdatesModal}from"./highlight-updates/components/HighlightUpdatesModal";export{RenderListItem}from"./highlight-updates/components/RenderListItem";export{RenderDetailView}from"./highlight-updates/components/RenderDetailView";export{HighlightFilterView}from"./highlight-updates/components/HighlightFilterView";export{RenderCauseBadge,TwoLevelCauseBadge,CAUSE_CONFIG,COMPONENT_CAUSE_CONFIG}from"./highlight-updates/components/RenderCauseBadge";export{RenderHistoryViewer,RenderHistoryFooter}from"./highlight-updates/components/RenderHistoryViewer";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import React,{useState,useEffect,useCallback}from"react";import{HighlighterIcon}from"@buoy-gg/floating-tools-core";import HighlightUpdatesController from"./highlight-updates/utils/HighlightUpdatesController";import{HighlightUpdatesModal}from"./highlight-updates/components/HighlightUpdatesModal";import{jsx as _jsx}from"react/jsx-runtime";function HighlightIcon({size:t}){const[e,i]=useState(()=>HighlightUpdatesController.isEnabled());return useEffect(()=>HighlightUpdatesController.subscribe(t=>{i(t)}),[]),_jsx(HighlighterIcon,{size:t,color:e?"#10b981":"#6b7280"})}function EmptyComponent(){return null}function HighlightUpdatesModalWithBadgeNavigation(t){const[e,i]=useState(null);useEffect(()=>(t.visible&&HighlightUpdatesController.setBadgePressCallback(t=>{i(t)}),()=>{t.visible||HighlightUpdatesController.setBadgePressCallback(null)}),[t.visible]);const o=useCallback(()=>{i(null)},[]);return _jsx(HighlightUpdatesModal,{...t,initialNativeTag:e,onInitialNativeTagHandled:o})}export const highlightUpdatesPreset={id:"highlight-updates",name:"HIGHLIGHT",description:"Toggle component render highlights",slot:"row",icon:HighlightIcon,component:EmptyComponent,props:{},launchMode:"toggle-only",onPress:()=>{HighlightUpdatesController.isInitialized()||HighlightUpdatesController.initialize(),HighlightUpdatesController.toggle()}};export function createHighlightUpdatesTool(t){const e=t?.enabledColor||"#10b981",i=t?.disabledColor||"#6b7280";return t?.autoInitialize&&setTimeout(()=>{HighlightUpdatesController.initialize()},1e3),{id:t?.id||"highlight-updates",name:t?.name||"HIGHLIGHT",description:t?.description||"Toggle component render highlights",slot:"row",icon:({size:t})=>{const[o,l]=useState(()=>HighlightUpdatesController.isEnabled());return useEffect(()=>HighlightUpdatesController.subscribe(t=>{l(t)}),[]),_jsx(HighlighterIcon,{size:t,color:o?e:i})},component:EmptyComponent,props:{},launchMode:"toggle-only",onPress:()=>{HighlightUpdatesController.isInitialized()||HighlightUpdatesController.initialize(),HighlightUpdatesController.toggle()}}}export const highlightUpdatesModalPreset={id:"highlight-updates-modal",name:"HIGHLIGHT",description:"View component render tracking modal",slot:"both",icon:({size:t})=>_jsx(HighlighterIcon,{size:t}),component:HighlightUpdatesModalWithBadgeNavigation,props:{enableSharedModalDimensions:!1}};export function createHighlightUpdatesModalTool(t){const e=t?.enabledColor||"#10b981";return t?.autoInitialize&&setTimeout(()=>{HighlightUpdatesController.initialize()},1e3),{id:t?.id||"highlight-updates-modal",name:t?.name||"HIGHLIGHT",description:t?.description||"View component render tracking modal",slot:"both",icon:({size:t})=>_jsx(HighlighterIcon,{size:t,color:e}),component:HighlightUpdatesModalWithBadgeNavigation,props:{enableSharedModalDimensions:!1}}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HighlightUpdatesOverlay
|
|
3
|
+
*
|
|
4
|
+
* Renders colored highlight rectangles for components that have updated.
|
|
5
|
+
* Uses View-based rendering (similar to debug-borders) instead of the
|
|
6
|
+
* native DebuggingOverlay component for better compatibility.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
interface HighlightUpdatesOverlayProps {
|
|
10
|
+
/**
|
|
11
|
+
* Callback when a badge is pressed.
|
|
12
|
+
* Receives the nativeTag (id) of the component whose badge was tapped.
|
|
13
|
+
*/
|
|
14
|
+
onBadgePress?: (nativeTag: number) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function HighlightUpdatesOverlay({ onBadgePress, }?: HighlightUpdatesOverlayProps): React.ReactElement | null;
|
|
17
|
+
export default HighlightUpdatesOverlay;
|
|
18
|
+
//# sourceMappingURL=HighlightUpdatesOverlay.d.ts.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HighlightFilterView
|
|
3
|
+
*
|
|
4
|
+
* Simplified filter configuration for tracked component renders.
|
|
5
|
+
* Uses a badge-based approach where users select a filter type
|
|
6
|
+
* (Any, ViewType, testID, Component) then enter a value.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { FilterConfig, RenderTrackerSettings } from "../utils/RenderTracker";
|
|
10
|
+
type FilterViewTab = "filters" | "settings";
|
|
11
|
+
interface HighlightFilterViewProps {
|
|
12
|
+
filters: FilterConfig;
|
|
13
|
+
onFilterChange: (filters: Partial<FilterConfig>) => void;
|
|
14
|
+
settings: RenderTrackerSettings;
|
|
15
|
+
onSettingsChange: (settings: Partial<RenderTrackerSettings>) => void;
|
|
16
|
+
availableProps: {
|
|
17
|
+
viewTypes: string[];
|
|
18
|
+
testIDs: string[];
|
|
19
|
+
nativeIDs: string[];
|
|
20
|
+
componentNames: string[];
|
|
21
|
+
accessibilityLabels: string[];
|
|
22
|
+
};
|
|
23
|
+
activeTab: FilterViewTab;
|
|
24
|
+
}
|
|
25
|
+
export declare function HighlightFilterView({ filters, onFilterChange, settings, onSettingsChange, availableProps, activeTab, }: HighlightFilterViewProps): React.JSX.Element;
|
|
26
|
+
export default HighlightFilterView;
|
|
27
|
+
//# sourceMappingURL=HighlightFilterView.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HighlightUpdatesModal
|
|
3
|
+
*
|
|
4
|
+
* Main modal interface for the Highlight Updates dev tool.
|
|
5
|
+
* Shows a list of tracked component renders with controls for
|
|
6
|
+
* start/stop, clear, and filtering.
|
|
7
|
+
*
|
|
8
|
+
* PERFORMANCE OPTIMIZED:
|
|
9
|
+
* - Uses isolated components to prevent parent re-renders
|
|
10
|
+
* - Stats display is isolated (StatsDisplay)
|
|
11
|
+
* - Render list is isolated (IsolatedRenderList)
|
|
12
|
+
* - Header components are memoized
|
|
13
|
+
* - Uses refs for values not displayed in UI
|
|
14
|
+
*/
|
|
15
|
+
import React from "react";
|
|
16
|
+
interface HighlightUpdatesModalProps {
|
|
17
|
+
visible: boolean;
|
|
18
|
+
onClose: () => void;
|
|
19
|
+
onBack?: () => void;
|
|
20
|
+
onMinimize?: (modalState: any) => void;
|
|
21
|
+
enableSharedModalDimensions?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Initial nativeTag to navigate to when modal opens.
|
|
24
|
+
* Used by "Click Overlay Badge → Jump to Detail" feature.
|
|
25
|
+
* When set, the modal will automatically show the detail view for this component.
|
|
26
|
+
*/
|
|
27
|
+
initialNativeTag?: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* Callback when the modal finishes handling the initial nativeTag.
|
|
30
|
+
* This allows the parent to clear the navigation state.
|
|
31
|
+
*/
|
|
32
|
+
onInitialNativeTagHandled?: () => void;
|
|
33
|
+
}
|
|
34
|
+
export declare function HighlightUpdatesModal({ visible, onClose, onBack, onMinimize, enableSharedModalDimensions, initialNativeTag, onInitialNativeTagHandled, }: HighlightUpdatesModalProps): React.JSX.Element | null;
|
|
35
|
+
export default HighlightUpdatesModal;
|
|
36
|
+
//# sourceMappingURL=HighlightUpdatesModal.d.ts.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IdentifierBadge
|
|
3
|
+
*
|
|
4
|
+
* Shared badge component for displaying component identifiers.
|
|
5
|
+
* Used throughout the highlight-updates package for consistent styling.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Box } from "@buoy-gg/shared-ui";
|
|
9
|
+
export type IdentifierType = "viewType" | "testID" | "nativeID" | "component" | "accessibilityLabel" | "nativeTag" | "any";
|
|
10
|
+
export declare const IDENTIFIER_CONFIG: Record<IdentifierType, {
|
|
11
|
+
label: string;
|
|
12
|
+
shortLabel: string;
|
|
13
|
+
color: string;
|
|
14
|
+
icon: typeof Box;
|
|
15
|
+
}>;
|
|
16
|
+
interface IdentifierBadgeProps {
|
|
17
|
+
type: IdentifierType;
|
|
18
|
+
value: string;
|
|
19
|
+
/** Use compact mode for list items */
|
|
20
|
+
compact?: boolean;
|
|
21
|
+
/** Show only the badge without value */
|
|
22
|
+
badgeOnly?: boolean;
|
|
23
|
+
/** Show only the value without badge */
|
|
24
|
+
valueOnly?: boolean;
|
|
25
|
+
/** Use short label */
|
|
26
|
+
shortLabel?: boolean;
|
|
27
|
+
/** Show icon in badge */
|
|
28
|
+
showIcon?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function IdentifierBadge({ type, value, compact, badgeOnly, valueOnly, shortLabel, showIcon, }: IdentifierBadgeProps): React.JSX.Element;
|
|
31
|
+
interface CategoryBadgeProps {
|
|
32
|
+
type: IdentifierType;
|
|
33
|
+
count?: number;
|
|
34
|
+
isSelected?: boolean;
|
|
35
|
+
showIcon?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare function CategoryBadge({ type, count, isSelected, showIcon, }: CategoryBadgeProps): React.JSX.Element;
|
|
38
|
+
export default IdentifierBadge;
|
|
39
|
+
//# sourceMappingURL=IdentifierBadge.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IsolatedRenderList
|
|
3
|
+
*
|
|
4
|
+
* Performance-optimized component that isolates the render tracking subscription
|
|
5
|
+
* to prevent parent re-renders. Only this component re-renders when new renders
|
|
6
|
+
* are tracked, keeping the modal UI stable.
|
|
7
|
+
*
|
|
8
|
+
* Following the optimization guide: move subscriptions to child components to
|
|
9
|
+
* prevent parent re-renders.
|
|
10
|
+
*/
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { type TrackedRender, type FilterConfig } from "../utils/RenderTracker";
|
|
13
|
+
interface IsolatedRenderListProps {
|
|
14
|
+
searchText: string;
|
|
15
|
+
filters: FilterConfig;
|
|
16
|
+
onSelectRender: (render: TrackedRender, index: number, allRenders: TrackedRender[]) => void;
|
|
17
|
+
onStatsChange: (stats: {
|
|
18
|
+
totalComponents: number;
|
|
19
|
+
totalRenders: number;
|
|
20
|
+
}) => void;
|
|
21
|
+
onRendersChange?: (renders: TrackedRender[]) => void;
|
|
22
|
+
isTracking: boolean;
|
|
23
|
+
isPro?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Isolated list component that owns the render subscription.
|
|
27
|
+
* Parent component does NOT re-render when renders change.
|
|
28
|
+
*/
|
|
29
|
+
declare function IsolatedRenderListInner({ searchText, filters, onSelectRender, onStatsChange, onRendersChange, isTracking, isPro, }: IsolatedRenderListProps): React.JSX.Element;
|
|
30
|
+
export declare const IsolatedRenderList: React.MemoExoticComponent<typeof IsolatedRenderListInner>;
|
|
31
|
+
export default IsolatedRenderList;
|
|
32
|
+
//# sourceMappingURL=IsolatedRenderList.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModalHeaderContent
|
|
3
|
+
*
|
|
4
|
+
* Memoized header content components for the HighlightUpdatesModal.
|
|
5
|
+
* Extracted to prevent re-renders when parent state changes unrelated to header.
|
|
6
|
+
*
|
|
7
|
+
* Following the optimization guide: extract inline JSX to memoized components.
|
|
8
|
+
*/
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { TextInput } from "react-native";
|
|
11
|
+
interface SearchSectionProps {
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
searchText: string;
|
|
14
|
+
onSearchChange: (text: string) => void;
|
|
15
|
+
onSearchClose: () => void;
|
|
16
|
+
searchInputRef: React.RefObject<TextInput | null>;
|
|
17
|
+
}
|
|
18
|
+
export declare const SearchSection: React.NamedExoticComponent<SearchSectionProps>;
|
|
19
|
+
interface HeaderActionsProps {
|
|
20
|
+
onSearchToggle: () => void;
|
|
21
|
+
onFilterToggle: () => void;
|
|
22
|
+
onToggleTracking: () => void;
|
|
23
|
+
onToggleFreeze: () => void;
|
|
24
|
+
onClear: () => void;
|
|
25
|
+
copyData: string;
|
|
26
|
+
isTracking: boolean;
|
|
27
|
+
isFrozen: boolean;
|
|
28
|
+
activeFilterCount: number;
|
|
29
|
+
hasRenders: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare const HeaderActions: React.NamedExoticComponent<HeaderActionsProps>;
|
|
32
|
+
interface MainListHeaderProps {
|
|
33
|
+
onBack?: () => void;
|
|
34
|
+
isSearchActive: boolean;
|
|
35
|
+
searchText: string;
|
|
36
|
+
onSearchChange: (text: string) => void;
|
|
37
|
+
onSearchToggle: () => void;
|
|
38
|
+
onSearchClose: () => void;
|
|
39
|
+
onFilterToggle: () => void;
|
|
40
|
+
onToggleTracking: () => void;
|
|
41
|
+
onToggleFreeze: () => void;
|
|
42
|
+
onClear: () => void;
|
|
43
|
+
copyData: string;
|
|
44
|
+
isTracking: boolean;
|
|
45
|
+
isFrozen: boolean;
|
|
46
|
+
activeFilterCount: number;
|
|
47
|
+
hasRenders: boolean;
|
|
48
|
+
searchInputRef: React.RefObject<TextInput | null>;
|
|
49
|
+
}
|
|
50
|
+
export declare const MainListHeader: React.NamedExoticComponent<MainListHeaderProps>;
|
|
51
|
+
type FilterViewTab = "filters" | "settings";
|
|
52
|
+
interface FilterViewHeaderProps {
|
|
53
|
+
onBack: () => void;
|
|
54
|
+
activeTab: FilterViewTab;
|
|
55
|
+
onTabChange: (tab: FilterViewTab) => void;
|
|
56
|
+
activeFilterCount?: number;
|
|
57
|
+
}
|
|
58
|
+
export declare const FilterViewHeader: React.NamedExoticComponent<FilterViewHeaderProps>;
|
|
59
|
+
export type DetailViewTab = "details" | "history";
|
|
60
|
+
interface DetailViewHeaderProps {
|
|
61
|
+
onBack: () => void;
|
|
62
|
+
activeTab: DetailViewTab;
|
|
63
|
+
onTabChange: (tab: DetailViewTab) => void;
|
|
64
|
+
hasHistory?: boolean;
|
|
65
|
+
}
|
|
66
|
+
export declare const DetailViewHeader: React.NamedExoticComponent<DetailViewHeaderProps>;
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=ModalHeaderContent.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderCauseBadge
|
|
3
|
+
*
|
|
4
|
+
* Displays a colored badge indicating why a component rendered.
|
|
5
|
+
* Used in RenderListItem and RenderDetailView.
|
|
6
|
+
*
|
|
7
|
+
* TWO-LEVEL CAUSATION:
|
|
8
|
+
* Shows both the native-level cause (what props changed on the native view)
|
|
9
|
+
* and the component-level cause (why the React component re-rendered).
|
|
10
|
+
*/
|
|
11
|
+
import React from "react";
|
|
12
|
+
import type { RenderCause, RenderCauseType, ComponentCauseType } from "../utils/RenderTracker";
|
|
13
|
+
interface CauseConfig {
|
|
14
|
+
label: string;
|
|
15
|
+
color: string;
|
|
16
|
+
tip: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const CAUSE_CONFIG: Record<RenderCauseType, CauseConfig>;
|
|
19
|
+
export declare const COMPONENT_CAUSE_CONFIG: Record<ComponentCauseType, CauseConfig>;
|
|
20
|
+
interface RenderCauseBadgeProps {
|
|
21
|
+
cause: RenderCause;
|
|
22
|
+
compact?: boolean;
|
|
23
|
+
showKeys?: boolean;
|
|
24
|
+
showTwoLevel?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function RenderCauseBadge({ cause, compact, showKeys, showTwoLevel, }: RenderCauseBadgeProps): React.JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* TwoLevelCauseBadge - A more detailed badge for detail views
|
|
29
|
+
* Shows: "ComponentName re-rendered due to PARENT → native PROPS [style]"
|
|
30
|
+
*/
|
|
31
|
+
export declare function TwoLevelCauseBadge({ cause, }: {
|
|
32
|
+
cause: RenderCause;
|
|
33
|
+
}): React.JSX.Element;
|
|
34
|
+
/**
|
|
35
|
+
* EnhancedCauseDisplay - Phase 5: Comprehensive cause display
|
|
36
|
+
* Shows detailed breakdown of why a component rendered with clear sections
|
|
37
|
+
*/
|
|
38
|
+
export declare function EnhancedCauseDisplay({ cause, nativeType, }: {
|
|
39
|
+
cause: RenderCause;
|
|
40
|
+
nativeType?: string;
|
|
41
|
+
}): React.JSX.Element;
|
|
42
|
+
export default RenderCauseBadge;
|
|
43
|
+
//# sourceMappingURL=RenderCauseBadge.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderDetailView
|
|
3
|
+
*
|
|
4
|
+
* Minimal, glanceable view for render details.
|
|
5
|
+
* Design principle: Dev should understand WHY in 3 seconds.
|
|
6
|
+
*
|
|
7
|
+
* Layout:
|
|
8
|
+
* - Header: Component name + native type
|
|
9
|
+
* - Answer Card: Cause badges + hook change (THE answer)
|
|
10
|
+
* - History Row: Compact inline navigation
|
|
11
|
+
*/
|
|
12
|
+
import React from "react";
|
|
13
|
+
import type { TrackedRender, FilterPattern } from "../utils/RenderTracker";
|
|
14
|
+
interface RenderDetailViewProps {
|
|
15
|
+
render: TrackedRender;
|
|
16
|
+
/** If true, do not render the internal footer in history view */
|
|
17
|
+
disableInternalFooter?: boolean;
|
|
18
|
+
/** Selected event index for history view (controlled) */
|
|
19
|
+
selectedEventIndex?: number;
|
|
20
|
+
/** Callback when event index changes in history view */
|
|
21
|
+
onEventIndexChange?: (index: number) => void;
|
|
22
|
+
/** Callback to add a filter pattern (include or exclude) */
|
|
23
|
+
onAddFilter?: (pattern: FilterPattern, mode: "include" | "exclude") => void;
|
|
24
|
+
/** Whether the user has Pro license (enables all features) */
|
|
25
|
+
isPro?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function RenderDetailView({ render, disableInternalFooter, selectedEventIndex: externalIndex, onEventIndexChange: externalOnChange, onAddFilter, isPro, }: RenderDetailViewProps): React.JSX.Element;
|
|
28
|
+
export default RenderDetailView;
|
|
29
|
+
//# sourceMappingURL=RenderDetailView.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderHistoryViewer
|
|
3
|
+
*
|
|
4
|
+
* Displays render history for a component with event stepping.
|
|
5
|
+
* Allows navigating through render events chronologically.
|
|
6
|
+
* Shows current state view or diff view between renders.
|
|
7
|
+
*/
|
|
8
|
+
import React from "react";
|
|
9
|
+
import type { TrackedRender } from "../utils/RenderTracker";
|
|
10
|
+
interface RenderHistoryViewerProps {
|
|
11
|
+
render: TrackedRender;
|
|
12
|
+
/** If true, use external footer (modal provides it) */
|
|
13
|
+
disableInternalFooter?: boolean;
|
|
14
|
+
/** Selected event index (0 = oldest) */
|
|
15
|
+
selectedEventIndex?: number;
|
|
16
|
+
/** Callback when event index changes */
|
|
17
|
+
onEventIndexChange?: (index: number) => void;
|
|
18
|
+
/** If true, show all events. Otherwise limit to FREE_TIER_EVENT_LIMIT */
|
|
19
|
+
isPro?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Main RenderHistoryViewer component
|
|
23
|
+
*/
|
|
24
|
+
export declare function RenderHistoryViewer({ render, disableInternalFooter, selectedEventIndex: externalIndex, onEventIndexChange: externalOnChange, isPro, }: RenderHistoryViewerProps): React.JSX.Element;
|
|
25
|
+
/**
|
|
26
|
+
* External footer component for modal integration
|
|
27
|
+
* Uses renderHistory for events (only available when history tracking is enabled)
|
|
28
|
+
*/
|
|
29
|
+
export declare function RenderHistoryFooter({ render, selectedEventIndex, onEventIndexChange, isPro, }: {
|
|
30
|
+
render: TrackedRender;
|
|
31
|
+
selectedEventIndex?: number;
|
|
32
|
+
onEventIndexChange?: (index: number) => void;
|
|
33
|
+
isPro?: boolean;
|
|
34
|
+
}): React.JSX.Element | null;
|
|
35
|
+
export default RenderHistoryViewer;
|
|
36
|
+
//# sourceMappingURL=RenderHistoryViewer.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RenderListItem
|
|
3
|
+
*
|
|
4
|
+
* Compact list item showing a tracked component render.
|
|
5
|
+
* Displays viewType, identifier (testID/nativeID/component), render count, and timing.
|
|
6
|
+
*/
|
|
7
|
+
import React from "react";
|
|
8
|
+
import type { TrackedRender } from "../utils/RenderTracker";
|
|
9
|
+
interface RenderListItemProps {
|
|
10
|
+
render: TrackedRender;
|
|
11
|
+
onPress: (render: TrackedRender) => void;
|
|
12
|
+
}
|
|
13
|
+
declare function RenderListItemInner({ render, onPress }: RenderListItemProps): React.JSX.Element;
|
|
14
|
+
export declare const RenderListItem: React.MemoExoticComponent<typeof RenderListItemInner>;
|
|
15
|
+
export default RenderListItem;
|
|
16
|
+
//# sourceMappingURL=RenderListItem.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StatsDisplay
|
|
3
|
+
*
|
|
4
|
+
* Isolated component for displaying render statistics in the header.
|
|
5
|
+
* Subscribes to RenderTracker updates independently so parent header
|
|
6
|
+
* doesn't re-render when stats change.
|
|
7
|
+
*
|
|
8
|
+
* Following the optimization guide: move subscriptions to child components.
|
|
9
|
+
*/
|
|
10
|
+
import React from "react";
|
|
11
|
+
/**
|
|
12
|
+
* Isolated stats display that owns its own subscription.
|
|
13
|
+
* Only this component re-renders when stats change.
|
|
14
|
+
*/
|
|
15
|
+
declare function StatsDisplayInner(): React.JSX.Element;
|
|
16
|
+
export declare const StatsDisplay: React.MemoExoticComponent<typeof StatsDisplayInner>;
|
|
17
|
+
export default StatsDisplay;
|
|
18
|
+
//# sourceMappingURL=StatsDisplay.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highlight Updates Modal Components
|
|
3
|
+
*/
|
|
4
|
+
export { HighlightUpdatesModal } from "./HighlightUpdatesModal";
|
|
5
|
+
export { RenderListItem } from "./RenderListItem";
|
|
6
|
+
export { RenderDetailView } from "./RenderDetailView";
|
|
7
|
+
export { HighlightFilterView } from "./HighlightFilterView";
|
|
8
|
+
export { IdentifierBadge, CategoryBadge, IDENTIFIER_CONFIG, type IdentifierType, } from "./IdentifierBadge";
|
|
9
|
+
export { IsolatedRenderList } from "./IsolatedRenderList";
|
|
10
|
+
export { StatsDisplay } from "./StatsDisplay";
|
|
11
|
+
export { MainListHeader, FilterViewHeader, DetailViewHeader, HeaderActions, SearchSection, } from "./ModalHeaderContent";
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Highlight Updates Controller
|
|
3
|
+
*
|
|
4
|
+
* Standalone implementation that replicates React DevTools' "Highlight updates
|
|
5
|
+
* when components render" feature WITHOUT requiring DevTools to be connected.
|
|
6
|
+
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* This controller directly enables the DevTools backend's traceUpdates feature
|
|
9
|
+
* by calling setTraceUpdatesEnabled(true) on each renderer interface. This is
|
|
10
|
+
* the same function that DevTools' frontend calls when you check the
|
|
11
|
+
* "Highlight updates when components render" checkbox.
|
|
12
|
+
*
|
|
13
|
+
* Key insight: The rendererInterfaces are available on the global hook even
|
|
14
|
+
* without DevTools frontend connected. We just need to enable tracing directly.
|
|
15
|
+
*
|
|
16
|
+
* Flow:
|
|
17
|
+
* 1. User enables highlights via toggle()
|
|
18
|
+
* 2. We call rendererInterface.setTraceUpdatesEnabled(true) on all renderers
|
|
19
|
+
* 3. DevTools backend now tracks renders and emits 'traceUpdates' events
|
|
20
|
+
* 4. We subscribe to 'traceUpdates' via hook.sub()
|
|
21
|
+
* 5. When components re-render, we receive the Set of host stateNodes
|
|
22
|
+
* 6. We measure each node and render colored border highlights
|
|
23
|
+
*
|
|
24
|
+
* This gives us 100% accuracy with DevTools behavior because we're using the
|
|
25
|
+
* exact same detection code - we're just enabling it programmatically.
|
|
26
|
+
*/
|
|
27
|
+
interface HighlightRect {
|
|
28
|
+
id: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
color: string;
|
|
34
|
+
count: number;
|
|
35
|
+
}
|
|
36
|
+
type HighlightCallback = (rects: HighlightRect[]) => void;
|
|
37
|
+
type BadgePressCallback = (nativeTag: number) => void;
|
|
38
|
+
/**
|
|
39
|
+
* Set the callback for rendering highlights
|
|
40
|
+
*/
|
|
41
|
+
declare function setHighlightCallback(callback: HighlightCallback | null): void;
|
|
42
|
+
/**
|
|
43
|
+
* Set the callback for when a badge is pressed.
|
|
44
|
+
* This is used to navigate to the detail view when a user taps a render count badge.
|
|
45
|
+
*/
|
|
46
|
+
declare function setBadgePressCallback(callback: BadgePressCallback | null): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get the current badge press callback.
|
|
49
|
+
* Used by the overlay to check if badge presses should be handled.
|
|
50
|
+
*/
|
|
51
|
+
declare function getBadgePressCallback(): BadgePressCallback | null;
|
|
52
|
+
/**
|
|
53
|
+
* Handle a badge press event.
|
|
54
|
+
* Calls the registered callback with the nativeTag of the component.
|
|
55
|
+
*/
|
|
56
|
+
declare function handleBadgePress(nativeTag: number): void;
|
|
57
|
+
type SpotlightCallback = (nativeTag: number | null) => void;
|
|
58
|
+
/**
|
|
59
|
+
* Set the callback for spotlight highlighting.
|
|
60
|
+
* Used by the overlay to show a special highlight for the component being viewed.
|
|
61
|
+
*/
|
|
62
|
+
declare function setSpotlightCallback(callback: SpotlightCallback | null): void;
|
|
63
|
+
/**
|
|
64
|
+
* Set a spotlight highlight on a specific component.
|
|
65
|
+
* This is used when viewing a component's detail to show which one it is.
|
|
66
|
+
*/
|
|
67
|
+
declare function setSpotlight(nativeTag: number | null): void;
|
|
68
|
+
/**
|
|
69
|
+
* Get the current spotlight nativeTag.
|
|
70
|
+
*/
|
|
71
|
+
declare function getSpotlight(): number | null;
|
|
72
|
+
declare function subscribe(listener: (enabled: boolean) => void): () => void;
|
|
73
|
+
declare function initialize(): boolean;
|
|
74
|
+
declare function enable(): void;
|
|
75
|
+
declare function disable(): void;
|
|
76
|
+
declare function toggle(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Clear all render counts and tracked data
|
|
79
|
+
*/
|
|
80
|
+
declare function clearRenderCounts(): void;
|
|
81
|
+
declare function isEnabled(): boolean;
|
|
82
|
+
declare function setEnabled(enabled: boolean): void;
|
|
83
|
+
/**
|
|
84
|
+
* Subscribe to freeze state changes
|
|
85
|
+
*/
|
|
86
|
+
declare function subscribeToFreeze(listener: (frozen: boolean) => void): () => void;
|
|
87
|
+
/**
|
|
88
|
+
* Freeze highlights - prevents highlights from fading away.
|
|
89
|
+
* New renders are still captured but old highlights don't clear.
|
|
90
|
+
*/
|
|
91
|
+
declare function freeze(): void;
|
|
92
|
+
/**
|
|
93
|
+
* Unfreeze highlights - resumes normal cleanup behavior.
|
|
94
|
+
* Clears all current highlights when unfreezing.
|
|
95
|
+
*/
|
|
96
|
+
declare function unfreeze(): void;
|
|
97
|
+
/**
|
|
98
|
+
* Toggle freeze state
|
|
99
|
+
*/
|
|
100
|
+
declare function toggleFreeze(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Check if freeze mode is active
|
|
103
|
+
*/
|
|
104
|
+
declare function getFrozen(): boolean;
|
|
105
|
+
declare function destroy(): void;
|
|
106
|
+
interface HighlightUpdatesControllerAPI {
|
|
107
|
+
subscribe: typeof subscribe;
|
|
108
|
+
enable: typeof enable;
|
|
109
|
+
disable: typeof disable;
|
|
110
|
+
toggle: typeof toggle;
|
|
111
|
+
isEnabled: typeof isEnabled;
|
|
112
|
+
setEnabled: typeof setEnabled;
|
|
113
|
+
initialize: typeof initialize;
|
|
114
|
+
destroy: typeof destroy;
|
|
115
|
+
isInitialized: () => boolean;
|
|
116
|
+
setHighlightCallback: typeof setHighlightCallback;
|
|
117
|
+
clearRenderCounts: typeof clearRenderCounts;
|
|
118
|
+
freeze: typeof freeze;
|
|
119
|
+
unfreeze: typeof unfreeze;
|
|
120
|
+
toggleFreeze: typeof toggleFreeze;
|
|
121
|
+
getFrozen: typeof getFrozen;
|
|
122
|
+
subscribeToFreeze: typeof subscribeToFreeze;
|
|
123
|
+
setBadgePressCallback: typeof setBadgePressCallback;
|
|
124
|
+
getBadgePressCallback: typeof getBadgePressCallback;
|
|
125
|
+
handleBadgePress: typeof handleBadgePress;
|
|
126
|
+
setSpotlightCallback: typeof setSpotlightCallback;
|
|
127
|
+
setSpotlight: typeof setSpotlight;
|
|
128
|
+
getSpotlight: typeof getSpotlight;
|
|
129
|
+
}
|
|
130
|
+
declare const HighlightUpdatesController: HighlightUpdatesControllerAPI;
|
|
131
|
+
export default HighlightUpdatesController;
|
|
132
|
+
//# sourceMappingURL=HighlightUpdatesController.d.ts.map
|