-
Notifications
You must be signed in to change notification settings - Fork 10.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
Simplify annotation data passing #6232
Simplify annotation data passing #6232
Conversation
eebb555
to
981202f
Compare
} | ||
return annotationsData; | ||
}, | ||
|
||
get annotations() { | ||
var annotations = []; | ||
var annotationRefs = (this.annotationRefs || []); | ||
var annotationRefs = (this.getInheritedPageProp('Annots') || []); |
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.
While you're at it, remove the parentheses. They are not required, and do not enhance the readability of this line.
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.
Done in the new commit.
981202f
to
995c5ba
Compare
/botio-linux preview |
From: Bot.io (Linux)ReceivedCommand cmd_preview from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/d3613037ba95209/output.txt |
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/d3613037ba95209/output.txt Total script time: 0.62 mins Published |
/botio test |
From: Bot.io (Linux)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.21.233.14:8877/88b6a79c47252a7/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @timvandermeij received. Current queue size: 0 Live output at: http://107.22.172.223:8877/3f8eb82a935f957/output.txt |
From: Bot.io (Windows)SuccessFull output at http://107.22.172.223:8877/3f8eb82a935f957/output.txt Total script time: 18.28 mins
|
From: Bot.io (Linux)SuccessFull output at http://107.21.233.14:8877/88b6a79c47252a7/output.txt Total script time: 18.76 mins
|
Simplify annotation data passing
Looks good, thanks! |
We can avoid the
getData
method call by just accessing thedata
property on the annotation object. We can avoidget annotationRefs
by directly using its result (like all other methods in that file). Finally,getAnnotations
inapi.js
can be simplified by interchanging the cases, i.e., always returing the promise and only creating it when it does not exist yet.I have verified with 15 test files with different annotation types (Link, Text, Widget, Markup, et cetera) that rendering has not changed.
@Snuffleupagus Could you review this PR?