-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[Table/Core] Move some table utils into core #1604
Conversation
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.
Seems simple enough? I'm not sure on the typings questions, though, I'd need to be playing with it locally myself I think to be able to grok what you're talking about, sorry.
Fix buildPreview: documentation | table |
@llorca feel free to toss this into this week's release |
packages/table/src/common/utils.ts
Outdated
* Returns true if the arrays are equal. Elements will be shallowly compared | ||
* by default, or they will be compared using the custom `compare` function | ||
* if one is provided. | ||
* @deprecated since 1.26.0; import this function from core Utils instead. |
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.
@llorca if this PR makes it into this week's release, I believe this table version would be correct, right?
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.
Correct! Can we explicitly say @deprecated since @blueprintjs/table 1.26.0
(not sure if we have a pattern for that) to avoid confusion with the generic/core version?
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.
how about compareUtils.ts
for all these new functions? there's a lot of code there and utils.ts becomes unmaintainably long.
@giladgray why not a |
@llorca we should definitely make a |
@giladgray yes please |
@giladgray @llorca though in making
|
Move code into utils/compareUtils.tsPreview: documentation | table |
* Returns true if the arrays are equal. Elements will be shallowly compared | ||
* by default, or they will be compared using the custom `compare` function | ||
* if one is provided. | ||
* @deprecated since @blueprintjs/table 1.26.0; import this function from |
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.
Should now change to 1.27.0
since we didn't make last week's release
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.
Looks good.
I would have thought export { IKeysWhiteList } from "..."
would have worked.
@themadcreator fortunately it's easy to play with that without affecting the API now. maybe i'll figure something out after merging. |
Fixes #1601
Changes proposed in this pull request:
packages/table
utils now live inpackages/core
:arraysEqual
deepCompareKeys
getDeepUnequalKeyValues
getShallowUnequalKeyValues
shallowCompareKeys
This change is necessary to unblock PR #1492.
Reviewers should focus on:
packages/table
.BlueprintUtils
toCoreUtils
throughoutpackages/table
. Now everything is consistent.packages/table/src/common/utils
so as to not break the public API; the table utils are exported after all. All those facades include function descriptions identical to the ones inpackages/core/src/common/utils
, except they include@deprecated
warnings.IKeysWhitelist
anIKeysBlacklist
fromcore
, and re-export them fromtable
? Tried and failed to do that syntactically, so I just redefined the interfaces intable
.{ utilName: CoreUtils.utilName }
pattern ifCoreUtils.utilName
is generically typed? Couldn't get that to work either, so I spelled out the functions more verbosely.