[widgets] review of widget.php

3 views
Skip to first unread message

Bastian Feder

unread,
Aug 25, 2011, 5:25:07 PM8/25/11
to joindin-d...@googlegroups.com
Hi Folks,
Lorna contacted me today with some feedback about the joindin widgets.
It seems that the development on these have gone further a bit.

Nevertheless I tool the liberty to revise the JavaScript generated by
the widget.php. I also took the liberty to implement the 'Attempt to
auto-load jQuery, then relaunch the widget when jQuery is available' todo.
The outcome of my short session can be seen in my github clone of joind.in:

https://github.com/lapistano/joind.in/commit/48687420733e0900fe8a836d350049ac16c2210a


Tell me, if you are interested in a pull request.

hf
Bastian

PS: I used jsLint to check the JavaScript code, but actual never run
the code through a JavaScript interpretor. So it is possible that there
are some errors jsLint did not find.

Jake Smith

unread,
Aug 25, 2011, 5:37:18 PM8/25/11
to joindin-d...@googlegroups.com
Bastian and others,

Please review my amended changes to widget.php.  I removed the dependencies of jQuery all together.  Even though I agree jQuery is quite popular, I also use it on most sites, but I do not believe it should be required when loading a widget from another site.

Any feedback would be appreciated:

lornajane

unread,
Aug 27, 2011, 1:17:39 PM8/27/11
to joindin-developers
Hi People

Absolutely loving the instant improvements on previous features! I'm
afraid javascript is not my strong point so I can't comment on the
versions given here. If nobody feels strongly then I'll merge
whichever pull request I get first and which I can understand how to
test :)

I'm now using these widgets on my (shiny new, resdesigned and no
longer pink!) site - http://www.lornajane.net/resources for examples
if anyone is interested.

Regards

Lorna


On Aug 25, 10:37 pm, Jake Smith <jake.smit...@gmail.com> wrote:
> Bastian and others,
>
> Please review my amended changes to widget.php.  I removed the dependencies
> of jQuery all together.  Even though I agree jQuery is quite popular, I also
> use it on most sites, but I do not believe it should be required when
> loading a widget from another site.
>
> Any feedback would be appreciated:https://github.com/jakefolio/joind.in/blob/widget-js/src/widget/widge...
>
> Jake Smith
> [t] @jakefolio
> [w]www.jakefolio.com
>
> On Thu, Aug 25, 2011 at 4:25 PM, Bastian Feder <bastian.fe...@gmail.com>wrote:
>
>
>
> > Hi Folks,
> > Lorna contacted me today with some feedback about the joindin widgets.
> > It seems that the development on these have gone further a bit.
>
> > Nevertheless I tool the liberty to revise the JavaScript generated by
> > the widget.php. I also took the liberty to implement the 'Attempt to
> > auto-load jQuery, then relaunch the widget when jQuery is available' todo.
> > The outcome of my short session can be seen in my github clone of joind.in
> > :
>
> >https://github.com/lapistano/joind.in/commit/48687420733e0900fe8a836d...

Bastian Feder

unread,
Aug 27, 2011, 1:47:22 PM8/27/11
to joindin-d...@googlegroups.com
Hey Jake,
I took a look at your proposal. It seems to be solid code, but I am not
with you removing jQuery from the widgets.
First of all you are just replacing it by introducing another library
(Reqwest) to handle the ajax request properly. No offence but this is
also done by jQuery.
Furthermore, given there are way more features to be added (see the
ticket for details (http://joindin.jira.com/browse/JOINDIN-88)), I think
it'll also not beneficial to remove jQuery.
For me it sound to much like reinventing the wheel, which I don't like.
Don't get me wrong, I am not a jQuery evengelist, but there are too many
things we'd either copy or problems we have to fight against,
implementing the functionality ourselfs.

I understand your intention not to force people to use whatever library
or framework, but - sorry for the comparison - we are not google to
implement each and everything on our own ;)

My idea of the widgets is that there should be a tiny core just managing
attached modules. Talking via custom events to each other we would be
able to extend, rewrite, or upgrade any module without braking backward
compatibility in general.

just my 5 cents
Bastian


On 08/25/2011 11:37 PM, Jake Smith wrote:
> Bastian and others,
>
> Please review my amended changes to widget.php. I removed the
> dependencies of jQuery all together. Even though I agree jQuery is
> quite popular, I also use it on most sites, but I do not believe it
> should be required when loading a widget from another site.
>
> Any feedback would be appreciated:
> https://github.com/jakefolio/joind.in/blob/widget-js/src/widget/widget.php
>
> Jake Smith
> [t] @jakefolio

> [w] www.jakefolio.com <http://www.jakefolio.com>


>
>
> On Thu, Aug 25, 2011 at 4:25 PM, Bastian Feder <bastia...@gmail.com
> <mailto:bastia...@gmail.com>> wrote:
>
> Hi Folks,
> Lorna contacted me today with some feedback about the joindin widgets.
> It seems that the development on these have gone further a bit.
>
> Nevertheless I tool the liberty to revise the JavaScript generated by
> the widget.php. I also took the liberty to implement the 'Attempt to
> auto-load jQuery, then relaunch the widget when jQuery is available'
> todo.
> The outcome of my short session can be seen in my github clone of

> joind.in <http://joind.in>:

Jake Smith

unread,
Aug 27, 2011, 3:16:46 PM8/27/11
to joindin-d...@googlegroups.com
Bastian,

I reviewed the previous code, and the only things utilizing jQuery were the AJAX call and appending innerHTML.  I for one find using Reqwest, less than 1kb, and using plain javascript more efficient than loading a 31kb (minified) jQuery file.

Is there other examples of why jQuery would be much more useful? If others feel there is a real use case, with examples, of why we should use jQuery....then I will rebase my repo/remove my changes.


Jake Smith
[t] @jakefolio
[w] www.jakefolio.com


Daniel Cousineau

unread,
Aug 27, 2011, 3:38:30 PM8/27/11
to joindin-d...@googlegroups.com
I'm going to have to agree with Jake. Since you're building a widget to be placed on an external site, size and speed are paramount. The 31kb overhead jQuery introduces is too much in the context of a widget.

As well there are other microframeworks to simplify eventing and animations that do not consume as much space.



-- Sent from my Touchpad. Please excuse any typos.

Kevin Bowman

unread,
Aug 31, 2011, 5:01:56 PM8/31/11
to joindin-d...@googlegroups.com
Hi,

jQuery was only really in there as a convenience, and because the particular itch I was scratching already had jQuery on the page (so it was no extra overhead).  I have exactly zero attachment to it; equally, I suspect that a lot of browsers will already have it cached from the Google CDN so it's not the end of the world.

Please treat the code as a springboard from which to create more functionality - mostly, now that the cross-domain API calling is in place (at least in a read-only sense for the moment), the JS side should be easier to make nicer / prettier / more functional / whatever.

Kevin
Reply all
Reply to author
Forward
0 new messages