You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Jesse Kuhnert <jk...@gmail.com> on 2006/07/31 22:49:10 UTC

Re: Unique in scripts

I think I generally like the idea.

Could you give an example of how global:line/global:body would be different?


On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
>
> With all those dojo.require that are now included in pages,
> I feel it would be nice to make them appear only once.
>
> The unique tag works in a per component style.
> Hacking it a bit reduces 14-17 lines of requires
> (in the TimeTracker example) to just 6-7
>
> The next step is to add a strategy attribute to unique
> Possible values would be:
> component (the default, works as normal)
> global:body (the whole body included just once - if other scripts try
> to include the same body nothing will happen)
> global:line (each line is trimmed and included - if other scripts try
> to include an already included line, nothing happens)
>
> I'm mainly interested in global:line of course...
> So, any thoughts? Do you feel it's an overkill?
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Re: Unique in scripts

Posted by Jesse Kuhnert <jk...@gmail.com>.
I'm assuming Andy must be sleeping by now, but that sounds like a good plan
as well. I had been reluctant to change anything dtd related before for fear
of "bad things" in general, as well as the spindle work...But as long as we
keep a list somewhere and tell Geoff what we're up to it probably shouldn't
be harmful.

I think I already started a 4.1 dtd for template parsing, but not sure about
script parsing.

If someone does do the script dtd change just remember that maven2 doesn't
auto-deploy it to the right directory for you, it needs to be manually
copied from the src tree into /www/tapestry.apache.org/dtd/ .

On 7/31/06, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> Seems to me we could extend the PageRenderSupport interface to address
> Dojo requires in much the same way that it today handles external
> scripts.  This would also presume an upgrade of the Script DTD to
> allow such things to be specified.
>
> On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> > ermmm... ok!
> >
> > Jesse Kuhnert wrote:
> > > How about just global="true" unless we can find a use case that makes
> > > line
> > > vs body necessary?
> > >
> > > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> > >>
> > >> Script 1:
> > >> <unique>
> > >> dojo.require('tapestry.*');
> > >> </unique>
> > >>
> > >> Script 2:
> > >> <unique>
> > >> dojo.require('tapestry.*');
> > >> dojo.require('tapestry.form.*');
> > >> </unique>
> > >>
> > >> Script 3:
> > >> <unique>
> > >> dojo.require('tapestry.*');
> > >> dojo.require('tapestry.form.*');
> > >> </unique>
> > >>
> > >> As is, we'll get all 5 lines.
> > >> With global:line we'll get only 2 lines
> > >> With global:body we'll get 3 lines, from 1 and 2 because the body of
> > >> 2 is
> > >> the same with 3.
> > >>
> > >> As i said, global:line is the nice stuff here...
> > >> I don't have a use case for global:body, it's just in there for
> > >> completeness.
> > >> And actually, another thought was simply
> > >> <unique perLineAndGlobal="true">
> > >> I'd prefer this one if i could find a better name for the attribute
> > >>
> > >>
> > >> Jesse Kuhnert wrote:
> > >> > I think I generally like the idea.
> > >> >
> > >> > Could you give an example of how global:line/global:body would be
> > >> > different?
> > >> >
> > >> >
> > >> > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> > >> >>
> > >> >> With all those dojo.require that are now included in pages,
> > >> >> I feel it would be nice to make them appear only once.
> > >> >>
> > >> >> The unique tag works in a per component style.
> > >> >> Hacking it a bit reduces 14-17 lines of requires
> > >> >> (in the TimeTracker example) to just 6-7
> > >> >>
> > >> >> The next step is to add a strategy attribute to unique
> > >> >> Possible values would be:
> > >> >> component (the default, works as normal)
> > >> >> global:body (the whole body included just once - if other scripts
> try
> > >> >> to include the same body nothing will happen)
> > >> >> global:line (each line is trimmed and included - if other scripts
> try
> > >> >> to include an already included line, nothing happens)
> > >> >>
> > >> >> I'm mainly interested in global:line of course...
> > >> >> So, any thoughts? Do you feel it's an overkill?
> > >> >>
> > >> >>
> > >> >>
> ---------------------------------------------------------------------
> > >> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > >> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >>
> > >> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > >> For additional commands, e-mail: dev-help@tapestry.apache.org
> > >>
> > >>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Re: Unique in scripts

Posted by Howard Lewis Ship <hl...@gmail.com>.
Seems to me we could extend the PageRenderSupport interface to address
Dojo requires in much the same way that it today handles external
scripts.  This would also presume an upgrade of the Script DTD to
allow such things to be specified.

On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> ermmm... ok!
>
> Jesse Kuhnert wrote:
> > How about just global="true" unless we can find a use case that makes
> > line
> > vs body necessary?
> >
> > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> >>
> >> Script 1:
> >> <unique>
> >> dojo.require('tapestry.*');
> >> </unique>
> >>
> >> Script 2:
> >> <unique>
> >> dojo.require('tapestry.*');
> >> dojo.require('tapestry.form.*');
> >> </unique>
> >>
> >> Script 3:
> >> <unique>
> >> dojo.require('tapestry.*');
> >> dojo.require('tapestry.form.*');
> >> </unique>
> >>
> >> As is, we'll get all 5 lines.
> >> With global:line we'll get only 2 lines
> >> With global:body we'll get 3 lines, from 1 and 2 because the body of
> >> 2 is
> >> the same with 3.
> >>
> >> As i said, global:line is the nice stuff here...
> >> I don't have a use case for global:body, it's just in there for
> >> completeness.
> >> And actually, another thought was simply
> >> <unique perLineAndGlobal="true">
> >> I'd prefer this one if i could find a better name for the attribute
> >>
> >>
> >> Jesse Kuhnert wrote:
> >> > I think I generally like the idea.
> >> >
> >> > Could you give an example of how global:line/global:body would be
> >> > different?
> >> >
> >> >
> >> > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> >> >>
> >> >> With all those dojo.require that are now included in pages,
> >> >> I feel it would be nice to make them appear only once.
> >> >>
> >> >> The unique tag works in a per component style.
> >> >> Hacking it a bit reduces 14-17 lines of requires
> >> >> (in the TimeTracker example) to just 6-7
> >> >>
> >> >> The next step is to add a strategy attribute to unique
> >> >> Possible values would be:
> >> >> component (the default, works as normal)
> >> >> global:body (the whole body included just once - if other scripts try
> >> >> to include the same body nothing will happen)
> >> >> global:line (each line is trimmed and included - if other scripts try
> >> >> to include an already included line, nothing happens)
> >> >>
> >> >> I'm mainly interested in global:line of course...
> >> >> So, any thoughts? Do you feel it's an overkill?
> >> >>
> >> >>
> >> >> ---------------------------------------------------------------------
> >> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >> >>
> >> >>
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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


Re: Unique in scripts

Posted by Andreas Andreou <an...@di.uoa.gr>.
ermmm... ok!

Jesse Kuhnert wrote:
> How about just global="true" unless we can find a use case that makes 
> line
> vs body necessary?
>
> On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
>>
>> Script 1:
>> <unique>
>> dojo.require('tapestry.*');
>> </unique>
>>
>> Script 2:
>> <unique>
>> dojo.require('tapestry.*');
>> dojo.require('tapestry.form.*');
>> </unique>
>>
>> Script 3:
>> <unique>
>> dojo.require('tapestry.*');
>> dojo.require('tapestry.form.*');
>> </unique>
>>
>> As is, we'll get all 5 lines.
>> With global:line we'll get only 2 lines
>> With global:body we'll get 3 lines, from 1 and 2 because the body of 
>> 2 is
>> the same with 3.
>>
>> As i said, global:line is the nice stuff here...
>> I don't have a use case for global:body, it's just in there for
>> completeness.
>> And actually, another thought was simply
>> <unique perLineAndGlobal="true">
>> I'd prefer this one if i could find a better name for the attribute
>>
>>
>> Jesse Kuhnert wrote:
>> > I think I generally like the idea.
>> >
>> > Could you give an example of how global:line/global:body would be
>> > different?
>> >
>> >
>> > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
>> >>
>> >> With all those dojo.require that are now included in pages,
>> >> I feel it would be nice to make them appear only once.
>> >>
>> >> The unique tag works in a per component style.
>> >> Hacking it a bit reduces 14-17 lines of requires
>> >> (in the TimeTracker example) to just 6-7
>> >>
>> >> The next step is to add a strategy attribute to unique
>> >> Possible values would be:
>> >> component (the default, works as normal)
>> >> global:body (the whole body included just once - if other scripts try
>> >> to include the same body nothing will happen)
>> >> global:line (each line is trimmed and included - if other scripts try
>> >> to include an already included line, nothing happens)
>> >>
>> >> I'm mainly interested in global:line of course...
>> >> So, any thoughts? Do you feel it's an overkill?
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> >> For additional commands, e-mail: dev-help@tapestry.apache.org
>> >>
>> >>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>

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


Re: Unique in scripts

Posted by Jesse Kuhnert <jk...@gmail.com>.
How about just global="true" unless we can find a use case that makes line
vs body necessary?

On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
>
> Script 1:
> <unique>
> dojo.require('tapestry.*');
> </unique>
>
> Script 2:
> <unique>
> dojo.require('tapestry.*');
> dojo.require('tapestry.form.*');
> </unique>
>
> Script 3:
> <unique>
> dojo.require('tapestry.*');
> dojo.require('tapestry.form.*');
> </unique>
>
> As is, we'll get all 5 lines.
> With global:line we'll get only 2 lines
> With global:body we'll get 3 lines, from 1 and 2 because the body of 2 is
> the same with 3.
>
> As i said, global:line is the nice stuff here...
> I don't have a use case for global:body, it's just in there for
> completeness.
> And actually, another thought was simply
> <unique perLineAndGlobal="true">
> I'd prefer this one if i could find a better name for the attribute
>
>
> Jesse Kuhnert wrote:
> > I think I generally like the idea.
> >
> > Could you give an example of how global:line/global:body would be
> > different?
> >
> >
> > On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
> >>
> >> With all those dojo.require that are now included in pages,
> >> I feel it would be nice to make them appear only once.
> >>
> >> The unique tag works in a per component style.
> >> Hacking it a bit reduces 14-17 lines of requires
> >> (in the TimeTracker example) to just 6-7
> >>
> >> The next step is to add a strategy attribute to unique
> >> Possible values would be:
> >> component (the default, works as normal)
> >> global:body (the whole body included just once - if other scripts try
> >> to include the same body nothing will happen)
> >> global:line (each line is trimmed and included - if other scripts try
> >> to include an already included line, nothing happens)
> >>
> >> I'm mainly interested in global:line of course...
> >> So, any thoughts? Do you feel it's an overkill?
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> >> For additional commands, e-mail: dev-help@tapestry.apache.org
> >>
> >>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Jesse Kuhnert
Tacos/Tapestry, team member/developer

Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.

Re: Unique in scripts

Posted by Andreas Andreou <an...@di.uoa.gr>.
Script 1:
<unique>
dojo.require('tapestry.*');
</unique>

Script 2:
<unique>
dojo.require('tapestry.*');
dojo.require('tapestry.form.*');
</unique>

Script 3:
<unique>
dojo.require('tapestry.*');
dojo.require('tapestry.form.*');
</unique>

As is, we'll get all 5 lines.
With global:line we'll get only 2 lines
With global:body we'll get 3 lines, from 1 and 2 because the body of 2 is
the same with 3.

As i said, global:line is the nice stuff here...
I don't have a use case for global:body, it's just in there for
completeness.
And actually, another thought was simply
<unique perLineAndGlobal="true">
I'd prefer this one if i could find a better name for the attribute


Jesse Kuhnert wrote:
> I think I generally like the idea.
>
> Could you give an example of how global:line/global:body would be 
> different?
>
>
> On 7/31/06, Andreas Andreou <an...@di.uoa.gr> wrote:
>>
>> With all those dojo.require that are now included in pages,
>> I feel it would be nice to make them appear only once.
>>
>> The unique tag works in a per component style.
>> Hacking it a bit reduces 14-17 lines of requires
>> (in the TimeTracker example) to just 6-7
>>
>> The next step is to add a strategy attribute to unique
>> Possible values would be:
>> component (the default, works as normal)
>> global:body (the whole body included just once - if other scripts try
>> to include the same body nothing will happen)
>> global:line (each line is trimmed and included - if other scripts try
>> to include an already included line, nothing happens)
>>
>> I'm mainly interested in global:line of course...
>> So, any thoughts? Do you feel it's an overkill?
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: dev-help@tapestry.apache.org
>>
>>
>
>

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