-
Notifications
You must be signed in to change notification settings - Fork 116
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
updated rxjs version from 6 to 7, ts to 4.2.4, and some refactor #2535
Conversation
✅ Deploy Preview for taquito-test-dapp ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
New packages have been deployed to the preview repository at https://npm.preview.tezostaquito.io/. Published packages:
|
A new deploy preview is available on Netlify at https://9e5b818--tezostaquito.netlify.app |
@@ -58,7 +59,8 @@ export class BatchOperation | |||
.filter((result) => BATCH_KINDS.indexOf(result.kind) !== -1) | |||
.map((result) => { | |||
if (hasMetadataWithResult(result)) { | |||
return result.metadata.operation_result.status; | |||
const opResult = result.metadata.operation_result as BatchOperationResult; |
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.
is it better to defined opResult as type BatchOperationResult then to cast it?
const opResult: BatchOperationResult = result.metadata.operation_result;
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.
casting is necessary still since opResult is type unknown. TS will also throw an error if you only type it as such. Same comment as the other one
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.
the operation_result type seems lost in hasMetadataWithResult
, will we consider defined it better in the function so we can avoid casting
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.
TS unfortunately doesn't derive the subset of types from hasMetadataWithResult
. It will always return unknown regardless, which is the reason why we needed to cast it
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.
I understand :)
@@ -130,7 +135,7 @@ export class Operation { | |||
return ( | |||
this.results.map((result) => { | |||
if (hasMetadataWithResult(result)) { | |||
return result.metadata.operation_result.status; | |||
return (result.metadata.operation_result as OperationResult).status; |
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.
preference wise, i'd declare type defined variable and return variable.status then casting.
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.
same comment as the one above
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.
🌟 Great work to migration the code base to rxjs 7 and ts 4.2.4.
Besides type casting that I had impression that it compromise type safety, was advised try best to avoid.
Just some minor comments, the rest lgtm 🙌
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.
thanks for updating example!!
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.
lgtm🎉
…dlabs#2535) * updated rxjs version from 6 to 7, ts to 4.2.4, and some necessary refactors * updated unit tests, and refactored necessary packages * updated example * addressed PR comments * debug tests * debug flextesa failure * remove debug statements * trigger build * try previous flextesa version
* fix issues from #1652 * added TZIP link above the column caption * removed the TZIP link at the bottom of the page * updated rxjs version from 6 to 7, ts to 4.2.4, and some refactor (#2535) * updated rxjs version from 6 to 7, ts to 4.2.4, and some necessary refactors * updated unit tests, and refactored necessary packages * updated example * addressed PR comments * debug tests * debug flextesa failure * remove debug statements * trigger build * try previous flextesa version * fix issues from #1652 * changed color back to brown like it was before --------- Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com> Co-authored-by: David <david.kaminski93@gmail.com>
* Fix issue #1652 (#2547) * fix issues from #1652 * added TZIP link above the column caption * removed the TZIP link at the bottom of the page * updated rxjs version from 6 to 7, ts to 4.2.4, and some refactor (#2535) * updated rxjs version from 6 to 7, ts to 4.2.4, and some necessary refactors * updated unit tests, and refactored necessary packages * updated example * addressed PR comments * debug tests * debug flextesa failure * remove debug statements * trigger build * try previous flextesa version * fix issues from #1652 * changed color back to brown like it was before --------- Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com> Co-authored-by: David <david.kaminski93@gmail.com> * docs: extended website adjustment changes to next version * revert: package-lock.json to comply with master * docs: removed broken link in lambda_view and update sapling contract for live code example * docs: updated version 17.1.0 doc changes accordingly --------- Co-authored-by: dvkam <82422481+dvkam@users.noreply.github.com> Co-authored-by: Davis Sawali <davis.sawali@ecadlabs.com> Co-authored-by: David <david.kaminski93@gmail.com>
closes #2261
@taquito/taquito
package (and the parent package) from 4.1.5 to 4.2.4Thank you for your contribution to Taquito.
Before submitting this PR, please make sure:
In this PR, please also make sure:
closes #TICKETNUMBER
in the description box (when applicable)Release Note Draft Snippet
If relevant, please write a summary of your change that will be suitable for
inclusion in the Release Notes for the next Taquito release.