React works by using a Shadow DOM and diffing the DOM to figure out if things need to change.
Angular works by running constant checks on the DOM and updating stuff as needed. I think simply wrapping DOM elements by JS ones has WAY less overhead than both of these approaches. Re. Events: I think MouseEvent does not inherit from Event because it inherits from Flash MouseEvent (being events are being subclassed rather than wrapped). The fact that MouseEvent on the JS side seems to be BrowserEvent instead, is just weird. We spent a very long time today on the fact that Mouse coordinates on transformed SVG elements were not working correctly. We have a partial solution to that, but fixing it “correctly” is a whole other topic. On Aug 19, 2016, at 12:30 AM, Alex Harui <[email protected]> wrote: > > > On 8/18/16, 1:34 PM, "Peter Ent" <[email protected]> wrote: > >> Just to play devil's advocate for moment, ReactJS duplicates the DOM for >> its own purposes and seems to do quite well. I know it has code in it to >> do optimization for what to redraw, making it more complex than just a >> duplicate tree structure. > > What do they get out of duplicating the DOM? > >> >> That said, reducing our overhead is a worthy goal and if it can be done >> without duplication that would be great. I guess a duplicate event system >> that really brings nothing else to the table would not be worth it if >> there were alternatives. > > Regarding events, at some point more research needs to be done. Maybe for > our purposes we can override event.target. But I still think this answer > requires us to first settle on whether we are wrapping DisplayObjects or > not. Duplicating Events in FlexJS would bring the API closer to what it > was in Flex, but there might be other ways, like a different property name > for target and generating different code to access it. > > We should also revisit and properly document the reason why MouseEvent is > not inheriting from Event. Maybe there is another solution there as well, > which would totally change the set of possible solutions. > > -Alex >
