[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: Tapestry 5.4 Dojo as the Infrastructure Provider
From:       Dragan Sahpaski <dragan.sahpaski () gmail ! com>
Date:       2014-01-27 11:05:56
Message-ID: CAOz=2Qwq3z8PbFbekRcCM3yF2OcjGTgyab-mnTP_6BZ8u91CDg () mail ! gmail ! com
[Download RAW message or body]


If you want to replace jquery than take a look
at /tapestry-core/src/main/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee
 [1]. Quoting the part of the doc from the file file "This is the
abstraction layer that allows the majority of components to operate without
caring whether the underlying infrastructure framework is Prototype,
jQuery, or something else."

This file compiles to:
for jquery support:
/tapestry-core/src/main/generated/compiled-processed-cofeescript/org/apache/tapestry5/
 t5-core-dom-jquery.js
for prototype support:
/tapestry-core/src/main/generated/compiled-processed-cofeescript/org/apache/tapestry5/
 t5-core-dom-prototype.js
(these are generated using the corresponding gradle tasks in build.gradle).

So for using another javascript provider take a look at
JavaScriptModule.java

Here's the JavaScriptModule.setupFoundationFramework where the compiled and
processed js files are used to provide t5/core/dom by contributing to
ModuleManager:

  @Contribute(ModuleManager.class)
    public static void setupFoundationFramework(MappedConfiguration<String,
Object> configuration,

@Symbol(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER)
                                                String provider,

@Path("classpath:org/apache/tapestry5/t5-core-dom-prototype.js")
                                                Resource domPrototype,

@Path("classpath:org/apache/tapestry5/t5-core-dom-jquery.js")
                                                Resource domJQuery)
    {
        if (provider.equals("prototype"))
        {
            configuration.add("t5/core/dom", new
JavaScriptModuleConfiguration(domPrototype));
        }

        if (provider.equals("jquery"))
        {
            configuration.add("t5/core/dom", new
JavaScriptModuleConfiguration(domJQuery));
        }

        // If someone wants to support a different infrastructure, they
should set the provider symbol to some other value
        // and contribute their own version of the t5/core/dom module.
    }

i don't know what else to add, you'll have to figure out as you go because
I haven't done this so please reply if you have success.

I can't comment on replacing requirejs with another AMD loader.

[1]
https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-core/src/ma \
in/preprocessed-coffeescript/org/apache/tapestry5/t5-core-dom.coffee;h=c76a6fedb9c73b7ab077a1df59bb4e64d8891528;hb=HEAD




Cheers,
Dragan Sahpaski


On Sun, Jan 26, 2014 at 9:18 PM, Thiago H de Paula Figueiredo <
thiagohp@gmail.com> wrote:

> On Thu, 23 Jan 2014 22:35:04 -0200, Azudio Developer <dev@azudio.co.uk>
> wrote:
> 
> Hi All,
> > 
> 
> Hi!
> 
> 
> I know that Tap 5.4 is still (great) work in progress but I would like to
> > see a better explanation of the Classes behind all the JavaScript handling
> > and how it all hangs together.
> > 
> 
> Any classes or interfaces in particular?
> 
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic