chore: bump version to 4.0.0#562
Closed
John-David Dalton (jdalton) wants to merge 6 commits intomainfrom
Closed
Conversation
Breaking changes:
- Remove unused @socketregistry/packageurl-js dependency
- Remove deprecated getSupportedScanFiles() (use getSupportedFiles())
- Unify file-upload onto httpRequest() transport, remove getHttpModule/getResponse
- Replace http2-wrapper type with native node:http2 ClientHttp2Session
- Trim public API surface: remove internal helpers, utilities, and constants from exports
- Remove http2-wrapper devDependency
Performance:
- NDJSON linear scan replaces .split('\n') in 4 locations
- queryToSearchParams avoids double URLSearchParams instantiation
- sanitizeHeaders deferred behind if guards (6 locations)
- batchPackageStream generator queue uses Map for O(1) operations
- Alert filter+map replaced with single-pass reduce
Bug fixes: - Fix streamFullScan using MAX_STREAM_SIZE (100MB) instead of MAX_RESPONSE_SIZE (10MB) when buffering response in memory - Add missing maxResponseSize to createUploadRequest Performance: - Cache reqOptionsWithHooks object — eliminates 60 object spreads per session (one per API method call) - Precompute allowedActions as Set in reshapeArtifactForPublicPolicy for O(1) membership checks instead of Array.includes O(n) Dead code removal: - Remove unused getErrorResponseBody (was just response.text() wrapper) - Remove unused createRequestBodyForJson (never called) - Remove stale createUserAgentFromPkgJson re-export from utils.ts
FormData is a pipeable Stream with getHeaders() for multipart boundary. httpRequest from lib duck-types getHeaders() to auto-merge Content-Type.
- Fix test description: "IncomingMessage" → "HttpResponse" in getApi tests - Add hook deferral tests: verify hooks/sanitizeHeaders not called when absent - Add queryToSearchParams early-return path test (no normalization needed) - Add allowedActions Set exact-match test (spaces in comma-separated values) - Fix stale comment referencing removed getErrorResponseBody
The pre-commit formatter reverted all v4 source changes during subsequent commits. This restores the correct state with all v4 breaking changes, perf optimizations, and test updates intact.
Contributor
Author
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.
Summary
Bump version to 4.0.0 with comprehensive breaking changes, performance improvements, and dependency cleanup.
Breaking Changes
HttpResponsefrom@socketsecurity/lib/http-requestinstead ofIncomingMessagenode:http/getResponse()tohttpRequest()— single transport stackgetHttpModule,getResponse,getSupportedScanFiles(),PromiseQueue@socketregistry/packageurl-js(unused),http2-wrapper(replaced by nativenode:http2)Performance (-471 lines, net)
.split('\n')→ single-pass linear scan (4 locations)queryToSearchParams: avoid doubleURLSearchParamsinstantiationsanitizeHeaders: deferred behindifguards (6 locations)batchPackageStream:findIndex+splice→Mapfor O(1) operationsfilter+map→ single-passreduceTest plan
pnpm buildpassespnpm test— 20 test files, 568 tests pass