You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Alex Harui <ah...@adobe.com.INVALID> on 2018/06/18 03:53:51 UTC

Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

FYI, IMO, the recommended practice is to not have untyped members and create types if needed.  But this is for MDL, so doesn't really matter.

My reasoning is that it will always help future optimizers and runtimes to know the types of everything.

My 2 cents,
-Alex

On 6/17/18, 3:43 AM, "yishayw@apache.org" <yi...@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.
    
    yishayw pushed a commit to branch feature/revert-refactor
    in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cd77275bd67964759a70908d5d43f1b91%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636648289868136910&sdata=OX9Bv6x8tofEiFP4CL618YzO8flAxbThhkdk13pZ3RQ%3D&reserved=0
    
    
    The following commit(s) were added to refs/heads/feature/revert-refactor by this push:
         new c1f20f3  Fixes #261. Untyped members need to be surrounded with quotes.
    c1f20f3 is described below
    
    commit c1f20f30eeddf4aec20894f5326ec1d188b729c0
    Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
    AuthorDate: Sun Jun 17 13:42:50 2018 +0300
    
        Fixes #261. Untyped members need to be surrounded with quotes.
    ---
     .../src/main/royale/org/apache/royale/mdl/ProgressBar.as              | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    index 8dbaa23..820a9f5 100644
    --- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    +++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    @@ -149,7 +149,7 @@ package org.apache.royale.mdl
             {
                 if (materialProgress && !_indeterminate)
                 {
    -                materialProgress.setProgress(value);
    +                materialProgress["setProgress"](value);
                 }
             }
     
    @@ -171,7 +171,7 @@ package org.apache.royale.mdl
             {
                 if (!event.currentTarget) return;
     
    -            materialProgress = event.currentTarget.MaterialProgress;
    +            materialProgress = event.currentTarget["MaterialProgress"];
     
                 setCurrentProgress(_currentProgress);
                 setCurrentBuffer(_currentBuffer);
    
    -- 
    To stop receiving notification emails like this one, please contact
    yishayw@apache.org.
    


Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by Carlos Rovira <ca...@apache.org>.
Ok Yishay,

HTMLDialogElement was already there when I try to use, I was referring to
"dialogPolyFill" that is in "missing.js" and was needed to make Dialog.as.
But I see is was changed at some time to bracket expression, don't know why

ProgressBar was done by Piotr, maybe he could throw more light on this.

thanks



2018-06-18 12:19 GMT+02:00 yishayw <yi...@hotmail.com>:

> yishayw wrote
> > I don’t understand how HTMLDialogELement.as gets generated.
>
> I can see now that it's in html5.js. So it's not an mdl definition but an
> html one.
>
> Oh well, I guess I'll stick to the solution I gave for now.
>
>
>
>
>
>
> --
> Sent from: http://apache-royale-development.20373.n8.nabble.com/
>



-- 
Carlos Rovira
http://about.me/carlosrovira

RE: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by yishayw <yi...@hotmail.com>.
yishayw wrote
> I don’t understand how HTMLDialogELement.as gets generated.

I can see now that it's in html5.js. So it's not an mdl definition but an
html one.

Oh well, I guess I'll stick to the solution I gave for now.






--
Sent from: http://apache-royale-development.20373.n8.nabble.com/

RE: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by Yishay Weiss <yi...@hotmail.com>.
Hi Carlos,



If you look at ProgressBar.as:61 you’ll see



        private var materialProgress:Object;



this is the raw mdl object that ProgressBar wraps. When you call a method on that wrapped object, e.g.



         materialProgress.setProgress(value);



the transpiled minified code could look something like



mp.sp(v),



But because mdl is a third part library which is not touched by our compiler we will get a run time error because mdl expects setProgress(), not sp().



One way to solve this is by creating a typedef for materialProgress. That tells our compiler not to rename methods and properties belonging to that type. It has the added value of catching compile time errors, hinting to IDEs, and as Alex says, provides room for optimizations when the compiler gets smarter.



I don’t understand how HTMLDialogELement.as gets generated. Do you remember how you did this? Maybe we can add ProgressBar too, for the sake of providing an example.

________________________________
From: carlos.rovira@gmail.com <ca...@gmail.com> on behalf of Carlos Rovira <ca...@apache.org>
Sent: Monday, June 18, 2018 10:43:06 AM
To: dev@royale.apache.org
Subject: Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Hi Yishay,

 I planned MDL like a wrapper of existing JS/CSS MDL functionality. I found
in that way that I need Dialog polyfill so I added to typedefs.
Didn't need anymore at that time. So can you put some example of what you
propose in order to understand better the need of typedefs for raw mdl
components?
thanks

2018-06-18 7:54 GMT+02:00 Yishay Weiss <yi...@hotmail.com>:

> Out of curiosity, why are there no type defs for raw mdl components?
>
>
>
> ________________________________
> From: Alex Harui <ah...@adobe.com.INVALID>
> Sent: Monday, June 18, 2018 6:53:51 AM
> To: dev@royale.apache.org; commits@royale.apache.org
> Subject: Re: [royale-asjs] branch feature/revert-refactor updated: Fixes
> #261. Untyped members need to be surrounded with quotes.
>
> FYI, IMO, the recommended practice is to not have untyped members and
> create types if needed.  But this is for MDL, so doesn't really matter.
>
> My reasoning is that it will always help future optimizers and runtimes to
> know the types of everything.
>
> My 2 cents,
> -Alex
>
> On 6/17/18, 3:43 AM, "yishayw@apache.org" <yi...@apache.org> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     yishayw pushed a commit to branch feature/revert-refactor
>     in repository https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-
> asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cd77275bd67964759a70908d5d43f
> 1b91%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%
> 7C636648289868136910&sdata=OX9Bv6x8tofEiFP4CL618YzO8flAxb
> Thhkdk13pZ3RQ%3D&reserved=0
>
>
>     The following commit(s) were added to refs/heads/feature/revert-refactor
> by this push:
>          new c1f20f3  Fixes #261. Untyped members need to be surrounded
> with quotes.
>     c1f20f3 is described below
>
>     commit c1f20f30eeddf4aec20894f5326ec1d188b729c0
>     Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
>     AuthorDate: Sun Jun 17 13:42:50 2018 +0300
>
>         Fixes #261. Untyped members need to be surrounded with quotes.
>     ---
>      .../src/main/royale/org/apache/royale/mdl/ProgressBar.as
>   | 4 ++--
>      1 file changed, 2 insertions(+), 2 deletions(-)
>
>     diff --git a/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as b/frameworks/projects/
> MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
>     index 8dbaa23..820a9f5 100644
>     --- a/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as
>     +++ b/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as
>     @@ -149,7 +149,7 @@ package org.apache.royale.mdl
>              {
>                  if (materialProgress && !_indeterminate)
>                  {
>     -                materialProgress.setProgress(value);
>     +                materialProgress["setProgress"](value);
>                  }
>              }
>
>     @@ -171,7 +171,7 @@ package org.apache.royale.mdl
>              {
>                  if (!event.currentTarget) return;
>
>     -            materialProgress = event.currentTarget.MaterialProgress;
>     +            materialProgress = event.currentTarget["
> MaterialProgress"];
>
>                  setCurrentProgress(_currentProgress);
>                  setCurrentBuffer(_currentBuffer);
>
>     --
>     To stop receiving notification emails like this one, please contact
>     yishayw@apache.org.
>
>
>


--
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by Carlos Rovira <ca...@apache.org>.
Hi Yishay,

 I planned MDL like a wrapper of existing JS/CSS MDL functionality. I found
in that way that I need Dialog polyfill so I added to typedefs.
Didn't need anymore at that time. So can you put some example of what you
propose in order to understand better the need of typedefs for raw mdl
components?
thanks

2018-06-18 7:54 GMT+02:00 Yishay Weiss <yi...@hotmail.com>:

> Out of curiosity, why are there no type defs for raw mdl components?
>
>
>
> ________________________________
> From: Alex Harui <ah...@adobe.com.INVALID>
> Sent: Monday, June 18, 2018 6:53:51 AM
> To: dev@royale.apache.org; commits@royale.apache.org
> Subject: Re: [royale-asjs] branch feature/revert-refactor updated: Fixes
> #261. Untyped members need to be surrounded with quotes.
>
> FYI, IMO, the recommended practice is to not have untyped members and
> create types if needed.  But this is for MDL, so doesn't really matter.
>
> My reasoning is that it will always help future optimizers and runtimes to
> know the types of everything.
>
> My 2 cents,
> -Alex
>
> On 6/17/18, 3:43 AM, "yishayw@apache.org" <yi...@apache.org> wrote:
>
>     This is an automated email from the ASF dual-hosted git repository.
>
>     yishayw pushed a commit to branch feature/revert-refactor
>     in repository https://na01.safelinks.protection.outlook.com/?url=
> https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-
> asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cd77275bd67964759a70908d5d43f
> 1b91%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%
> 7C636648289868136910&sdata=OX9Bv6x8tofEiFP4CL618YzO8flAxb
> Thhkdk13pZ3RQ%3D&reserved=0
>
>
>     The following commit(s) were added to refs/heads/feature/revert-refactor
> by this push:
>          new c1f20f3  Fixes #261. Untyped members need to be surrounded
> with quotes.
>     c1f20f3 is described below
>
>     commit c1f20f30eeddf4aec20894f5326ec1d188b729c0
>     Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
>     AuthorDate: Sun Jun 17 13:42:50 2018 +0300
>
>         Fixes #261. Untyped members need to be surrounded with quotes.
>     ---
>      .../src/main/royale/org/apache/royale/mdl/ProgressBar.as
>   | 4 ++--
>      1 file changed, 2 insertions(+), 2 deletions(-)
>
>     diff --git a/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as b/frameworks/projects/
> MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
>     index 8dbaa23..820a9f5 100644
>     --- a/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as
>     +++ b/frameworks/projects/MaterialDesignLite/src/main/
> royale/org/apache/royale/mdl/ProgressBar.as
>     @@ -149,7 +149,7 @@ package org.apache.royale.mdl
>              {
>                  if (materialProgress && !_indeterminate)
>                  {
>     -                materialProgress.setProgress(value);
>     +                materialProgress["setProgress"](value);
>                  }
>              }
>
>     @@ -171,7 +171,7 @@ package org.apache.royale.mdl
>              {
>                  if (!event.currentTarget) return;
>
>     -            materialProgress = event.currentTarget.MaterialProgress;
>     +            materialProgress = event.currentTarget["
> MaterialProgress"];
>
>                  setCurrentProgress(_currentProgress);
>                  setCurrentBuffer(_currentBuffer);
>
>     --
>     To stop receiving notification emails like this one, please contact
>     yishayw@apache.org.
>
>
>


-- 
Carlos Rovira
http://about.me/carlosrovira

Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by Alex Harui <ah...@adobe.com.INVALID>.

On 6/17/18, 10:54 PM, "Yishay Weiss" <yi...@hotmail.com> wrote:

    Out of curiosity, why are there no type defs for raw mdl components?
    
Don’t know.  Some JS frameworks are not strongly-typed so they don't lend themselves to having typedefs.

The only reason I mentioned this is because we have new folks contributing and I just wanted to mention what I think we want to use as a best practice for Basic/Express/Jewel.  MDL probably doesn't really matter.

-Alex  
    
    ________________________________
    From: Alex Harui <ah...@adobe.com.INVALID>
    Sent: Monday, June 18, 2018 6:53:51 AM
    To: dev@royale.apache.org; commits@royale.apache.org
    Subject: Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.
    
    FYI, IMO, the recommended practice is to not have untyped members and create types if needed.  But this is for MDL, so doesn't really matter.
    
    My reasoning is that it will always help future optimizers and runtimes to know the types of everything.
    
    My 2 cents,
    -Alex
    
    On 6/17/18, 3:43 AM, "yishayw@apache.org" <yi...@apache.org> wrote:
    
        This is an automated email from the ASF dual-hosted git repository.
    
        yishayw pushed a commit to branch feature/revert-refactor
        in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cd77275bd67964759a70908d5d43f1b91%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636648289868136910&sdata=OX9Bv6x8tofEiFP4CL618YzO8flAxbThhkdk13pZ3RQ%3D&reserved=0
    
    
        The following commit(s) were added to refs/heads/feature/revert-refactor by this push:
             new c1f20f3  Fixes #261. Untyped members need to be surrounded with quotes.
        c1f20f3 is described below
    
        commit c1f20f30eeddf4aec20894f5326ec1d188b729c0
        Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
        AuthorDate: Sun Jun 17 13:42:50 2018 +0300
    
            Fixes #261. Untyped members need to be surrounded with quotes.
        ---
         .../src/main/royale/org/apache/royale/mdl/ProgressBar.as              | 4 ++--
         1 file changed, 2 insertions(+), 2 deletions(-)
    
        diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
        index 8dbaa23..820a9f5 100644
        --- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
        +++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
        @@ -149,7 +149,7 @@ package org.apache.royale.mdl
                 {
                     if (materialProgress && !_indeterminate)
                     {
        -                materialProgress.setProgress(value);
        +                materialProgress["setProgress"](value);
                     }
                 }
    
        @@ -171,7 +171,7 @@ package org.apache.royale.mdl
                 {
                     if (!event.currentTarget) return;
    
        -            materialProgress = event.currentTarget.MaterialProgress;
        +            materialProgress = event.currentTarget["MaterialProgress"];
    
                     setCurrentProgress(_currentProgress);
                     setCurrentBuffer(_currentBuffer);
    
        --
        To stop receiving notification emails like this one, please contact
        yishayw@apache.org.
    
    
    


RE: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

Posted by Yishay Weiss <yi...@hotmail.com>.
Out of curiosity, why are there no type defs for raw mdl components?



________________________________
From: Alex Harui <ah...@adobe.com.INVALID>
Sent: Monday, June 18, 2018 6:53:51 AM
To: dev@royale.apache.org; commits@royale.apache.org
Subject: Re: [royale-asjs] branch feature/revert-refactor updated: Fixes #261. Untyped members need to be surrounded with quotes.

FYI, IMO, the recommended practice is to not have untyped members and create types if needed.  But this is for MDL, so doesn't really matter.

My reasoning is that it will always help future optimizers and runtimes to know the types of everything.

My 2 cents,
-Alex

On 6/17/18, 3:43 AM, "yishayw@apache.org" <yi...@apache.org> wrote:

    This is an automated email from the ASF dual-hosted git repository.

    yishayw pushed a commit to branch feature/revert-refactor
    in repository https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7Cd77275bd67964759a70908d5d43f1b91%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C636648289868136910&sdata=OX9Bv6x8tofEiFP4CL618YzO8flAxbThhkdk13pZ3RQ%3D&reserved=0


    The following commit(s) were added to refs/heads/feature/revert-refactor by this push:
         new c1f20f3  Fixes #261. Untyped members need to be surrounded with quotes.
    c1f20f3 is described below

    commit c1f20f30eeddf4aec20894f5326ec1d188b729c0
    Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
    AuthorDate: Sun Jun 17 13:42:50 2018 +0300

        Fixes #261. Untyped members need to be surrounded with quotes.
    ---
     .../src/main/royale/org/apache/royale/mdl/ProgressBar.as              | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    index 8dbaa23..820a9f5 100644
    --- a/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    +++ b/frameworks/projects/MaterialDesignLite/src/main/royale/org/apache/royale/mdl/ProgressBar.as
    @@ -149,7 +149,7 @@ package org.apache.royale.mdl
             {
                 if (materialProgress && !_indeterminate)
                 {
    -                materialProgress.setProgress(value);
    +                materialProgress["setProgress"](value);
                 }
             }

    @@ -171,7 +171,7 @@ package org.apache.royale.mdl
             {
                 if (!event.currentTarget) return;

    -            materialProgress = event.currentTarget.MaterialProgress;
    +            materialProgress = event.currentTarget["MaterialProgress"];

                 setCurrentProgress(_currentProgress);
                 setCurrentBuffer(_currentBuffer);

    --
    To stop receiving notification emails like this one, please contact
    yishayw@apache.org.