New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grails 3 plugin: onLoad="true" doesn't work #2

Closed
dilvan1 opened this Issue Aug 3, 2015 · 12 comments

Comments

Projects
None yet
2 participants
@dilvan1

dilvan1 commented Aug 3, 2015

Just add onLoad="true" to one of the examples and the template doesn't run (using org.grails.plugins:grooscript:1.1.0):

 <grooscript:template onLoad="true">
            ul {
                5.times { number ->
                    li "$number li item"
                }
            }
</grooscript:template>
@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Aug 3, 2015

Owner

Hello!

Yes, it's bug. The default value of this option is true. Does it work with this code?

 <grooscript:template>
            ul {
                5.times { number ->
                    li "$number li item"
                }
            }
</grooscript:template>
Owner

chiquitinxx commented Aug 3, 2015

Hello!

Yes, it's bug. The default value of this option is true. Does it work with this code?

 <grooscript:template>
            ul {
                5.times { number ->
                    li "$number li item"
                }
            }
</grooscript:template>
@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Aug 11, 2015

Hi,

The code works fine, the only problem is if you add onLoad=“true”.
It doesn’t seem something difficult to fix.

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Mon, Aug 3, 2015 at 2:25 PM, Jorge Franco notifications@github.com
wrote:

Hello!

Yes, it's bug. The default value of this option is true. Does it work with
this code?

grooscript:template
ul {
5.times { number ->
li "$number li item"
}
}/grooscript:template


Reply to this email directly or view it on GitHub
#2 (comment)
.

dilvan1 commented Aug 11, 2015

Hi,

The code works fine, the only problem is if you add onLoad=“true”.
It doesn’t seem something difficult to fix.

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Mon, Aug 3, 2015 at 2:25 PM, Jorge Franco notifications@github.com
wrote:

Hello!

Yes, it's bug. The default value of this option is true. Does it work with
this code?

grooscript:template
ul {
5.times { number ->
li "$number li item"
}
}/grooscript:template


Reply to this email directly or view it on GitHub
#2 (comment)
.

@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Aug 11, 2015

Owner

There is a new version (1.1.1) with that fixes.

Owner

chiquitinxx commented Aug 11, 2015

There is a new version (1.1.1) with that fixes.

@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Aug 11, 2015

Hi,

Not working yet for me:
https://repo.grails.org/grails/core/org/grails/plugins/grooscript/1.1.1/grooscript-1.1.1.pom

I will try later.

Cheers,

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Tue, Aug 11, 2015 at 2:11 PM, Jorge Franco notifications@github.com
wrote:

There is a new version (1.1.1) with that fixes.


Reply to this email directly or view it on GitHub
#2 (comment)
.

dilvan1 commented Aug 11, 2015

Hi,

Not working yet for me:
https://repo.grails.org/grails/core/org/grails/plugins/grooscript/1.1.1/grooscript-1.1.1.pom

I will try later.

Cheers,

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Tue, Aug 11, 2015 at 2:11 PM, Jorge Franco notifications@github.com
wrote:

There is a new version (1.1.1) with that fixes.


Reply to this email directly or view it on GitHub
#2 (comment)
.

@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Sep 7, 2015

Hi,

I would like to use React http://facebook.github.io/react/ and material
ui http://material-ui.com/#/ (A Set of React Components that Implement
Google's Material Design) with grooscript. In your demos, you have two
examples: react
https://github.com/chiquitinxx/grooscript-demos/tree/master/src/main/groovy/react
and react-native
https://github.com/chiquitinxx/grooscript-demos/tree/master/src/main/groovy/reactNative.
Your react demo seems to be just grooscript code, which emulates React's
behavior, but does not use the React framework. Is that correct? If so, if
I want to use React http://facebook.github.io/react/ and material ui
http://material-ui.com/#/ which demo code should I use as a start point?

Thanks,

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

dilvan1 commented Sep 7, 2015

Hi,

I would like to use React http://facebook.github.io/react/ and material
ui http://material-ui.com/#/ (A Set of React Components that Implement
Google's Material Design) with grooscript. In your demos, you have two
examples: react
https://github.com/chiquitinxx/grooscript-demos/tree/master/src/main/groovy/react
and react-native
https://github.com/chiquitinxx/grooscript-demos/tree/master/src/main/groovy/reactNative.
Your react demo seems to be just grooscript code, which emulates React's
behavior, but does not use the React framework. Is that correct? If so, if
I want to use React http://facebook.github.io/react/ and material ui
http://material-ui.com/#/ which demo code should I use as a start point?

Thanks,

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Sep 7, 2015

Owner

Hello!

Yes, the first demo is using a groovy @ast to do things as react does. The second demo is using react native to make an ios application https://facebook.github.io/react-native/. I think you better start from scratch. React has some hacks, as use it own syntax, or use 'this' in javascript objects. Can be challenging use it from grooscript. If you do something, please share it :)

Good luck!

Owner

chiquitinxx commented Sep 7, 2015

Hello!

Yes, the first demo is using a groovy @ast to do things as react does. The second demo is using react native to make an ios application https://facebook.github.io/react-native/. I think you better start from scratch. React has some hacks, as use it own syntax, or use 'this' in javascript objects. Can be challenging use it from grooscript. If you do something, please share it :)

Good luck!

@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Sep 8, 2015

Thanks for the tips! I am actually testing some possible technologies to
port a project I have in GWT to grooscript. So, I am experimenting with
React and polymer. Polymer is easier, I just have to convert to grooscript
the element registration call (Would you prefer to do this conversion code
yourself?) :

<script> // element registration Polymer({ is: "element-name”, ready: function() { ... } ``` // add properties and methods on the element's prototype properties: { // declare properties for the element's public API greeting: { type: String, value: "Hello!" } ... } }); ``` </script>

Is there anyone working with polymer+grooscript?

Also, about grooscript:

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Mon, Sep 7, 2015 at 7:51 PM, Jorge Franco notifications@github.com
wrote:

Hello!

Yes, the first demo is using a groovy @ast https://github.com/AST to do
things as react does. The second demo is using react native to make an ios
application https://facebook.github.io/react-native/. I think you better
start from scratch. React has some hacks, as use it own syntax, or use
'this' in javascript objects. Can be challenging use it from grooscript. If
you do something, please share it :)

Good luck!


Reply to this email directly or view it on GitHub
#2 (comment)
.

dilvan1 commented Sep 8, 2015

Thanks for the tips! I am actually testing some possible technologies to
port a project I have in GWT to grooscript. So, I am experimenting with
React and polymer. Polymer is easier, I just have to convert to grooscript
the element registration call (Would you prefer to do this conversion code
yourself?) :

<script> // element registration Polymer({ is: "element-name”, ready: function() { ... } ``` // add properties and methods on the element's prototype properties: { // declare properties for the element's public API greeting: { type: String, value: "Hello!" } ... } }); ``` </script>

Is there anyone working with polymer+grooscript?

Also, about grooscript:

Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
http://java.icmc.usp.br
Warning: I use a spam filter, some emails sent to me CAN be lost!

On Mon, Sep 7, 2015 at 7:51 PM, Jorge Franco notifications@github.com
wrote:

Hello!

Yes, the first demo is using a groovy @ast https://github.com/AST to do
things as react does. The second demo is using react native to make an ios
application https://facebook.github.io/react-native/. I think you better
start from scratch. React has some hacks, as use it own syntax, or use
'this' in javascript objects. Can be challenging use it from grooscript. If
you do something, please share it :)

Good luck!


Reply to this email directly or view it on GitHub
#2 (comment)
.

@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Sep 10, 2015

Owner

Hello!

I asked in @grooscript twitter account for people using polymer.

No plans for source maps, I created an improvement issue in grooscript project. Maybe in the future.

No plans for Google closure, grooscript supports Require.js, and it has support for google closure. Also, you can use if you want to, is a tool that you can use with any js file.

Owner

chiquitinxx commented Sep 10, 2015

Hello!

I asked in @grooscript twitter account for people using polymer.

No plans for source maps, I created an improvement issue in grooscript project. Maybe in the future.

No plans for Google closure, grooscript supports Require.js, and it has support for google closure. Also, you can use if you want to, is a tool that you can use with any js file.

@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Sep 11, 2015

Hi,

You wrote:

On Thu, Sep 10, 2015 at 2:47 PM, Jorge Franco notifications@github.com
wrote:

No plans for Google closure, grooscript supports Require.js, and it has
support for google closure. Also, you can use if you want to, is a tool
that you can use with any js file.

As I understand, you can only use Google Closure if the generated
javascript of grooscript follows Google Closure rules. If it currently
does, it would be a huge gain for grooscript to include Google Closure as
its final compilation step. Does grooscript generate Google Closure
compatible javascript?

BTW, Google Closure has a library to implement source maps
(clojureScript uses it).

Cheers,

Dilvan.


Reply to this email directly or view it on GitHub
#2 (comment)
.

dilvan1 commented Sep 11, 2015

Hi,

You wrote:

On Thu, Sep 10, 2015 at 2:47 PM, Jorge Franco notifications@github.com
wrote:

No plans for Google closure, grooscript supports Require.js, and it has
support for google closure. Also, you can use if you want to, is a tool
that you can use with any js file.

As I understand, you can only use Google Closure if the generated
javascript of grooscript follows Google Closure rules. If it currently
does, it would be a huge gain for grooscript to include Google Closure as
its final compilation step. Does grooscript generate Google Closure
compatible javascript?

BTW, Google Closure has a library to implement source maps
(clojureScript uses it).

Cheers,

Dilvan.


Reply to this email directly or view it on GitHub
#2 (comment)
.

@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Sep 12, 2015

Owner

As far as I know, any Javascript code can be improved with Google Closure. It supports ECMAScript 5, used by grooscript. The optimization of javascript code can be managed after, by any task in your build or any plugin. There are a lot of options to optimize javascript code, no need to include in the grooscript core project.

For example take a look at this gradle plugin: https://github.com/eriwen/gradle-js-plugin

Owner

chiquitinxx commented Sep 12, 2015

As far as I know, any Javascript code can be improved with Google Closure. It supports ECMAScript 5, used by grooscript. The optimization of javascript code can be managed after, by any task in your build or any plugin. There are a lot of options to optimize javascript code, no need to include in the grooscript core project.

For example take a look at this gradle plugin: https://github.com/eriwen/gradle-js-plugin

@dilvan1

This comment has been minimized.

Show comment
Hide comment
@dilvan1

dilvan1 Sep 14, 2015

Hi,

I am trying to interface grooscript to javascript in a subsystem of ePad
http://epad.stanford.edu (a big GWT application). My questions:

  1. When a @GsNative method returns a javascript object, what is the type
    of this object in the Groovy side?

  2. In these returned javascript objects, can I call their javascript
    methods in the groovy side (without using @GsNative)?

    The question 2 occurred to me when I was analyzing your code for the Raphael
    demo
    https://github.com/chiquitinxx/grooscript-demos/blob/master/src/main/groovy/raphael/Stars.groovy.
    In it, there is a context field and you call methods in it (initAndMove
    method) that don’t seem to be defined anywhere. Do they come from
    javascript?

    BTW, is there a WebGL library for grooscript?

    Cheers,

    Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
    http://java.icmc.usp.br
    Warning: I use a spam filter, some emails sent to me CAN be lost!

dilvan1 commented Sep 14, 2015

Hi,

I am trying to interface grooscript to javascript in a subsystem of ePad
http://epad.stanford.edu (a big GWT application). My questions:

  1. When a @GsNative method returns a javascript object, what is the type
    of this object in the Groovy side?

  2. In these returned javascript objects, can I call their javascript
    methods in the groovy side (without using @GsNative)?

    The question 2 occurred to me when I was analyzing your code for the Raphael
    demo
    https://github.com/chiquitinxx/grooscript-demos/blob/master/src/main/groovy/raphael/Stars.groovy.
    In it, there is a context field and you call methods in it (initAndMove
    method) that don’t seem to be defined anywhere. Do they come from
    javascript?

    BTW, is there a WebGL library for grooscript?

    Cheers,

    Dilvan de Abreu Moreira, Ph.D. dilvan@gmail.com
    http://java.icmc.usp.br
    Warning: I use a spam filter, some emails sent to me CAN be lost!

@chiquitinxx

This comment has been minimized.

Show comment
Hide comment
@chiquitinxx

chiquitinxx Sep 16, 2015

Owner

Hello!

There is no WebGl library for grooscript. Just you can to create a wrap if you want to use from the groovy side. Something similar is done in GQuery / GQueryImpl.

When a @GsNative method returns a javascript object, that javascript object can be used as it is. Is a javascript object with methods / properties you can use. Don't expect that object as a 'groovy' object or map, with the groovy methods / helpers. If you want to convert that object to a 'groovy' object, you can do that inside the javascript code.

In that starts demo, context is created in initCanvas method (gSobject.context = canvas.getContext("2d");). gSobject is like 'this', is a variable available in the context of your class that is the instance of the object.

Tell me if you don't understand, I can make a code to explain it better.

Thank you!

Owner

chiquitinxx commented Sep 16, 2015

Hello!

There is no WebGl library for grooscript. Just you can to create a wrap if you want to use from the groovy side. Something similar is done in GQuery / GQueryImpl.

When a @GsNative method returns a javascript object, that javascript object can be used as it is. Is a javascript object with methods / properties you can use. Don't expect that object as a 'groovy' object or map, with the groovy methods / helpers. If you want to convert that object to a 'groovy' object, you can do that inside the javascript code.

In that starts demo, context is created in initCanvas method (gSobject.context = canvas.getContext("2d");). gSobject is like 'this', is a variable available in the context of your class that is the instance of the object.

Tell me if you don't understand, I can make a code to explain it better.

Thank you!

chiquitinxx added a commit that referenced this issue Jun 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment