feat: trim dependencies, drop Node 16, and target ES2020 - #667
Merged
Conversation
Removes 19 unused or redundant packages, drops Node 16 support, and retargets the build from IE 10 to an ES2020 baseline. Dependencies go from 9 to 6, devDependencies from 50 to 34, and the lockfile from 1266 to 850 entries. Removed: - puppeteer, puppeteer-core — only supplied a Chrome binary the CI runner already provides. karma-chrome-launcher resolves google-chrome from PATH, and the puppeteer-installed binary was never wired up via CHROME_BIN, so the install step was a no-op. - request — replaced with axios (already a dependency) across 7 test call sites. The stream-upload test was also pointed at a live URL; its previous one had started returning 404, so the test was uploading an error page and asserting on the filename. - qs, @types/qs — replaced with native URLSearchParams at the single call site in src/redirect_url.ts. The encoding is byte-identical and is now pinned by a test, since the analytics endpoint parses that URL. - @babel/runtime, @babel/plugin-transform-runtime — helpers are inlined instead. Gzipped output is unchanged and consumers no longer install 1.1 MB of runtime helpers. - @babel/plugin-proposal-class-properties, @babel/plugin-proposal-object-rest-spread, @babel/plugin-transform-object-assign — redundant under preset-env; verified by a byte-identical build. - @babel/node, json-loader, nyc, karma-sauce-launcher — unreferenced anywhere in the repo. - husky, @commitlint/cli, @commitlint/config-conventional — dead configuration. The husky.hooks block was v4 syntax that v8 ignores, there was no .husky directory or commitlint config, and no workflow invoked either, so the pre-commit hook had not been running. - eslint-plugin-sonarjs. - @babel/register — no longer needed once Node 16 is dropped. Node 16 reached end of life on 2023-09-11 and is no longer supported: babel-register.js and the unit-node16 CI job are removed and engines.node moves to >=18. The Babel target moves from "ie >= 10" to an ES2020 baseline. Note that removing "ie >= 10" alone changed nothing, because "last 2 versions" still pulled in op_mini, BlackBerry and kaios, which force ES5 on their own. The new floor cuts the gzipped browser bundle from 42,771 to 38,831 bytes (-9%) at 91% global browser coverage. Also fixes karma.config.js replacing the base webpack plugins rather than extending them, which left process.env references unsubstituted whenever credentials were absent and produced a "process is not defined" error in the browser suite.
oliverlaz
requested review from
JimmyPettersson85,
MartinCupela and
itsmeadi
as code owners
September 1, 2026 11:41
Contributor
|
Size Change: +17.5 kB (+16.01%) Total Size: 127 kB 📦 View Changed
|
testdouble 3.20.2 added lib/can-register-loader.js, which does `require('module')`. webpack 5 does not polyfill Node builtins for browser targets, so the karma bundle failed to compile and emitted no asset for the browser-test-helper entry. karma-webpack then readFileSync'd that missing asset (lib/webpack/plugin.js:22), threw ENOENT, and never exited — turning a six-second build error into an indefinite hang.
Stubbing `module` resolves it to an empty object, so testdouble's `Module.register` check is undefined, which is the correct answer in a browser.
Also caps the browser job at 10 minutes, since karma-webpack reports bundle failures as hangs rather than errors. A healthy run takes about two minutes.
szuperaz
approved these changes
Sep 1, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Removes 19 unused or redundant packages, drops Node 16, and retargets the build from IE 10 to an ES2020 baseline.
dependenciesdevDependenciesyarn.lockentriesdistmin+gzipRemoved
puppeteer,puppeteer-core— these only supplied a Chrome binary that the CI runner already provides.karma-chrome-launcherresolvesgoogle-chromefromPATH, and the puppeteer-installed binary was never wired up viaCHROME_BIN, so theInstall Chromestep was a no-op. ThePUPPETEER_SKIP_DOWNLOADenv insize.ymland theskip-puppeteeraction input go with them.request(deprecated since 2020) — replaced withaxios, which is already a dependency, across 7 test call sites. The callback-style tests became zero-arg async functions, which also means they now getwrapFn's failure-tracking and skip handling.qs,@types/qs— replaced with nativeURLSearchParamsat the single call site,src/redirect_url.ts.@types/qshad zero references in the published.d.ts.@babel/runtime,@babel/plugin-transform-runtime— helpers are inlined instead. This is the only removal that touches runtimedependencies: consumers stop installing 1.1 MB / 245 files, and the gzipped bundle is actually 75 bytes smaller.@babel/plugin-proposal-class-properties,@babel/plugin-proposal-object-rest-spread,@babel/plugin-transform-object-assign— redundant underpreset-env.@babel/node,json-loader,nyc,karma-sauce-launcher— unreferenced anywhere in the repo.husky,@commitlint/cli,@commitlint/config-conventional— dead configuration. Thehusky.hooksblock was v4 syntax that v8 ignores, there was no.husky/directory, nohusky installinprepare, and no commitlint config or workflow invoking either. The pre-commit hook had not been running; CI still enforces lint vialint.yml.eslint-plugin-sonarjs, and@babel/register(unneeded once Node 16 is gone).Node 16 dropped
Node 16 reached end of life on 2023-09-11.
babel-register.js(a bespoke@babel/registershim with a customimport.metaplugin) and theunit-node16CI job are gone,engines.nodemoves to>=18, and the README is updated.test-unit-nodeis now the only unit-test entry point, so CI runs exactly what you run locally — previously the Babel path could drift from thetsxpath silently.ES2020 target
Worth knowing: removing
ie >= 10on its own changes nothing, becauselast 2 versionsstill pulls inop_mini all,bb 7,ie_mobandkaios 2.5, which force full ES5 by themselves. A real floor was needed.last 2 versions, not deadwas measured too, but it covers only 65.9% of users — it means the two newest releases of each browser. The ES2020 minimums land at 91.3% coverage for ~5 KB more than that aggressive option.Verification
yarn install --immutable,lint,build,types,test-typesanddistall pass. Unit tests: 145 passing. The one local failure isshould follow redirect urls, which makes a real HTTP call and 401s without valid credentials — it fails identically before and after this change.The
qs→URLSearchParamsswap changes a URL that the analytics endpoint parses, so it was done with a characterization test written first:should encode the query string exactlypasses unchanged against both the old and new implementations. It pins spaces as%20(never+) and~as literal (never%7E) — the two places whereURLSearchParamsandqs.stringifydiverge, which is what the two.replace()calls inredirect_url.tsare for. Please don't remove them.The
@babel/plugin-proposal-*removals were verified by compiling all 17srcfiles with and without them and diffing: byte-identical. All 17 files in the builtlib/parse as ES2020 with no ES2021+ syntax.Two things can only be checked in CI: the cloud integration tests exercising the axios rewrites, and
test-browser.Please look at these
.yarnrc.ymlflipsenableHardenedMode: true→false. This is the one line here that is security-relevant rather than cleanup — hardened mode is what makes Yarn verify lockfile integrity against the registry in CI. Included deliberately; happy to split it out.feat:for a minor release as intended, but note that dropping Node 16 and moving the browser floor to Chrome 80 / Safari 13.1 are breaking for anyone on those runtimes. Release notes should call out all three consumer-visible changes: the Node floor, the browser floor, and@babel/runtimeno longer being installed.files.jsfetchedhttp://nodejs.org/images/logo.png, which now returns 404. It passed anyway becauseform-dataderived the filename fromrequest's internals rather than the response, so it was uploading an HTML error page and asserting on the name. Now points at a live URL with an explicit filename.Also fixed
karma.config.jsreplaced the base webpack plugins instead of extending them, dropping theDefinePluginthat definesprocess.env.PACKAGE_VERSION. Combined withEnvironmentPluginonly substituting env keys that are actually set, this left bareprocess.envreferences in the bundle and producedprocess is not definedwhenever credentials were absent. It now extends the base plugins and supplies defaults for the five variables the bundle reads, so a credential-less run fails with the tests' own error message instead.