You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Donny Nadolny <do...@gmail.com> on 2011/01/16 16:05:20 UTC
Combine scripts doesn't work in 5.2.4?
I upgraded my app to 5.2.4 as soon as it was marked stable, but here's
something I just noticed now: combine scripts doesn't seem to be working. In
production mode, combine scripts is supposed to default to true, so all
javascript files on the page get combined in to one virtual asset. This
isn't happening in my application.
I tried it out using the maven archetype. Using 5.1.0.5, I changed the index
page to have:
@IncludeJavaScriptLibrary({"context:test.js", "context:test2.js"})
public class Index {
//rest of class here
}
and in src/main/webapp added two files, test.js and test2.js
Changing AppModule to comment out the production mode false line, all
scripts on the page get combined to one virtual asset.
However using 5.2.4, this doesn't happen. I've tried explicitly setting
SymbolConstants.COMBINE_SCRIPTS to true (and using @Import instead of
@IncludeJavaScriptLibrary) but I can't get scripts to be combined.
Am I missing something? If not, I'll file a JIRA issue for it.
Re: Combine scripts doesn't work in 5.2.4?
Posted by LLTYK <LL...@mailinator.com>.
The only example I've seen is in TapestryModule.java:
public static void
contributeJavaScriptStackSource(MappedConfiguration<String, JavaScriptStack>
configuration)
{
configuration.addInstance(InternalConstants.CORE_STACK_NAME,
CoreJavaScriptStack.class);
configuration.addInstance("core-datefield", DateFieldStack.class);
}
There is a configuration.overrideInstance, so in your AppModule you can
create a wrapper around CoreJavaScriptStack and call override with it.
Or you can just create your own stack and presumably have two js files.
--
View this message in context: http://tapestry-users.832.n2.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp5929290p5939372.html
Sent from the Tapestry Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by "Angelo C." <an...@gmail.com>.
can we decorate the JavascriptStack to include non T5 default js into the
single core.js? if yes, a simple sample code to get us started? thanks.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp3343378p3347367.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by Howard Lewis Ship <hl...@gmail.com>.
On Tue, Jan 18, 2011 at 10:38 AM, Donny Nadolny <do...@gmail.com> wrote:
> Thanks for the clarification.
>
> I like this change overall (it can help pageload times because the larger
> libraries will always be cached by the client after the first pageload), but
> I think it's missing part of the benefit of how the feature was in 5.1. I
> have a few libraries which I include on every page which I'll put in a stack
> now (or include in core, assuming there's a way to do that), but many of my
> components have their own javascript file, so I end up with pages that have
> several small javascript files on them which would be better combined in to
> one virtual file. It would be nice if there was an option to enable the old
> combine scripts, where javascript files that aren't part of a stack get
> combined.
Or, if there was an easier way to create a per-application or
per-library stack. You can have as many stacks as you like, but
currently creating one involves writing a bit of code, an
implementation of JavaScriptStack.
>
> On Tue, Jan 18, 2011 at 12:59 PM, Howard Lewis Ship <hl...@gmail.com>wrote:
>
>> Not a bug; a change in behavior.
>>
>> http://tapestry.apache.org/release-notes-52.html
>>
>> https://issues.apache.org/jira/browse/TAP5-769
>>
>>
>> ... but we should update the release notes to make a larger not of this.
>>
>>
>> On Tue, Jan 18, 2011 at 9:53 AM, LLTYK <LL...@mailinator.com> wrote:
>> >
>> > The builtin tapestry stuff seems to combine itself into core.js if it's
>> > included as a stack. Maybe it works if you create a javascriptstack
>> instead?
>> > Still a bug though.
>> > --
>> > View this message in context:
>> http://tapestry-users.832.n2.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp5929290p5936505.html
>> > Sent from the Tapestry Users mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Howard M. Lewis Ship
>>
>> Creator of Apache Tapestry
>>
>> The source for Tapestry training, mentoring and support. Contact me to
>> learn how I can get you up and productive in Tapestry fast!
>>
>> (971) 678-5210
>> http://howardlewisship.com
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by Donny Nadolny <do...@gmail.com>.
Thanks for the clarification.
I like this change overall (it can help pageload times because the larger
libraries will always be cached by the client after the first pageload), but
I think it's missing part of the benefit of how the feature was in 5.1. I
have a few libraries which I include on every page which I'll put in a stack
now (or include in core, assuming there's a way to do that), but many of my
components have their own javascript file, so I end up with pages that have
several small javascript files on them which would be better combined in to
one virtual file. It would be nice if there was an option to enable the old
combine scripts, where javascript files that aren't part of a stack get
combined.
On Tue, Jan 18, 2011 at 12:59 PM, Howard Lewis Ship <hl...@gmail.com>wrote:
> Not a bug; a change in behavior.
>
> http://tapestry.apache.org/release-notes-52.html
>
> https://issues.apache.org/jira/browse/TAP5-769
>
>
> ... but we should update the release notes to make a larger not of this.
>
>
> On Tue, Jan 18, 2011 at 9:53 AM, LLTYK <LL...@mailinator.com> wrote:
> >
> > The builtin tapestry stuff seems to combine itself into core.js if it's
> > included as a stack. Maybe it works if you create a javascriptstack
> instead?
> > Still a bug though.
> > --
> > View this message in context:
> http://tapestry-users.832.n2.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp5929290p5936505.html
> > Sent from the Tapestry Users mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
> --
> Howard M. Lewis Ship
>
> Creator of Apache Tapestry
>
> The source for Tapestry training, mentoring and support. Contact me to
> learn how I can get you up and productive in Tapestry fast!
>
> (971) 678-5210
> http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Combine scripts doesn't work in 5.2.4?
Posted by Howard Lewis Ship <hl...@gmail.com>.
Not a bug; a change in behavior.
http://tapestry.apache.org/release-notes-52.html
https://issues.apache.org/jira/browse/TAP5-769
... but we should update the release notes to make a larger not of this.
On Tue, Jan 18, 2011 at 9:53 AM, LLTYK <LL...@mailinator.com> wrote:
>
> The builtin tapestry stuff seems to combine itself into core.js if it's
> included as a stack. Maybe it works if you create a javascriptstack instead?
> Still a bug though.
> --
> View this message in context: http://tapestry-users.832.n2.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp5929290p5936505.html
> Sent from the Tapestry Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
Howard M. Lewis Ship
Creator of Apache Tapestry
The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!
(971) 678-5210
http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by LLTYK <LL...@mailinator.com>.
The builtin tapestry stuff seems to combine itself into core.js if it's
included as a stack. Maybe it works if you create a javascriptstack instead?
Still a bug though.
--
View this message in context: http://tapestry-users.832.n2.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp5929290p5936505.html
Sent from the Tapestry Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by Donny Nadolny <do...@gmail.com>.
Thanks for testing it out. I've filed an issue for it at
https://issues.apache.org/jira/browse/TAP5-1416
On Mon, Jan 17, 2011 at 1:36 AM, Angelo C. <an...@gmail.com> wrote:
>
> I did a testing on the Tapestry-Hotel-Booking demo in the
> tapestry.apache.org, added following:
>
> @ApplicationDefaults
> @Contribute(SymbolProvider.class)
> public static void configureTapestryHotelBooking(
> MappedConfiguration<String, String> configuration)
> {
>
> configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
> configuration.add(SymbolConstants.APPLICATION_VERSION,
> "1.2-SNAPSHOT");
>
> configuration.add(SymbolConstants.PRODUCTION_MODE, "true"); // test add
> configuration.add(SymbolConstants.COMBINE_SCRIPTS, "true"); // test add
>
> }
>
> but the page source has this, seems scripts not combined :
>
> <head>
>
> <script
> src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/stack/en/core.js"
> type="text/javascript">
> </script>
> <script
>
> src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/beanvalidator/tapestry-beanvalidator.js"
> type="text/javascript">
> </script>
> <script
>
> src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/ctx/static/hotel-booking.js"
> type="text/javascript">
> </script>
> <link type="text/css" rel="stylesheet"
> href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/default.css" />
> <link type="text/css" rel="stylesheet"
>
> href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/tapestry-console.css"
> />
> <link type="text/css" rel="stylesheet"
> href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/ctx/static/style.css" />
> <title>
> Tapestry 5 Hotel Booking - Members login
> </title>
> <meta content="Apache Tapestry Framework (version 5.2.4)"
> name="generator"
> />
> </head>
>
> --
> View this message in context:
> http://tapestry.1045711.n5.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp3343378p3343988.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
Re: Combine scripts doesn't work in 5.2.4?
Posted by "Angelo C." <an...@gmail.com>.
I did a testing on the Tapestry-Hotel-Booking demo in the
tapestry.apache.org, added following:
@ApplicationDefaults
@Contribute(SymbolProvider.class)
public static void configureTapestryHotelBooking(
MappedConfiguration<String, String> configuration)
{
configuration.add(SymbolConstants.SUPPORTED_LOCALES, "en");
configuration.add(SymbolConstants.APPLICATION_VERSION,
"1.2-SNAPSHOT");
configuration.add(SymbolConstants.PRODUCTION_MODE, "true"); // test add
configuration.add(SymbolConstants.COMBINE_SCRIPTS, "true"); // test add
}
but the page source has this, seems scripts not combined :
<head>
<script
src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/stack/en/core.js"
type="text/javascript">
</script>
<script
src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/beanvalidator/tapestry-beanvalidator.js"
type="text/javascript">
</script>
<script
src="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/ctx/static/hotel-booking.js"
type="text/javascript">
</script>
<link type="text/css" rel="stylesheet"
href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/default.css" />
<link type="text/css" rel="stylesheet"
href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/tapestry/tapestry-console.css"
/>
<link type="text/css" rel="stylesheet"
href="/tapestry5-hotel-booking/assets/1.2-SNAPSHOT/ctx/static/style.css" />
<title>
Tapestry 5 Hotel Booking - Members login
</title>
<meta content="Apache Tapestry Framework (version 5.2.4)" name="generator"
/>
</head>
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp3343378p3343988.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Combine scripts doesn't work in 5.2.4?
Posted by "Angelo C." <an...@gmail.com>.
Exactly the same problem, changing to @Import does not work, using
@Environmental
private JavaScriptSupport javaScriptSupport; then importJavaScriptLibrar
does not work, so far app works, but did encounter problems with IE8
complaining about:
Message: Object doesn't support this property or method
Line: 4823
Char: 5
Code: 0
URI: http://localhost/assets/6e2a6910f259c1fd/stack/en/core.js
not sure if it has something to do with this non combining of js, but it did
work well under T 5.1.0.5
any help will be highly appreciated.
--
View this message in context: http://tapestry.1045711.n5.nabble.com/Combine-scripts-doesn-t-work-in-5-2-4-tp3343378p3343974.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org