feat(lodash): add sum/mean/sumBy/meanBy/head/last/tail to manifest#966
Merged
Conversation
- New runtime exports js_lodash_sum/_mean/_sum_by/_mean_by in perry-stdlib (head/last/tail already existed). - Manifest rows for sum/mean/sumBy/meanBy/tail (head/last were already in the manifest). - NativeModSig rows for the five new dispatches in lower_call.rs (head/last/first already there). - declare_function decls for the four new symbols (tail already declared). - test-files/test_lodash_sum.ts matches node --experimental-strip-types byte-for-byte: 10 / 2.5 / 3 / 1 / 3. sumBy/meanBy currently accept the property-shorthand iteratee form only; function iteratees return NaN until closure-call plumbing across the FFI boundary lands as a follow-up.
3b195d0 to
3e74e55
Compare
4 tasks
proggeramlug
added a commit
that referenced
this pull request
May 18, 2026
#982) - New runtime exports js_lodash_max/_min/_max_by/_min_by in perry-stdlib (clamp/in_range/random already existed). - Manifest rows for all seven (max/min/maxBy/minBy/clamp/inRange/random). - NativeModSig rows for the six new dispatches in lower_call.rs (clamp was already there). - declare_function decls for the four new symbols (clamp/in_range/random already declared). - test-files/test_lodash_max_min.ts matches node --experimental-strip-types byte-for-byte: 5 / 1 / { n: 5 } / { n: 1 } / 5 / 0 / 3 / true / false. maxBy/minBy currently accept the property-shorthand iteratee form only; function iteratees return undefined until closure-call plumbing across the FFI boundary lands as a follow-up (same restriction as sumBy/meanBy from PR #966).
2 tasks
proggeramlug
added a commit
that referenced
this pull request
May 18, 2026
PRs #966, #967, #982, #984 added entries to perry-api-manifest::API_MANIFEST (stream EventEmitter instance methods, stream.prototype, lodash inRange/max/maxBy/mean/meanBy/min/minBy/random/sum/sumBy/tail) without rerunning ./scripts/regen_api_docs.sh. Drift has been blocking the api-docs-drift gate on every subsequent PR; unblocking the next batch. Coverage moves from 870 → 898 entries across 71 modules. Mechanical regen, no manifest edits.
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
sum,mean,sumBy,meanBy,tail) to the manifest +NativeModSigtable + runtime decls soimport _ from 'lodash'; _.sum([...])(and the other four) compile natively instead of erroring with\lodash.sum` is not implemented in Perry.head/last` were already wired; this batch closes the most common "easy" aggregator gap surfaced by the manifest sweep.crates/perry-stdlib/src/lodash.rs:js_lodash_sum,js_lodash_mean,js_lodash_sum_by,js_lodash_mean_by(plus a smalllodash_to_numberhelper that mirrors lodash'sbaseSumundefined-skipping).tailreuses the existingjs_lodash_tailruntime — only the manifest + lower_call rows were missing for it.sumBy/meanByaccept the property-shorthand iteratee form only today (_.sumBy(arr, 'n')); function iteratees returnNaNto mirror lodash's "unusable iteratee" branch. Closure-call plumbing across the FFI boundary is its own follow-up.Test plan
test-files/test_lodash_sum.tsmatchesnode --experimental-strip-typesbyte-for-byte:10 / 2.5 / 3 / 1 / 3._.sum([1,2,3,4,5])→15) verified locally.cargo build --release -p perry-runtime -p perry-stdlib -p perrygreen.lint,cargo-test,parity,compile-smoke,api-docs-drift,security-audit.Notes
compilePackages: ["lodash"]path is still blocked on a separate module-initTypeError: Cannot read properties of undefined (reading 'prototype')regression that pre-dates this work — reproducible with just_.head([1,2,3])after enablingcompilePackages, so not in scope here. Tested via the standard manifest-route (nocompilePackagesconfig).v0.5.979; CHANGELOG entry has the full per-file breakdown.