feat: add cache and webvitals tabs to inspector and improve ux with dragable overlay #127
+1,809
−323
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request enhances the Magento block inspector hints system by adding detailed performance and cache metrics to frontend block metadata. It introduces a new
BlockCacheCollectorservice to gather cache-related information and render timings, and integrates these metrics into the inspector hints for improved debugging and profiling.CSS refactoring
Add Styles to inspector.css
Inspector Hints Performance & Cache Metrics Integration
Inspector hints decorator improvements:
InspectorHintsclass now measures the render time of each block, calculates metrics, and passes them to the inspector attributes for frontend debugging. This includes render duration in milliseconds and timestamps. [1] [2]injectInspectorAttributesmethod is updated to accept and include performance and cache metrics in the metadata JSON output for each block. [1] [2] [3]New cache metrics collector service:
BlockCacheCollector, a new service that safely extracts cache configuration (lifetime, key, tags, cacheability) and determines if the page is cacheable. It also formats both performance and cache metrics for frontend consumption, with strict type safety.InspectorHintsconstructor is updated to accept aBlockCacheCollectordependency, enabling it to gather cache metrics for each block. [1] [2]Dependency injection configuration:
di.xmlto register the newBlockCacheCollectorservice and inject it into theInspectorHintsdecorator, ensuring the new metrics are available in the frontend inspector hints.