Html2canvas: Project is not actively developed ?

Created on 17 Jul 2017  ·  15Comments  ·  Source: niklasvh/html2canvas

I see that the last commit was in Jan/2016, the Pull requests and issues are piling up. The author does not seems to be active on github or twitter...

I was wondering if there is an active fork of this project ? I see @eKoopmans is main person who is answering or submitting PRs https://github.com/eKoopmans/html2canvas ?

It's an amazing project but as with everything in web dev it's crazy pace and browsers add all these new features.

Most helpful comment

Hey @aparij, you are correct that I haven't really had any time for this project in the recent year or so. I am hoping to change that in the near future, but moving on forward, would hope to have the community take a more active part in keeping the project up to date, which obviously requires more involvement from me as well.

Currently, I am working on a partial rewrite (again) of the project, with a few major changes in how the project handles different aspects of the process of rendering a document into an image with the primary goals being:

  • Make it as modular as possible, enabling more parts to be threaded if necessary, ran either on the browser or serialized and run on a server
  • Making adding new CSS features easier through modularity
  • Make the project fully typed (using Flow)
  • Performance improvements through improved text rendering, threading, limiting parsing to minimum necessary amounts
  • Resolve the mobile rendering issues such as low quality images due to device pixel ratio, or black images due to canvas size exceeding hardware limits etc.
  • Create clear specifications for image proxies (for CORS), plugins that render content that html2canvas will not currently support (such as SVG)
  • Rework the website to be up-to date with clear documentations

All 15 comments

Hey @aparij, you are correct that I haven't really had any time for this project in the recent year or so. I am hoping to change that in the near future, but moving on forward, would hope to have the community take a more active part in keeping the project up to date, which obviously requires more involvement from me as well.

Currently, I am working on a partial rewrite (again) of the project, with a few major changes in how the project handles different aspects of the process of rendering a document into an image with the primary goals being:

  • Make it as modular as possible, enabling more parts to be threaded if necessary, ran either on the browser or serialized and run on a server
  • Making adding new CSS features easier through modularity
  • Make the project fully typed (using Flow)
  • Performance improvements through improved text rendering, threading, limiting parsing to minimum necessary amounts
  • Resolve the mobile rendering issues such as low quality images due to device pixel ratio, or black images due to canvas size exceeding hardware limits etc.
  • Create clear specifications for image proxies (for CORS), plugins that render content that html2canvas will not currently support (such as SVG)
  • Rework the website to be up-to date with clear documentations

Thanks for posting the update @niklasvh! I'd be happy to help out as you go forward, though I don't have loads of free time lately, had a bit of a career change. I've definitely appreciated the package and am happy to hear you have more plans for it.

I'm also wondering if you've considered going the SVG-rendering option, i.e. here? I know it would be a big change from the existing implementation, but it seems to me it would avoid a lot of the headache of implementing styles individually, leveraging the browser instead. Do you know any down-sides to that sort of approach?

That's great @eKoopmans! I've seen that you've submitted a number of PRs, hopefully will have at least most of them integrated for the next version.

In regards to the foreignObject rendering, it has been around for a long time, and some previous versions of html2canvas leveraged it (https://github.com/niklasvh/html2canvas/blob/0.4.1/src/Support.js#L3 https://github.com/niklasvh/html2canvas/blob/0.4.1/src/Util.js#L18 ) for some of the browsers that supported it. The unfortunate thing is that I believe Firefox is really still the only browser that supports rendering content (including images) without tainting the canvas, which effectively makes it really only viable for use with Firefox. Chrome has made improvements, (I haven't followed up very closely what they do support), but as I've understood they still don't support subresources (i.e. images), which makes it effectively unusable for rendering the whole page.

However, it could be explored if it could be utilized for some smaller portions such as text rendering, and whether it would be a more efficient approach than what html2canvas is currently doing (which is measuring text ranges).

And then there is the cross browser thing, afaik IE/Safari has no support for any rendering of foreignObject content without immediately tainting the canvas.

@niklasvh great to hear that 👍 , when will the next version come out?

You could potentially use the Project tab here to outline your feature set and release plan. That would make it a little easier for people to see the roadmap and actively work together as a community to help you inspect, improve, and maintain the project.

Obviously just a suggestion. While I'm soapboxing, there are just a couple of things I'd suggest doing as soon as you can @niklasvh:

  1. Prune open issues. Are there really 659 open issues? That's a lot. Let's start by closing anything that hasn't been updated since this year. I think that is around Page 5 of 27. Then look for duplicates. Pick a main issue to work from. Right now it's hard to see past the overgrowth.

  2. Going to suggest pruning the pull requests too. Either give a reason for why it has not been accepted, or flat out deny it and move on. I'd even suggest the same timeline - if it's older than this year you can just close it. If it's a real concern we can come back and address it.

  3. After that I think you could focus your time and energy into writing a contribution guide on how you would like to see things organized in this project, tools used, short introduction for those of us green to contributing to OSS goes a long way.

  4. Anyone who's submitted multiple PRs like @eKoopmans is gold to your OSS community. Please add official collaborators to help you with some of this stuff (especially pruning).

@luck2011 I can't really give an accurate timeline, but will hopefully have a working, testable branch up soon.

@markadrake Thanks for the suggestions!
I will definitely look through most of the recent open issues and see whether they should/could be addressed and then either update/close them as well as go through each pull request to see whether they would make sense to be pulled in for the next release.

From there onwards, as you suggested, I will work on making contributing easier for both me and collaborators so that hopefully things don't start stacking up like this again.

I've started marking some of the issues and bringing potential items to the backlog

👍 Nice one @niklasvh

I've pushed the current progress to https://github.com/niklasvh/html2canvas/tree/v1.0.0

There is still some more work to be done before it is up to par with the current version.

@eKoopmans I've re-introduced support for foreignObject rendering for browsers that support it https://github.com/niklasvh/html2canvas/commit/a73dbf8067c92e4f25f4db71f75643f0647cb1ac

By default it will use foreignObject rendering if possible (unless overriden by options), and fallback to normal html2canvas rendering if the browser doesn't support it.

Excellent, I think that's great news! I'll have to give it a spin soon. You've done so much work on the project, thank you!

@niklasvh,Excellent Project and It's been Active again!!
As we know,video is a basic tag,So could this fix be accept:FIX #182 added support for video tag #981.(by @anand-io)
thanks again for your great library!

Hi @niklasvh, what's the status on version 1.0.0? Is the v1.0.0 branch still the one we can use to test the current progress?

Thx for all your hard work!

@jyguyomarch The v1.0.0 has moved to master, which has the latest version of the 1.0.0 codebase. The status of it is that it's still missing svg rendering for browsers that do not support it natively and a revamp of the whole documentation. After that, hopefully can get first release out and start chipping away at all the other issues / PRs that are pending.

Gonna close this as we move closer to a 1.0.0 release.

Was this page helpful?
0 / 5 - 0 ratings