This brings node v18 support to lab v25. Unfortunately this PR is a little ugly— there are two things going on here:
The source-map library doesn't function properly on node v18 because it thinks it's in a browser environment due to the existence of fetch() (see https://github.com/mozilla/source-map/issues/454). To get around this I've implemented a hack to remove and then replace fetch() as carefully as possible while requiring the source-maps module. Other options I considered were using source-maps beta version, or moving to the @jridgewell/trace-mapping module. I didn't use the beta version both because it's a beta and because it hasn't been touched in years, so there's a chance it will never leave beta. I didn't move to @jridgewell/trace-mapping because I wasn't able to assess whether we'd be able to use it for lab's HTML reporter, which uses a source-maps API that is not faithfully recreated in @jridgewell/trace-mapping.
I added node v18 globals to leak detection. These should be able to be removed once #1044 lands in the v25 branch. I believe that we can also get rid of some other globals at that time that to my knowledge are no longer in any version of node such as the DTRACE_* globals.
This brings node v18 support to lab v25. Unfortunately this PR is a little ugly— there are two things going on here:
fetch()
(see https://github.com/mozilla/source-map/issues/454). To get around this I've implemented a hack to remove and then replacefetch()
as carefully as possible while requiring the source-maps module. Other options I considered were using source-maps beta version, or moving to the @jridgewell/trace-mapping module. I didn't use the beta version both because it's a beta and because it hasn't been touched in years, so there's a chance it will never leave beta. I didn't move to @jridgewell/trace-mapping because I wasn't able to assess whether we'd be able to use it for lab's HTML reporter, which uses a source-maps API that is not faithfully recreated in @jridgewell/trace-mapping.I added node v18 globals to leak detection. These should be able to be removed once #1044 lands in the v25 branch.I believe that we can also get rid of some other globals at that time that to my knowledge are no longer in any version of node such as theDTRACE_*
globals.