Why PhantomJS doesn't have Function.prototype.bind

6,903 views
Skip to first unread message

Ariya Hidayat

unread,
Apr 11, 2013, 12:22:08 AM4/11/13
to phan...@googlegroups.com
Folks,

I'm tired of explaining this over and over again, in particular
because people don't bother checking the archive and/or past history.
Seems that shouting on (insert-your-favorite-social-media) is the new
trend, normal discussion on the mailing-list becomes very old
fashioned.

PhantomJS uses Qt and its QtWebKit module. QtWebKit implements WebKit
[1,2] via its Qt stacks, from graphics to network. QtWebKit was chosen
as the base for PhantomJS when I started this code ages ago [3]. It
was the best choice back then, though we are ready to move to a
different base in the future if necessary [4].

At some point PhantomJS progressed faster than Qt. Qt 4.6 to 4.7 was 9
months to prepare, and yet Qt 4.7 to 4.8 took 15 months. This and
combined with other reasons led to a decision to include a
minimalistic Qt 4.8 source in our tree [5]. Because we can't wait for
Qt 4.9, we even improved our own QtWebKit copy, from adding stack
trace to various crash fixes. Most notably of course pure headless (no
X11) on Linux [6] in PhantomJS 1.5, spring 2012 [7].

Meanwhile, Qt 4.9 never came to see the day. Nokia focused solely on
Qt 5, originally scheduled for mid 2012 [8], and that Qt development
team even later moved to Digia [9]. We are stuck with QtWebKit in Qt
4.8 (released winter 2011). That version is roughly equivalent to
something between Safari 5 and Safari 6, hence that's why it explains
the lack of Function.prototype.bind.

Fast forward to early 2013. I did an attempt to upgrade our QtWebKit
module to no avail [10]. Since Qt 5 starts to become more stable
anyway, we just decided to port to Qt 5 and get its fresher QtWebKit
[11].

Do we ever (intentionally) want to bundle outdated JavaScript
environment? Of course not, we obviously want the best for the users.
Do we ever attempt to solve the problems? A couple of times. However,
like many other things in life, sometimes our effort is not strong
enough to move the mountain.

Just as we discussed the other day (about user expectation, see [12]),
please put things in perspective. Even if what PhantomJS does is only
to consume WebKit and to add spice on top of it, it's still a lot of
work (whereas Google has hundreds of full-time engineers working on
Chrome, WebKit, and now Blink).

To this date, every single PhantomJS contributor is not a fully-paid
engineer working on the project. It is a testament (even before
crowd-funding becomes popular) that voluntary activity often can beat
corporate-sponsored agenda. Please don't let the negativity ruin the
spirit!

<3


[1] http://ariya.ofilabs.com/2011/06/your-webkit-port-is-special-just-like-every-other-port.html
[2] http://paulirish.com/2013/webkit-for-developers/
[3] http://ariya.ofilabs.com/2011/01/phantomjs-minimalistic-headless-webkit-based-javascript-driven-tool.html
[4] https://github.com/ariya/phantomjs/issues/10209
[5] http://ariya.ofilabs.com/2012/03/the-evolution-of-phantomjs-build-workflow.html
[6] http://ariya.ofilabs.com/2012/03/pure-headless-phantomjs-no-x11-or-xvfb.html
[7] http://phantomjs.org/release-1.5.html
[8] http://qt-project.org/wiki/Qt_5.0/revision/11067
[9] http://www.digia.com/en/Home/Company/Press/2012/Digia-to-acquire-Qt-from-Nokia/
[10] https://groups.google.com/d/msg/phantomjs/2Zb1Ryc5y8E/xOkWYRWj38AJ
[11] https://groups.google.com/d/msg/phantomjs/z_147Zj1l58/8tEbijy1BkEJ
[12] https://groups.google.com/d/msg/phantomjs/1BYeMxbUWHw/vqX5j-w_7OgJ


--
Ariya Hidayat, http://ariya.ofilabs.com
http://twitter.com/ariyahidayat
http://gplus.to/ariyahidayat

Adam Robertson

unread,
Apr 9, 2014, 2:46:53 PM4/9/14
to phan...@googlegroups.com
I totally understand your reasoning, and I really appreciate your efforts on this awesome tool.  

However, even this post saying you were trying to upgrade is dated exactly a year ago, with no apparent progress.  I really love using PhantomJS, but I find myself trying to circumvent bind simply to satisfy my testing environment's needs, which is totally backward.  I don't think I have a single project that doesn't use bind--you gotta admit, it's pretty indispensable for some tasks.  

I no longer want to stop using it because of PhantomJS' lack of support, or sacrifice the integrity of my projects by attempting to use a polyfill.  So can you tell me at this point, if/when we can expect bind support to be included?  

Thanks,

Adam

Darren Cook

unread,
Apr 9, 2014, 7:27:43 PM4/9/14
to phan...@googlegroups.com
> However, even this post saying you were trying to upgrade is dated exactly
> a year ago, with no apparent progress.

There have been quite a few posts on this subject in the year since
then; even a read of the last two week's mailing list archives would
have found discussion and links.

The developers have this information, so far, on the new version:
https://github.com/ariya/phantomjs/wiki/PhantomJS-2

There are some pre-built binaries for Linux (at least), but the links
don't appear to be in the wiki; a hunt through the past 2-3 weeks of
mailing list archives will find them.

Failing that, just carry on using SlimerJS, and wait another month or so
for the new version of PhantomJS to be released :-)

Darren

Message has been deleted

oddi...@gmail.com

unread,
Apr 9, 2014, 9:34:11 PM4/9/14
to phan...@googlegroups.com
This link includes Mac, and Linux 32 and 64 pre-built PhantomJS 2.0 binaries


 I built the mac and 32bit Linux ones and someone named 'Andrew Hamilton' from the other thread built the 64bit Linux version. I assure you the ones I built are clean, and I also included build instructions for any that want to compile themselves.
 I'm still trying to build the Windows version but am having trouble.

oddi...@gmail.com

unread,
Apr 9, 2014, 9:54:12 PM4/9/14
to phan...@googlegroups.com
All credit to Sergio and his company KDAB of course, and Vitaliy, for actually making Phantomjs 2.0 happen and for providing most of the build instructions, I felt I needed to say this so it doesn't across like I did anything but type a few compile commands.

Kjell E

unread,
Dec 18, 2014, 8:27:28 AM12/18/14
to phan...@googlegroups.com
If anyone still has trouble obtaining a windows (x86) binary of the phantomjs-master branch, I've built a version from the master branch yesterday, including a step-by-step instruction on how to build on windows using the vs2012 toolchain, see: https://github.com/kjelloe/phantomjs/

- Kjell
Reply all
Reply to author
Forward
0 new messages