You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/10/24 02:30:15 UTC

[1/2] git commit: Merge the 5.3 compatibility library directly into the core/init module

Updated Branches:
  refs/heads/5.4-js-rewrite 78aeeb430 -> 0ae142958


Merge the 5.3 compatibility library directly into the core/init module


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/0ae14295
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/0ae14295
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/0ae14295

Branch: refs/heads/5.4-js-rewrite
Commit: 0ae1429589b25b7579a6e34575c3a3256e438e48
Parents: b15151e
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Oct 23 17:29:31 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Oct 23 17:29:31 2012 -0700

----------------------------------------------------------------------
 .../coffeescript/META-INF/modules/core/init.coffee |   44 +++++++++++++-
 .../services/javascript/CoreJavaScriptStack.java   |    2 -
 2 files changed, 40 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae14295/tapestry-core/src/main/coffeescript/META-INF/modules/core/init.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/core/init.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/core/init.coffee
index ef81235..ceb7211 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/core/init.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/core/init.coffee
@@ -14,11 +14,47 @@
 
 # ## core/init
 #
-# Compatibility module, invokes functions on the T5.initializers namespace.
+# Tapestry 5.3 compatibility module, invokes functions on the T5.initializers namespace.
 #
-# Introduced in 5.4, to be removed at some point in the future, when T5.initializers is itself no more.
-define ["core/console", "core/t53-compatibility"], ->
-  (console) ->
+# Provides a small amount of backwards compatibility to the Tapestry 5.3 approach.
+# This provides placeholders for the following:
+#
+# * `T5` namespace, including `extend`, `define`, and `initializers`, `extendInitializers`, and `_` properties
+# * `Tapestry` namespace: just the `Initializer` property, as an alias of `T5.initializers`
+#
+# Introduced in 5.4, to be removed in the next release.
+define ["core/console", "_"],
+
+  (console, _) ->
+
+    extend = (destination, source) ->
+      if _.isFunction source
+        source = source()
+
+      _.extend destination, source
+
+    T5 =
+      _: _.noConflict()
+      extend: extend
+
+      define: (name, source) ->
+
+        namespace = extend {}, source
+
+        T5[name] = namespace
+
+      initializers: {}
+
+      extendInitializers: (source) ->
+
+        extend T5.initializers, source
+
+    Tapestry =
+      Initializer: T5.initializers
+
+    window.T5 = T5
+    window.Tapestry = Tapestry
+
     # Exports a single function that finds an initializer in `T5.initializers` and invokes it.
     (initName, args...) ->
       fn = T5.initializers[initName]

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/0ae14295/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java
index e8237d2..74bbd1a 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/javascript/CoreJavaScriptStack.java
@@ -60,8 +60,6 @@ public class CoreJavaScriptStack implements JavaScriptStack
 
                     // TODO: Possibly extract prototype/scriptaculous/jquery from the stack
                     // (as has been done with Underscore), and convert to a shimmed module.
-
-                    ROOT + "/t53-compatibility.js",
             };
 
     // Because of changes to the logic of how stylesheets get incorporated, the default stylesheet