You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Azudio Developer <de...@azudio.co.uk> on 2014/02/08 11:19:08 UTC

Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Thanks Dragan.

I’ve started to knock something up at https://github.com/adamhenderson/tapestry-dojo which is my first rough stab at getting something working. I’ve basically just created a module that builds 
a new JavaScriptStack containing references to dojo but keeping underscore & bootstrap which replaces the ‘core’ and then created a dojo port (work in progress) of the ‘dom’ module t5-core-dom-dojo.js

I’m currently having trouble getting rid of the require config object that gets written out before the libraries are loaded - can’t seem to override the ModuleManager service. 

Regards,
Adam.


On 27 Jan 2014, at 11:05, Dragan Sahpaski <dr...@gmail.com> wrote:

> 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/main/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 <de...@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
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Posted by Chris Mylonas <ch...@opencsta.org>.
Impressive!

I am currently a simple and irregular t5 app maker, sadly with more php foo
than js.

However, t5.4 and addons like this will turn me into a js and json loving
fiend.

Thanks for hacking at it :)
On 15/02/2014 11:55 pm, "Azudio Developer" <de...@azudio.co.uk> wrote:

> I'm making some more progress on a Dojo implementation and have DOM
> manipulation, Events & Zones working.
>
> I've had to replace events.js with an implementation with event names
> without colons.
>
> https://github.com/adamhenderson/tapestry-dojo
>
>
>
> On 8 Feb 2014, at 16:55, Thiago H de Paula Figueiredo <th...@gmail.com>
> wrote:
>
> > On Sat, 08 Feb 2014 08:19:08 -0200, Azudio Developer <de...@azudio.co.uk>
> wrote:
> >
> >> I'm currently having trouble getting rid of the require config object
> that gets written out before the libraries are loaded - can't seem to
> override the ModuleManager service.
> >
> > ModuleManager is a service like every other, so you can override,
> decorate or advise it.
> >
> > --
> > 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
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Posted by Azudio Developer <de...@azudio.co.uk>.
I’m making some more progress on a Dojo implementation and have DOM manipulation, Events & Zones working. 

I’ve had to replace events.js with an implementation with event names without colons.

https://github.com/adamhenderson/tapestry-dojo



On 8 Feb 2014, at 16:55, Thiago H de Paula Figueiredo <th...@gmail.com> wrote:

> On Sat, 08 Feb 2014 08:19:08 -0200, Azudio Developer <de...@azudio.co.uk> wrote:
> 
>> I’m currently having trouble getting rid of the require config object that gets written out before the libraries are loaded - can’t seem to override the ModuleManager service.
> 
> ModuleManager is a service like every other, so you can override, decorate or advise it.
> 
> -- 
> 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
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Sat, 08 Feb 2014 08:19:08 -0200, Azudio Developer <de...@azudio.co.uk>  
wrote:

> I’m currently having trouble getting rid of the require config object  
> that gets written out before the libraries are loaded - can’t seem to  
> override the ModuleManager service.

ModuleManager is a service like every other, so you can override, decorate  
or advise it.

-- 
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


Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Posted by Adam Henderson <ad...@azudio.co.uk>.
Hi Dimitris,

As you know, Tap 5.4 is using RequireJS as the loader and is configured by creating a var require={} object before the require.js file is loaded. As I am using dojo, it uses a similar mechanism but the variable is called ‘dojoConfig’. The ‘require’ object currently being output by Tap is not used, therefore I want to get rid of it.

I’ll take a look at the module configuration callback API to see if its suitable for my needs.



On 8 Feb 2014, at 12:03, Dimitris Zenios <di...@gmail.com> wrote:

> Why do you want to get rid of the config?You can add/remove/ovveride the
> current config using javascriptSupport.addModuleConfigurationCallback
> 
> 
> On Sat, Feb 8, 2014 at 12:19 PM, Azudio Developer <de...@azudio.co.uk> wrote:
> 
>> Thanks Dragan.
>> 
>> I've started to knock something up at
>> https://github.com/adamhenderson/tapestry-dojo which is my first rough
>> stab at getting something working. I've basically just created a module
>> that builds
>> a new JavaScriptStack containing references to dojo but keeping underscore
>> & bootstrap which replaces the 'core' and then created a dojo port (work in
>> progress) of the 'dom' module t5-core-dom-dojo.js
>> 
>> I'm currently having trouble getting rid of the require config object that
>> gets written out before the libraries are loaded - can't seem to override
>> the ModuleManager service.
>> 
>> Regards,
>> Adam.
>> 
>> 
>> On 27 Jan 2014, at 11:05, Dragan Sahpaski <dr...@gmail.com>
>> wrote:
>> 
>>> 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/main/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 <de...@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
>>>> 
>>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Tapestry 5.4 Dojo as the Infrastructure Provider

Posted by Dimitris Zenios <di...@gmail.com>.
Why do you want to get rid of the config?You can add/remove/ovveride the
current config using javascriptSupport.addModuleConfigurationCallback


On Sat, Feb 8, 2014 at 12:19 PM, Azudio Developer <de...@azudio.co.uk> wrote:

> Thanks Dragan.
>
> I've started to knock something up at
> https://github.com/adamhenderson/tapestry-dojo which is my first rough
> stab at getting something working. I've basically just created a module
> that builds
> a new JavaScriptStack containing references to dojo but keeping underscore
> & bootstrap which replaces the 'core' and then created a dojo port (work in
> progress) of the 'dom' module t5-core-dom-dojo.js
>
> I'm currently having trouble getting rid of the require config object that
> gets written out before the libraries are loaded - can't seem to override
> the ModuleManager service.
>
> Regards,
> Adam.
>
>
> On 27 Jan 2014, at 11:05, Dragan Sahpaski <dr...@gmail.com>
> wrote:
>
> > 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/main/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 <de...@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
> >>
> >>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>