-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix!: remove handling of types not present in type signatures #70
Merged
Conversation
This file contains 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
Minhir
approved these changes
Jul 4, 2024
3 tasks
aleclarson
force-pushed
the
main
branch
2 times, most recently
from
July 12, 2024 00:23
2154f96
to
6a4b4f6
Compare
aleclarson
force-pushed
the
breaking/remove-undefined-checks
branch
from
January 26, 2025 03:29
a6d708e
to
85bd936
Compare
Benchmark Results
Performance regressions of 30% or more should be investigated, unless they were anticipated. Smaller regressions may be due to normal variability, as we don't use dedicated CI infrastructure. |
[skip ci]
aleclarson
force-pushed
the
breaking/remove-undefined-checks
branch
from
January 26, 2025 05:29
38dd7b8
to
0e05f8e
Compare
aleclarson
changed the title
refactor!: remove implicit nullish handling
fix!: remove handling of types not present in type signatures
Jan 26, 2025
This PR has been released in
|
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.
Tip
The owner of this PR can publish a preview release by commenting
/publish
in this PR. Afterwards, anyone can try it out by runningpnpm add radashi@pr<PR_NUMBER>
.Summary
This PR removes any implicit handling of null/undefined input values.
Some notes:
replace
andreplaceOrAppend
still skip an undefineditem
argumentif (!array.length)
checks were also removed, preferring brevity over performance for those code paths. I'd be fine with reinstating these checks on a case-by-case basis if benchmarks prove a substantial benefit and the frequency of empty arrays being passed is deemed common.See the linked discussion for the philosophy behind this change.
Related issue, if any:
https://github.com/orgs/radashi-org/discussions/48
For any code change,
Does this PR introduce a breaking change?
Yes
As of now, a codemod will not be provided. Implicit nullish handling was never actually documented, so I assume most Radash users will not be affected.
Bundle impact
src/array/alphabetical.ts
src/array/boil.ts
src/array/counting.ts
src/array/diff.ts
src/array/first.ts
src/array/fork.ts
src/array/intersects.ts
src/array/last.ts
src/array/merge.ts
src/array/replace.ts
src/array/replaceOrAppend.ts
src/array/select.ts
src/array/selectFirst.ts
src/array/sort.ts
src/array/toggle.ts
src/array/unzip.ts
src/array/zipToObject.ts
src/async/map.ts
src/async/reduce.ts
src/number/inRange.ts
src/number/max.ts
src/number/min.ts
src/object/assign.ts
src/object/clone.ts
src/object/construct.ts
src/object/crush.ts
src/object/invert.ts
src/object/keys.ts
src/object/listify.ts
src/object/mapEntries.ts
src/object/omit.ts
src/object/pick.ts
src/object/set.ts
src/object/shake.ts
src/string/camel.ts
src/string/capitalize.ts
src/string/dash.ts
src/string/pascal.ts
src/string/snake.ts
src/string/title.ts
src/string/trim.ts
Footnotes
Function size includes the
import
dependencies of the function. ↩