Skip to content
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

[new] add pdf.js@1.3.22 with npm auto-update #5993

Closed
wants to merge 1 commit into from
Closed

Conversation

Amomo
Copy link
Contributor

@Amomo Amomo commented Oct 21, 2015

Hi @maruilian11

For #5020, I add pdf.js at v1.1.539 and add npm auto-update config in its package.json.
repo: https://github.com/mozilla/pdf.js
They put build files in another repo pdfjs-dist

I think we could add the whole repo because it is a distribution repository.
That's why I use "**/*.+(js|css|svg|gif|png)" in auto-update config.

Would you mind checking this PR for me? Thank you~ :-D

  • Not found on cdnjs repo
  • No already exist issue and PR
  • Notable popularity : Watch 654, Star 12,729, Fork 2,964
  • Project has public repository on famous online hosting platform (or been hosted on npm)
  • Has valid tags for each versions (for git auto-update)
  • Auto-update setup
  • Auto-update target/source is valid.
  • Auto-update filemap is correct.

@maruilian11
Copy link
Contributor

@Amomo why not use git auto-update?

@Amomo
Copy link
Contributor Author

Amomo commented Oct 22, 2015

We could get this library from its distribute GitHub repo and also npm.
I found npm has the latest version, so I choose to add npm auto-update config. :-)

@maruilian11
Copy link
Contributor

@Amomo thank you, could you rebase the PR?

@Amomo Amomo force-pushed the pdf.js branch 2 times, most recently from 17e3c31 to 80bb379 Compare November 2, 2015 18:12
@Amomo Amomo changed the title [new] add pdf.js@1.1.539 with npm auto-update [new] add pdf.js@1.2.61 with npm auto-update Nov 2, 2015
@Amomo
Copy link
Contributor Author

Amomo commented Nov 2, 2015

@maruilian11 I have updated my PR, pdf.js has v1.2.61 now.
Could you please check again? Thank you! :-D

@maruilian11
Copy link
Contributor

@Amomo i think this pr is ok, could you rebase it to the master? thank you~

@Amomo
Copy link
Contributor Author

Amomo commented Nov 5, 2015

@maruilian11 I have rebase this PR, could you check again? Thank you! :-D

@maruilian11
Copy link
Contributor

@PeterDaveHello i think this PR is ok.

@PeterDaveHello
Copy link
Contributor

Do we really need the build folder? There is a web folder, I guess it's enough for cdn from its name.
cc @cdnjs/team-cdnjs @cdnjs/intern

@razorman8669
Copy link

Hi @Amomo, According to the code in pdf.js, it loads the worker.js file like this:

var pdfJsSrc = document.currentScript.src;
return pdfJsSrc && pdfJsSrc.replace(/\.js$/i, '.worker.js');

which means that if the minified pdf.js file is named pdf.min.js then the corresponding worker should be named pdf.min.worker.js and not pdf.worker.min.js like you have it

@Amomo
Copy link
Contributor Author

Amomo commented Nov 23, 2015

@razorman8669 this advice is very important! Thank you very much! :-D

@maruilian11 As @razorman8669 said, I add pdf.min.worker.js(end with ".worker.js") as the file which would be used by pdf.min.js. Could you please help me review this PR? Thank you!

@Amomo Amomo changed the title [new] add pdf.js@1.2.61 with npm auto-update [new] add pdf.js@1.3.22 with npm auto-update Nov 23, 2015
@maruilian11
Copy link
Contributor

@Amomo as Peter said, maybe the files under web are enough, could you check this with author?

@Amomo
Copy link
Contributor Author

Amomo commented Nov 23, 2015

Hi @yurydelendik
Would you please give us some advice if we wanna host this lib on the cdn?
Is it enough to host only web/ folder? or we should host both build/ and web/?
Thank you very much! :-)

@yurydelendik
Copy link

Would you please give us some advice if we wanna host this lib on the cdn?

There is an issue that did not let us to do it in first place: web workers cannot be loaded from the remote location. So people are using PDFJS.disableWorker=true to workaround the issue, however this just makes PDF.js performance really bad, locks UI and throws slow script warning.

See also mozilla/pdf.js#5490. After mozilla/pdf.js#6571 lands, I will try to create a "proxy" page that will host cdn worker as well.

Is it enough to host only web/ folder? or we should host both build/ and web/?

both, the web/ folder contains viewer parts, but PDF.js core library is located at build/

@PeterDaveHello
Copy link
Contributor

@yurydelendik Thank you. cc @cdnjs/team-cdnjs

@yurydelendik
Copy link

@yurydelendik
Copy link

Is it possible to update pdf.js to use its newer version in the PR?

@PeterDaveHello
Copy link
Contributor

Is it possible to update pdf.js to use its newer version in the PR?

Yes, of course, maybe we can add them both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants