Skip to content

Converted simpleviewer.js to await/async #14181

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

Merged
merged 1 commit into from
Oct 26, 2021

Conversation

PinRathod
Copy link
Contributor

@PinRathod PinRathod commented Oct 24, 2021

Closes #14128 Converted simpleviewer.js to await/async

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this breaks the example; please make sure that you actually test your patch before opening a pull request.

To test this locally:

  1. Run gulp dist-install.
  2. Run gulp server.
  3. Open http://localhost:8888/examples/components/simpleviewer.html in a browser.

Furthermore, I don't think that this will pass linting either; please remember to always run gulp lint locally and fix the reported errors.
Finally, please don't include unrelated changes in patches (i.e. the package-lock.json file).

@PinRathod
Copy link
Contributor Author

@Snuffleupagus This is my first PR to pdf.js. Please review my PR.
Thank You.

@PinRathod
Copy link
Contributor Author

@Snuffleupagus Thank you for replying. I will check and look into it.

@PinRathod
Copy link
Contributor Author

Capture
@Snuffleupagus When I open http://localhost:8888/examples/components/simpleviewer.html in a browser without any changes it looks like attached image and after changes, it looks the same. So, please give me some info on examples.
Thanks..

@Snuffleupagus
Copy link
Collaborator

When I open http://localhost:8888/examples/components/simpleviewer.html in a browser without any changes it looks like attached image and after changes, it looks the same.

Is there any errors printed in the console?
Most likely, you didn't actually follow the instructions listed in #14181 (review) since the example should definitely work.

@PinRathod
Copy link
Contributor Author

@Snuffleupagus Please check my updated PR. Thank you.

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not be removing the package-lock.json/package.json files from the repo, just from the patch itself.
Also, please follow https://github.com/mozilla/pdf.js/wiki/Squashing-Commits when addressing review comments.

loadingTask.promise.then(function (pdfDocument) {

(async function () {
const pdfDocument = await loadingTask.promise
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a linting failure; please actually run gulp lint and fix all problems it reports.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus I have run gulp lint and fixed the problem it reports. Please review it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make sure that you address all comments, since you've still incorrectly included the package-lock.json and package.json files in this patch!

(And make sure to clean-up the commit message during squashing, since sentences like "Changes requested in PR comments" and "Linting Changes requested in PR comments" are not meaningful there.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus I try but conflicts files don't remove and the other 4 commits are visible in my PR, I don't know about it. Kindly help me. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to use e.g. git rebase -i HEAD~5 and simply remove the commits that don't belong here.
(You may want to look-up a git tutorial, since basic knowledge of git is probably required in order to work efficiently with e.g. this project.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus Please check it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once more, for probably the forth time, the patch is still including files that it shouldn't!
You must remove the package-lock.json and package.json from this patch, otherwise it'll never land.


Please don't ping me again until you've actually fixed all review comments (having to make the same comments over and over is just wasting my time).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus Sorry for the inconvenience due to this PR. I have resolved the conflicts files. please check it.
Thank you.

@PinRathod PinRathod force-pushed the simpleviewer_to_async branch 9 times, most recently from 86e57bd to 9df4c9b Compare October 25, 2021 17:15
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your commit message has unrelated content, which doesn't make sense (i.e. the "This reverts commit c001b17." sentence).

@@ -92,10 +92,12 @@ const loadingTask = pdfjsLib.getDocument({
cMapPacked: CMAP_PACKED,
enableXfa: ENABLE_XFA,
});
loadingTask.promise.then(function (pdfDocument) {

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary new-line, please revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Snuffleupagus Requested changes done. please check it. Thank you.

@PinRathod PinRathod force-pushed the simpleviewer_to_async branch from 8930a95 to 4c463c6 Compare October 26, 2021 17:13
Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me, thanks.

@Snuffleupagus Snuffleupagus merged commit 390ddd9 into mozilla:master Oct 26, 2021
@PinRathod
Copy link
Contributor Author

@Snuffleupagus Thanks for your guidance.

@PinRathod PinRathod deleted the simpleviewer_to_async branch October 27, 2021 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert examples/components/simpleviewer.js to await/async
3 participants