You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by George Ludwig <ge...@gmail.com> on 2013/07/23 20:59:16 UTC

Best practice for managing JS dependencies in a component project?

I'm working on a component project that integrates a JS library with
Tapestry. The library has a couple of external dependencies: jQuery,
Raphael, as well as it's own CSS file.

My question is, what is the best way to handle these dependencies? Do I
just put the .js and .css in an asset directory (that's what I'm doing
right now)? It makes me wonder what kind of problems I might run in to
later on, when the component is used in a project that includes, for
example, a conflicting version of jQuery.

Should I just not worry, or is there a different way to handle it?

-George

Re: Best practice for managing JS dependencies in a component project?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 23 Jul 2013 19:00:52 -0300, George Ludwig <ge...@gmail.com>  
wrote:

> "And be the first to write an open-source component library on the top of
> Raphael. "
>
> I might just do that, I'm getting good at wrapping JS librairies :)

Nice! :) Don't forget the post the URL when it's done. ;)

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Best practice for managing JS dependencies in a component project?

Posted by George Ludwig <ge...@gmail.com>.
"And be the first to write an open-source component library on the top of
Raphael. "

I might just do that, I'm getting good at wrapping JS librairies :)


On Tue, Jul 23, 2013 at 2:10 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 23 Jul 2013 18:01:17 -0300, George Ludwig <ge...@gmail.com>
> wrote:
>
>  The jQuery stuff turns out to be fine, I just include the tap5-jquery
>> project and that seems to fix that. But since no one has ported
>> Raphael.js to Tapestry,
>>
>
> There's no such thing as porting JavaScript code to Tapestry. tap5-jquery
> goes way beyond just including jQuery in your page. It [1] rewrites the
> Tapestry components, which are written in Prototype, in jQuery, and [2]
> also provides some other interesting stuff like components and mixins built
> on the top of jQuery stuff. Of course, for Tapestry 5.4, [1] will not be
> needed anymore, but [2] will continue as interesting and useful as it's for
> T5.3.
>
>
>  I put that in my assert folder. But it makes me pause to think about how
>> to better handle these things.
>>
>
> Put it in the classpath instead, as it's a component library what you're
> saying you're doing.
> And be the first to write an open-source component library on the top of
> Raphael. This way, probably everyone who needs Raphael in a Tapestry
> application will your library. ;)
>
>
>  I suppose it's not worth worrying about until someone includes Raphael as
>> part of another project, and it causes problems...
>>
>
> For this specific concern, wait for it to happen first, as I think it
> would be very improbable of you using two different component libraries
> using a niche JS library as Raphael.
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Best practice for managing JS dependencies in a component project?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 23 Jul 2013 18:01:17 -0300, George Ludwig <ge...@gmail.com>  
wrote:

> The jQuery stuff turns out to be fine, I just include the tap5-jquery
> project and that seems to fix that. But since no one has ported  
> Raphael.js to Tapestry,

There's no such thing as porting JavaScript code to Tapestry. tap5-jquery  
goes way beyond just including jQuery in your page. It [1] rewrites the  
Tapestry components, which are written in Prototype, in jQuery, and [2]  
also provides some other interesting stuff like components and mixins  
built on the top of jQuery stuff. Of course, for Tapestry 5.4, [1] will  
not be needed anymore, but [2] will continue as interesting and useful as  
it's for T5.3.

> I put that in my assert folder. But it makes me pause to think about how  
> to better handle these things.

Put it in the classpath instead, as it's a component library what you're  
saying you're doing.
And be the first to write an open-source component library on the top of  
Raphael. This way, probably everyone who needs Raphael in a Tapestry  
application will your library. ;)

> I suppose it's not worth worrying about until someone includes Raphael as
> part of another project, and it causes problems...

For this specific concern, wait for it to happen first, as I think it  
would be very improbable of you using two different component libraries  
using a niche JS library as Raphael.

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Best practice for managing JS dependencies in a component project?

Posted by George Ludwig <ge...@gmail.com>.
The jQuery stuff turns out to be fine, I just include the tap5-jquery
project and that seems to fix that. But since no one has ported Raphael.js
to Tapestry, I put that in my assert folder. But it makes me pause to think
about how to better handle these things.

I suppose it's not worth worrying about until someone includes Raphael as
part of another project, and it causes problems...

Thanks!

-George



On Tue, Jul 23, 2013 at 1:54 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Tue, 23 Jul 2013 17:36:09 -0300, George Ludwig <ge...@gmail.com>
> wrote:
>
>  I'm on 5.3...is 5.4 stable enough to use?
>>
>
> It's still an alpha, so I don't think it's ready for production for very
> serious stuff yet. Of course, if you have a process which includes lots of
> testing, automated and non-automated, the risks of using 5.4 would be
> significantly lower.
>
> Anyway, the problem you're describing is way more of a pure JavaScript one
> than a Tapestry one, as it's about how different JS stuff would deal with
> each other, so I think you're asking in the wrong place.
>
> AFAIK, stuff that uses jQuery don't usually need an specific version of
> it, specially if it jQuery one isn't too old, so I don't think you should
> worry about this until you find some actual problem (which I think it's way
> unlikely).
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Best practice for managing JS dependencies in a component project?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 23 Jul 2013 17:36:09 -0300, George Ludwig <ge...@gmail.com>  
wrote:

> I'm on 5.3...is 5.4 stable enough to use?

It's still an alpha, so I don't think it's ready for production for very  
serious stuff yet. Of course, if you have a process which includes lots of  
testing, automated and non-automated, the risks of using 5.4 would be  
significantly lower.

Anyway, the problem you're describing is way more of a pure JavaScript one  
than a Tapestry one, as it's about how different JS stuff would deal with  
each other, so I think you're asking in the wrong place.

AFAIK, stuff that uses jQuery don't usually need an specific version of  
it, specially if it jQuery one isn't too old, so I don't think you should  
worry about this until you find some actual problem (which I think it's  
way unlikely).

-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Best practice for managing JS dependencies in a component project?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 23 Jul 2013 17:36:09 -0300, George Ludwig <ge...@gmail.com>  
wrote:

> I'm on 5.3...is 5.4 stable enough to use?

I forgot to mention: in 5.4, JavaScript dependencies are handled by  
RequireJS.

For 5.3, I guess the best solution would be to use tapestry5-jquery in  
your projects, probably as a dependency in your component project, so it  
takes care of jQuery the inclusion.

>
>
> On Tue, Jul 23, 2013 at 12:48 PM, Thiago H de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
>> What Tapestry version? The answer will be different for 5.3 or 5.4.
>>
>>
>> On Tue, 23 Jul 2013 15:59:16 -0300, George Ludwig  
>> <ge...@gmail.com>
>> wrote:
>>
>>  I'm working on a component project that integrates a JS library with
>>> Tapestry. The library has a couple of external dependencies: jQuery,
>>> Raphael, as well as it's own CSS file.
>>>
>>> My question is, what is the best way to handle these dependencies? Do I
>>> just put the .js and .css in an asset directory (that's what I'm doing
>>> right now)? It makes me wonder what kind of problems I might run in to
>>> later on, when the component is used in a project that includes, for
>>> example, a conflicting version of jQuery.
>>>
>>> Should I just not worry, or is there a different way to handle it?
>>>
>>> -George
>>>
>>
>>
>> --
>> Thiago H. de Paula Figueiredo
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail:  
>> users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>


-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Best practice for managing JS dependencies in a component project?

Posted by George Ludwig <ge...@gmail.com>.
I'm on 5.3...is 5.4 stable enough to use?


On Tue, Jul 23, 2013 at 12:48 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> What Tapestry version? The answer will be different for 5.3 or 5.4.
>
>
> On Tue, 23 Jul 2013 15:59:16 -0300, George Ludwig <ge...@gmail.com>
> wrote:
>
>  I'm working on a component project that integrates a JS library with
>> Tapestry. The library has a couple of external dependencies: jQuery,
>> Raphael, as well as it's own CSS file.
>>
>> My question is, what is the best way to handle these dependencies? Do I
>> just put the .js and .css in an asset directory (that's what I'm doing
>> right now)? It makes me wonder what kind of problems I might run in to
>> later on, when the component is used in a project that includes, for
>> example, a conflicting version of jQuery.
>>
>> Should I just not worry, or is there a different way to handle it?
>>
>> -George
>>
>
>
> --
> Thiago H. de Paula Figueiredo
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.**apache.org<us...@tapestry.apache.org>
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Best practice for managing JS dependencies in a component project?

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
What Tapestry version? The answer will be different for 5.3 or 5.4.

On Tue, 23 Jul 2013 15:59:16 -0300, George Ludwig <ge...@gmail.com>  
wrote:

> I'm working on a component project that integrates a JS library with
> Tapestry. The library has a couple of external dependencies: jQuery,
> Raphael, as well as it's own CSS file.
>
> My question is, what is the best way to handle these dependencies? Do I
> just put the .js and .css in an asset directory (that's what I'm doing
> right now)? It makes me wonder what kind of problems I might run in to
> later on, when the component is used in a project that includes, for
> example, a conflicting version of jQuery.
>
> Should I just not worry, or is there a different way to handle it?
>
> -George


-- 
Thiago H. de Paula Figueiredo

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org