newrelic / newrelic-browser-agent

New Relic Browser Agent
Apache License 2.0
77 stars 40 forks source link

feat: logging bundle optimization #1089

Closed metal-messiah closed 3 months ago

metal-messiah commented 3 months ago

Improve the bundle size of the logging feature by moving non-critical pieces to the aggregation portion of the agent code.

Overview

This PR shifts deferrable portions of the logging feature logic to the aggregator portion of the agent to improve loader build size.

Related Issue(s)

Testing

Tests have been shifted to match new locations, but logic should remain

github-actions[bot] commented 3 months ago

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 34.73 kB / 12.13 kB (gzip) 34.1 kB / 11.9 kB (gzip) -1.82% / -1.9% (gzip)
lite async-chunk 50.09 kB / 16.18 kB (gzip) 50.09 kB / 16.18 kB (gzip) 0% / 0% (gzip)
pro loader 55.29 kB / 18.72 kB (gzip) 54.79 kB / 18.54 kB (gzip) -0.91% / -0.93% (gzip)
pro async-chunk 96.12 kB / 28.85 kB (gzip) 96.73 kB / 28.99 kB (gzip) 0.63% / 0.47% (gzip)
spa loader 63.23 kB / 21.14 kB (gzip) 62.73 kB / 20.97 kB (gzip) -0.79% / -0.8% (gzip)
spa async-chunk 111.23 kB / 33.23 kB (gzip) 111.84 kB / 33.37 kB (gzip) 0.55% / 0.42% (gzip)
lite-polyfills loader 128.42 kB / 41.46 kB (gzip) 127.73 kB / 41.2 kB (gzip) -0.54% / -0.62% (gzip)
lite-polyfills async-chunk 63.99 kB / 18.45 kB (gzip) 63.99 kB / 18.45 kB (gzip) 0% / 0% (gzip)
pro-polyfills loader 150.62 kB / 47.69 kB (gzip) 150.11 kB / 47.49 kB (gzip) -0.33% / -0.42% (gzip)
pro-polyfills async-chunk 116.19 kB / 31.08 kB (gzip) 116.72 kB / 31.22 kB (gzip) 0.45% / 0.44% (gzip)
spa-polyfills loader 158.81 kB / 49.85 kB (gzip) 158.31 kB / 49.65 kB (gzip) -0.32% / -0.39% (gzip)
spa-polyfills async-chunk 133.16 kB / 35.78 kB (gzip) 133.69 kB / 35.92 kB (gzip) 0.39% / 0.38% (gzip)
codecov[bot] commented 3 months ago

Codecov Report

Attention: Patch coverage is 89.28571% with 3 lines in your changes missing coverage. Please review.

Project coverage is 87.66%. Comparing base (03efcf3) to head (c08747e). Report is 2 commits behind head on main.

Files Patch % Lines
src/features/logging/aggregate/index.js 87.50% 3 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1089 +/- ## ========================================== + Coverage 87.62% 87.66% +0.03% ========================================== Files 162 162 Lines 7249 7254 +5 Branches 1421 1421 ========================================== + Hits 6352 6359 +7 + Misses 781 779 -2 Partials 116 116 ``` | [Flag](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1089/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | Coverage Δ | | |---|---|---| | [unit-tests](https://app.codecov.io/gh/newrelic/newrelic-browser-agent/pull/1089/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic) | `76.43% <90.00%> (+<0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=newrelic#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 3 months ago

Static Badge

Last ran on June 26, 2024 18:15:04 CDT Checking merge of (9c57682eff9ffb93a0e1f1d41ba17a926ddb9698) into main (03efcf36656ac883c4431829fda1bad6445373a1)