You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by piotrz <pi...@gmail.com> on 2017/07/15 09:06:04 UTC

FlexJS MXML ids and classNames - FLEX-35310

Hi All,

I think one of the biggest fish which we should fry is currently issue with
duplication id. There need to be changes in compiler which seems to be for
someone who really know the code. I would like to get back to the discussion
and set up here some final decision. Let's have small vote cause we gather
enough ideas.

If I miss something or someone would like add more thoughts let it be, but
let's move with this forward.

Proposition 1: (Alex): Have "id" and "mxmlID". [1]
Proposition 2: (Yishay): Have "localId" [2] - similar to [1]
Proposition 3: (Alex): Additional idea where "localId" ("mxmlID") is
actually not set on an object, working like "includeIn" [3]
Proposition 4: (Josh): "id" will no longer set "id" in HTML, introduce new
property called "htmlID" or "globalID" [4]
Proposition 5: (Chris) [5]: Internal "id" based on parent components

[1] https://goo.gl/CBkST5
[2] https://goo.gl/C43Y4U
[3] https://goo.gl/2aFghn
[4] https://goo.gl/VTd25g
[5] https://goo.gl/8rDMPU

Thanks, 
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63276.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Hi Alex,

Ok for me personally that's not the problem. I will create that Bead as an
addition which helps with that bug.

Adding "localId" without touching "id" it can also satisfy my needs and
application which was touched by that problem.

I would be happy if other opinion appear on that issue.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63338.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Alex,

Issue #2 is fixed. As for the issue #1 I also don't know how code
intelligence is working - maybe Josh will see the post and shed some light
on that.

Thank you!
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63919.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I will have to do more investigation for #1.  I don't know if magic
properties are the responsibility of the compiler or the IDE's code
intelligence.

I just pushed a change for #2.  It should be using "_id" (with leading
underscore) instead of "id".

Thanks for catching that,
-Alex

On 8/17/17, 10:31 PM, "piotrz" <pi...@gmail.com> wrote:

>Hi Alex,
>
>Finally I have found cycle to look into your changes. I've used for tests
>example from jira.
>
>1) localId is not visible in code completion in Moonshine and Intellij -
>However everything is building fine. - SDK has been downloaded by
>installer.
>
><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>ex-development.2333347.n4.nabble.com%2Ffile%2Fn63903%2Fdouble_id_moonshine
>_view.png&data=02%7C01%7C%7C7aa8e81767134cc1493e08d4e5fabfce%7Cfa7b1b5a7b3
>4438794aed2c178decee1%7C0%7C0%7C636386312502891401&sdata=v1k44KkOoNyQPJcCU
>AOKWKONnw7acsIdN45JVrTnjxE%3D&reserved=0>
>
>2) Once I build project and look into generated HTML I see that localId
>has
>been transformated to "id". I think it shouldn't be like that. Am I
>understand it wrong ?
>
><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>ex-development.2333347.n4.nabble.com%2Ffile%2Fn63903%2Flocal_id.png&data=0
>2%7C01%7C%7C7aa8e81767134cc1493e08d4e5fabfce%7Cfa7b1b5a7b34438794aed2c178d
>ecee1%7C0%7C0%7C636386312502891401&sdata=sADvMFVGheLKLG59eJTs41nRNohYBF8jb
>eImPfC7GK0%3D&reserved=0>
>
>Thanks,
>Piotr
>
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-MXML-ids-and-classNames-tp543
>61p63903.html&data=02%7C01%7C%7C7aa8e81767134cc1493e08d4e5fabfce%7Cfa7b1b5
>a7b34438794aed2c178decee1%7C0%7C0%7C636386312502891401&sdata=c7l5kS5sQAUPl
>2fP0Xd7ICFg9ZqtgV3SEKnCLj2KVIM%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Hi Alex,

Finally I have found cycle to look into your changes. I've used for tests
example from jira. 

1) localId is not visible in code completion in Moonshine and Intellij -
However everything is building fine. - SDK has been downloaded by installer.

<http://apache-flex-development.2333347.n4.nabble.com/file/n63903/double_id_moonshine_view.png> 

2) Once I build project and look into generated HTML I see that localId has
been transformated to "id". I think it shouldn't be like that. Am I
understand it wrong ?

<http://apache-flex-development.2333347.n4.nabble.com/file/n63903/local_id.png> 

Thanks,
Piotr




-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63903.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by Alex Harui <ah...@adobe.com.INVALID>.
I pushed some code that tries to implement a "localId" property.  It
seemed to work in a simple test.

-Alex

On 8/3/17, 10:58 AM, "piotrz" <pi...@gmail.com> wrote:

>Hi All,
>
>This issue started to be real blocker for my client's application. If we
>could ask anyone from compiler sight to try to work on that it would be
>awesome and simply help with farther development those app in FlexJS. [1]
>
>I think option where we are going with "localID" is ok to me. Alex mention
>in the email that whoever will be looking into that should check how is
>handled "id" and do similar things with "localID". The changes should be
>done in MXMLClassDIrectiveProcessor, MXMLFlexJSEmitter and probably would
>be
>involved MXMLDataInterpreter in AS code.
>
>I will probably start to learn compiler things, but will be on vacation
>next
>week and this become really urgent.
>
>[1] 
>https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fissues.ap
>ache.org%2Fjira%2Fbrowse%2FFLEX-35310&data=02%7C01%7C%7C0ba51e4cc695440140
>1408d4da9954a7%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C63637379948191
>6198&sdata=nW3No1ZzOoi%2FgcJzzt6mQ7XO5FLC5FkUOtcHwuCib0k%3D&reserved=0
>
>Thank you,
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-MXML-ids-and-classNames-tp543
>61p63688.html&data=02%7C01%7C%7C0ba51e4cc6954401401408d4da9954a7%7Cfa7b1b5
>a7b34438794aed2c178decee1%7C0%7C0%7C636373799481916198&sdata=fNdhk1Gbe%2Bu
>cFwizioCJz114fRCaN%2B0PN88S1REUNzg%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Hi All,

This issue started to be real blocker for my client's application. If we
could ask anyone from compiler sight to try to work on that it would be
awesome and simply help with farther development those app in FlexJS. [1] 

I think option where we are going with "localID" is ok to me. Alex mention
in the email that whoever will be looking into that should check how is
handled "id" and do similar things with "localID". The changes should be
done in MXMLClassDIrectiveProcessor, MXMLFlexJSEmitter and probably would be
involved MXMLDataInterpreter in AS code.

I will probably start to learn compiler things, but will be on vacation next
week and this become really urgent.

[1] https://issues.apache.org/jira/browse/FLEX-35310

Thank you,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63688.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

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

I still don't think the compiler can tell if you will be using an id more
than once.  At least not with a lot of flow analysis and even then I think
we'd miss cases.

You should be able to use the same id more than once.  You might be
removing the first view and replacing it with a different view and both
might have the same id.

IMO, the only warning must be done at runtime.  Feel free to create a
DuplicateIDCheckingBead that does that work.  I think it would replace the
UIBase id setter with a version that calls getElementById on the proposed
id.

My 2 cents,
-Alex

On 7/17/17, 3:20 AM, "piotrz" <pi...@gmail.com> wrote:

>Hi Alex,
>
>That's a valid point and I think I'm willing to change my vote to have
>localId. Let me understand fully this. If we introduce "localId" -
>
>- We will be able to have same id in different view - Introducing that new
>field is less time consuming than doing solution which I vote for ?
>- Compiler will shot us some warning if we have duplicate "id" ?
>
>Thanks,
>Piotr
>
>
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-MXML-ids-and-classNames-tp543
>61p63328.html&data=02%7C01%7C%7C8772b947ed204967a34408d4cd002f3c%7Cfa7b1b5
>a7b34438794aed2c178decee1%7C0%7C0%7C636358848070298436&sdata=18lcB0kmjhL1q
>64dKeWha7%2B96F%2F%2BtECazuFZ2X2F5AM%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Hi Alex,

That's a valid point and I think I'm willing to change my vote to have
localId. Let me understand fully this. If we introduce "localId" - 

- We will be able to have same id in different view - Introducing that new
field is less time consuming than doing solution which I vote for ?
- Compiler will shot us some warning if we have duplicate "id" ?

Thanks,
Piotr





-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63328.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by Alex Harui <ah...@adobe.com.INVALID>.
Well, it makes no sense to me to invent some new property name that sets
the "id" of an HTMLElement.  I would think we'd get a ton of questions
about it.  If I"m the only one who thinks that, then I'll stop arguing
against it.  I thought the consensus upthread was to add localId.

-Alex


On 7/16/17, 11:16 AM, "piotrz" <pi...@gmail.com> wrote:

>Josh,
>
>In general if I correct understand that was your idea. I think it is the
>simpler solution where we
>- Stop set up "id" to HTML id
>- Introduce new property which will set up it in html
>
>+1 for Josh's idea.
>
>Thanks,
>Piotr
>
>
>
>-----
>Apache Flex PMC
>piotrzarzycki21@gmail.com
>--
>View this message in context:
>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fle
>x-development.2333347.n4.nabble.com%2FFlexJS-MXML-ids-and-classNames-tp543
>61p63315.html&data=02%7C01%7C%7C93dc53d5c28f4e49156408d4cc7970af%7Cfa7b1b5
>a7b34438794aed2c178decee1%7C0%7C0%7C636358269329946292&sdata=APogtmBEyf0%2
>BbZVWxl5H%2B%2BT65fTWXDS%2Fys9Ph3aQUmU%3D&reserved=0
>Sent from the Apache Flex Development mailing list archive at Nabble.com.


Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by piotrz <pi...@gmail.com>.
Josh,

In general if I correct understand that was your idea. I think it is the
simpler solution where we 
- Stop set up "id" to HTML id
- Introduce new property which will set up it in html

+1 for Josh's idea.

Thanks,
Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-classNames-tp54361p63315.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: FlexJS MXML ids and classNames - FLEX-35310

Posted by Josh Tynjala <jo...@gmail.com>.
If we change the behavior of id in MXML, there needs to be a way to force
the compiler to make id behave the old way. The compiler is used for more
than just compiling FlexJS. For instance, it is used in my VSCode
extension, where it provides code intelligence for MXML with the classic
Flex SDK and the Feathers SDK. In those cases, id must create a property on
the existing class, as it always has, and it cannot be replaced by a
different property for the same purpose.

- Josh

On Jul 15, 2017 2:25 AM, "piotrz" <pi...@gmail.com> wrote:

> Hi All,
>
> I think one of the biggest fish which we should fry is currently issue with
> duplication id. There need to be changes in compiler which seems to be for
> someone who really know the code. I would like to get back to the
> discussion
> and set up here some final decision. Let's have small vote cause we gather
> enough ideas.
>
> If I miss something or someone would like add more thoughts let it be, but
> let's move with this forward.
>
> Proposition 1: (Alex): Have "id" and "mxmlID". [1]
> Proposition 2: (Yishay): Have "localId" [2] - similar to [1]
> Proposition 3: (Alex): Additional idea where "localId" ("mxmlID") is
> actually not set on an object, working like "includeIn" [3]
> Proposition 4: (Josh): "id" will no longer set "id" in HTML, introduce new
> property called "htmlID" or "globalID" [4]
> Proposition 5: (Chris) [5]: Internal "id" based on parent components
>
> [1] https://goo.gl/CBkST5
> [2] https://goo.gl/C43Y4U
> [3] https://goo.gl/2aFghn
> [4] https://goo.gl/VTd25g
> [5] https://goo.gl/8rDMPU
>
> Thanks,
> Piotr
>
>
>
> -----
> Apache Flex PMC
> piotrzarzycki21@gmail.com
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/FlexJS-MXML-ids-and-
> classNames-tp54361p63276.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>