Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tapestry 5.4: In The Pipeline

Tapestry 5.4: In The Pipeline

Presented to the cool folks at iFactory.

Howard M. Lewis Ship

September 04, 2012
Tweet

More Decks by Howard M. Lewis Ship

Other Decks in Technology

Transcript

  1. Aggregation / Minimization Stacks Scalable structure: JavaScriptSupport T5.initializer Real encapsulation

    inside components Full page vs. Ajax consistency Why Tapestry JavaScript Support Rocks
  2. Why Tapestry JavaScript Support Sucks T5.initializers Simple things require "heavy"

    structure T5 namespace / Tapestry namespace – what a mess! Prototype dependency … where's jQuery? Too much based on Prototype's Class Requires a lot of monkey patching to customize
  3. JavaScript in 5.3 <input type="text" id="email" …/> JSONObject spec =

    new JSONObject("id", id, validateURL, …); javaScriptSupport.addInitializerCall("checkEmail", spec); T5.extendInitializers({ checkEmail: function(spec) { $(spec.id).on("change", function (event) { … }); } });
  4. Asynchronous Module Definition JavaScript Modules – for browsers Modules define

    dependencies Dependencies loaded asynchronously RequireJS – http://requirejs.org
  5. AMD define(["core/spi", "core/console"], function(spi, console) { … return { foo:

    function() { … }, bar: function() { … } }; }); Hygenic Function (for hiding private variables and functions) Properties exported by this module
  6. Module style Modules seem to be shorter, easier Parallel loading

    of dependencies ➠ faster page load Implicit hygenic functions to hide private properties & functions Nice avoidance of globals Easy to monkey patch Tapestry can override an entire module
  7. CoffeeScript CoffeeScript ➠ ❝… a little language that compiles into

    JavaScript❞ Concise and readable Optional parenthesis Implicit returns Concise function definitions Great fit with Underscore!
  8. CoffeeScript: Defining Functions (x,y) -> x * y function (x,

    y) { return x * y; } isBlank = (str) -> _.isNull(str) or _.isUndefined(str) or str.trim() is "" function isBlank(str) { return _.isNull(str) || _.isUndefined(str) || str.trim() === ""; } _.map list, (x) -> 2 * x _.map(list, function(x) { return 2 * x; });
  9. Modules + HTML5 data- attributes <body> … <input type="text" data-validate-url="…"

    …/> markupWriter.attributes("data-validate-url", …); javaScriptSupport.require("app/validations"); define ["core/spi"], (spi) -> spi.domReady -> spi.body().on "change", "[data-validate-url]", (event) -> …
  10. Also in 5.4 (hopefully!) Built-in Twitter Bootstrap stylesheets! Extensible Dashboard

    page Modules aggregated into stacks LESS and/or SASS support Cometd or WebSocket support … plus lots of little stuff … whatever we can finish soon, for December release
  11. Things you've missed since 5.1 Page singletons Many performance enhancements

    Improved meta-programming with Plastic Live reloading in the services layer JavaScript / CSS minimization Kaptcha support HTML5 support Non-private component fields
  12. … but wait, there's more! @ActivationRequestParameter – automates onActivate() /

    onPassivate() @RequestParameter Full HTML exception report for failed Ajax requests MultiZoneUpdate ➠ AjaxResponseRenderer service Underscore.js Tree component Skinning / Theming support User Alerts