hlship / tapx

Extensions to Tapestry 5
http://tapestry.formos.com/projects/tapx/
29 stars 7 forks source link

override Tapestry.ZoneManager#processReply to work with Prototype 1.7 #23

Closed jochenberger closed 13 years ago

hlship commented 13 years ago

I'm afraid its trickier than that ... what you have will, I believe, add the core JavaScript stack to every page, regardless of whether it needs it or not. Some people really like to have at least the initial page free of JS to speed loading.

jochenberger commented 13 years ago

Oh right, I didn't think of that. Do you already have specific plans on how to solve the compatibility issues? Maybe replace tapestry.js completely and override SymbolConstants.DEFAULT_JAVASCRIPT? Or replace the ClientInfrastructure implementation to include an additional file in the CORE_JAVASCRIPT? Besides, you mentioned problems with the Prototype 1.7 and the Palette's JS. Could you please give an insight on what these are?

hlship commented 13 years ago

I've thought about it and with tapx-prototype as a temporary patch, this unwanted behavior (forces JS onto all pages) is acceptable.

jochenberger commented 13 years ago

Another issue here is that the palette.js and tapestry-js-fixes.js files might be added too late. I'm about to commit another approach (overriding the core JS stack).

hlship commented 13 years ago

Remember that all JS libraries load before anything much executes; what we have should work fine, and does in the Ajax-intensive app I've been building.

On Thu, Apr 7, 2011 at 7:55 AM, jochenberger reply@reply.github.com wrote:

Another issue here is that the palette.js and tapestry-js-fixes.js files might be added too late. I'm about to commit another approach (overriding the core JS stack).

Reply to this email directly or view it on GitHub: https://github.com/hlship/tapx/pull/23#issuecomment-969238

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

jochenberger commented 13 years ago

Sure, but won't they be loaded/executed in the way they appear in the page? If a file that's loaded between tapestry.js and tapestry-fixes.js already executes ZoneManager#processReply, it will fail, won't it?

hlship commented 13 years ago

There's no difference in effect between the two solutions, except that the additional files will be included together in the aggregated core JS stack.

JavaScript is late bound. Even if some code created an instance of Tapestry.ZoneManager on the client side as its script was loaded (which is bad form, since the DOM will likely be at best partially loaded), by the time it invoke the processReply() function, it will be invoking the patched version, since that overwrites its "slot" in the ZoneManager prototype.

On Thu, Apr 7, 2011 at 11:15 PM, jochenberger reply@reply.github.com wrote:

Sure, but won't they be loaded/executed in the way they appear in the page? If a file that's loaded between tapestry.js and tapestry-fixes.js already executes ZoneManager#processReply, it will fail, won't it?

Reply to this email directly or view it on GitHub: https://github.com/hlship/tapx/pull/23#issuecomment-972192

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