Skip to content

Commit

Permalink
fix: update deps, drop node 14 support (BREAKING CHANGE) (#80)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Require Node v16.3.0+
  • Loading branch information
nolanlawson authored Aug 6, 2023
1 parent 1a92f03 commit 6f22ba0
Show file tree
Hide file tree
Showing 7 changed files with 345 additions and 168 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
matrix:
# The lowest one should be the minimum supported node version, per package.json "engines" field
node: [ 14.17.0, 16, 18 ]
node: [ "16.3.0", "18", "20" ]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand Down
12 changes: 5 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
],
"scripts": {
"test": "run-p --race test:serve test:mocha",
"test:serve": "serve",
"test:serve": "serve --no-request-logging",
"test:mocha": "mocha ./test/spec/",
"lint": "standard",
"version": "run-s version:changelog version:add",
Expand All @@ -27,16 +27,15 @@
"as-table": "^1.0.55",
"atob": "^2.1.2",
"chalk": "^5.3.0",
"commander": "^10.0.1",
"commander": "^11.0.0",
"crypto-random-string": "^5.0.0",
"exit-hook": "3.2.0",
"node-abort-controller": "^3.0.1",
"node-fetch": "^3.3.1",
"ono": "^7.1.3",
"ora": "^6.3.1",
"ora": "^7.0.1",
"please-upgrade-node": "^3.2.0",
"pretty-bytes": "^6.1.1",
"puppeteer": "^19.11.1",
"puppeteer": "^21.0.1",
"quick-lru": "^6.1.1",
"source-map": "^0.7.4",
"stacktrace-parser": "^0.1.10",
Expand Down Expand Up @@ -69,9 +68,8 @@
"url": "https://github.com/nolanlawson/fuite/issues"
},
"homepage": "https://github.com/nolanlawson/fuite#readme",
"//": "Require Node 14 and ES modules: https://git.io/JMbBG",
"engines": {
"node": ">= 14.17.0"
"node": ">= 16.3.0"
},
"volta": {
"node": "16.20.1",
Expand Down
5 changes: 0 additions & 5 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import { formatResult } from './format.js'
import chalk from 'chalk'
import { createWriteStream } from 'fs'
import { pathToFileURL } from 'url'
import { AbortController as AbortControllerPolyfill } from 'node-abort-controller'

if (typeof AbortController !== 'function') {
global.AbortController = AbortControllerPolyfill
}

const require = createRequire(import.meta.url)
const { version } = require('../package.json')
Expand Down
1 change: 1 addition & 0 deletions src/metrics/heapsnapshots/analyzeHeapsnapshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const browserInternalClasses = new Set([
'(string)',
'(system)',
'InternalNode',
'DOMRectReadOnly', // used by LayoutShift/LayoutShiftAttribution, gBCR returns DOMRect
'LayoutShift',
'LayoutShiftAttribution',
'PerformanceEntry',
Expand Down
8 changes: 7 additions & 1 deletion src/prettifyStacktrace.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ import asTable from 'as-table'
export async function prettifyStacktrace (stacktrace) {
const parsed = stackTraceParser.parse(stacktrace)
// remove the puppeteer code itself; this is confusing for devs since we wrote this code, not them
.filter(({ file }) => !(file && file.includes('__puppeteer_evaluation_script__')))
.filter(({ file, methodName }) => {
return !(
file && file.includes('__puppeteer_evaluation_script__')
) && !(
methodName && methodName.includes('pptr:evaluate')
)
})
const parsedWithSourceMaps = await Promise.all(parsed.map(async (original) => {
const { lineNumber, methodName, file, column } = original
if (/^https?:\/\//.test(original.file)) { // looks like a URL we can fetch
Expand Down
6 changes: 5 additions & 1 deletion test/spec/collections.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { expect } from 'chai'
import { asyncIterableToArray } from './util.js'
import { omit } from '../../src/util.js'

const normalizeStackTrace = stacktrace => stacktrace.trim().split('\n').map(_ => _.trim())
const normalizeStackTrace = stacktrace => {
return stacktrace.trim()
.split('\n')
.map(_ => _.trim().split(/\s+/))
}

describe('collections', () => {
it('can detect leaking collections', async () => {
Expand Down
Loading

0 comments on commit 6f22ba0

Please sign in to comment.