Closed patrickhousley closed 2 months ago
Merging this pull request will result in the following asset size changes: |
Agent | Asset | Previous Size | New Size | Diff |
---|---|---|---|---|---|
lite | loader | 32.43 kB / 11.32 kB (gzip) | 32.43 kB / 11.32 kB (gzip) | 0% / 0% (gzip) | |
lite | async-chunk | 49.74 kB / 16.03 kB (gzip) | 49.74 kB / 16.03 kB (gzip) | 0% / 0% (gzip) | |
pro | loader | 53.29 kB / 18.04 kB (gzip) | 53.29 kB / 18.04 kB (gzip) | 0% / 0% (gzip) | |
pro | async-chunk | 95.97 kB / 28.7 kB (gzip) | 95.97 kB / 28.7 kB (gzip) | 0% / 0% (gzip) | |
spa | loader | 61.23 kB / 20.47 kB (gzip) | 61.23 kB / 20.47 kB (gzip) | 0% / 0% (gzip) | |
spa | async-chunk | 111.02 kB / 33.03 kB (gzip) | 111.02 kB / 33.03 kB (gzip) | 0% / 0% (gzip) | |
lite-polyfills | loader | 125.97 kB / 40.61 kB (gzip) | 125.97 kB / 40.61 kB (gzip) | 0% / 0% (gzip) | |
lite-polyfills | async-chunk | 63.67 kB / 18.32 kB (gzip) | 63.67 kB / 18.32 kB (gzip) | 0% / 0% (gzip) | |
pro-polyfills | loader | 148.54 kB / 46.94 kB (gzip) | 148.54 kB / 46.94 kB (gzip) | 0% / 0% (gzip) | |
pro-polyfills | async-chunk | 116 kB / 30.94 kB (gzip) | 116 kB / 30.94 kB (gzip) | 0% / 0% (gzip) | |
spa-polyfills | loader | 156.73 kB / 49.1 kB (gzip) | 156.73 kB / 49.1 kB (gzip) | 0% / 0% (gzip) | |
spa-polyfills | async-chunk | 132.9 kB / 35.6 kB (gzip) | 132.9 kB / 35.6 kB (gzip) | 0% / 0% (gzip) |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 87.70%. Comparing base (
e5bab92
) to head (7a3e4ea
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please add a one-paragraph summary here, suitable for a release notes description. This will help with documentation.
Overview
This removes the old
import ... assert ...
keyword usage in favor ofrequire
. Theassert
keyword was added in Node 16 but the keyword was changed in Node 18 towith
. Theassert
keyword for imports was removed in Node 22 causing builds of our project to fail when running with Node 22.The replacement implementation creates a
require
function usingmodule.createRequire(import.meta.url)
. This is supported all the way back to Node 12 and is not markedexperimental
in any way within the Node docs. This should be a stable way to import a JSON file for some time.The alternative is to use
import ... with ...
but thewith
keyword is still under development but it is a tc39 standard that has reached stage 3 and could probably be expected to be pretty stable to use now. This would limit us and ppl forking and building the project to using Node 18 or later.Related Issue(s)
https://new-relic.atlassian.net/browse/NR-265288
Testing