-
Notifications
You must be signed in to change notification settings - Fork 69
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
[UUICore]: cleaned up packages and helpers from uui-core. #2117
Conversation
Generated by: track-bundle-size
new sizes (raw)To set the sizes as a new baseline, you can copy/paste next content to the {
"version": "5.7.1",
"timestamp": "2024-04-10",
"sizes": {
"templateApp": {
"css": 280548,
"js": 730971
},
"@epam/app": {
"css": 1587795,
"js": 4934202
},
"@epam/draft-rte": {
"css": 9762,
"js": 45308
},
"@epam/electric": {
"css": 2289,
"js": 2299
},
"@epam/promo": {
"css": 40368,
"js": 16101
},
"@epam/uui-extra": {
"css": 0,
"js": 213
},
"@epam/loveship": {
"css": 49451,
"js": 54148
},
"@epam/uui-components": {
"css": 22214,
"js": 238657
},
"@epam/uui-core": {
"css": 0,
"js": 326683
},
"@epam/uui-db": {
"css": 0,
"js": 45754
},
"@epam/uui-docs": {
"css": 3189,
"js": 201400
},
"@epam/uui-editor": {
"css": 12625,
"js": 164792
},
"@epam/uui-timeline": {
"css": 2251,
"js": 46047
},
"@epam/uui": {
"css": 268310,
"js": 332113
}
}
} Generated by: generate-components-api Total amount of exported types/props without JSDoc comments
|
uui-core/src/helpers/range.ts
Outdated
} | ||
|
||
export const range = (start: number, end?: number, step: number = 1) => | ||
Array.from(rangeGen(start, end, step)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need to support cases except when start < end, and step = 1? We are not forced to have an lodash-compatible drop-in replacement. We need only to cover our cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We have various places, where we are using range for reverse sequence and with one argument. Here are couple of them:
UUI/uui-db/src/__benchmarks__/testData.ts
Line 11 in 45d82e5
export const test100KPersons = range(101000, 999, -1).map((id) => ({ id, name: `Person ${id}`, departmentId: Math.floor(Math.random() * 10) })); |
const testItems = range(200).map((id) => { |
uui-core/src/helpers/orderBy.ts
Outdated
}); | ||
} | ||
|
||
const comparer = getOrderComparer([{ field: by, direction: order }]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use a simple string comparator if by
is a function. However, we use Intl-based comparator (implied by use of getOrderComparer) - if we pass a field name as a string.
Why do we need an overloads here? Probably we can accept a function only, and rewrite any orderBy(arr, 'name')
to orderBy(arr, i => i.name)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getOrderComparer uses the same compareScalars
function.
function compareScalars(a, b, order) { |
So, we are just using shorthand, without changing the logic and I guess, its pretty useful, if we've decided to use our own implementation of orderBy/sortBy.
…e chars in more general way (was only for '0'-s)
Summary
[uui-core]: helpers cleanup
LazyLoadedMap
and related:LazyLoadedMapLoadCallback
UNKNOWN
LOADING
LOADED
PENDING
FAILED
LoadingStatus
browser
helper:Browser
getBrowser
Debouncer
parseIconViewbox
parseStringToCSSProperties
getScreenSize
urlParser
batch
and related:batch
BatchPromiseOptions
Removed unused packages.