royale-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] aharui commented on issue #343: Question : IS there a way to embed third party components within a Royale app
Date Sun, 11 Nov 2018 03:51:16 GMT
aharui commented on issue #343: Question : IS there a way to embed third party components within
a Royale app
URL: https://github.com/apache/royale-asjs/issues/343#issuecomment-437641623
 
 
   IUIBase source code (and all Apache Royale component source) is in ActionScript, but eventually
is transpiled to JS.  So, to have your JS code implement IUIBase, you would need to add the
equivalent JavaScript to your code or a subclass of it.  Or write the subclass in AS and have
it transpiled.  Methods are not checked right now, only classes, so it shouldn't be too hard.
   
   You can easily skip the SWF target.  MaterialDesignLite doesn't support a SWF target right
now.
   
   How you assemble a bunch of third-party components from different vendors in Royale depends
on how those components work and how you want to write your code.
   
   To use MXML, you need a certain amount of infrastructure, like an Application class that
supports certain APIs.
   
   Whether you use MXML or AS, if you want to use Royale containers and layouts then you need
the components to support IUIBase.
   
   Some 3rd-parties have interesting ways of instantiate components like creating HTML markup
and identifying it in the JS.   ActionScript is mainly built around using the "new" operator
and calling functions and so Royale has not invested in trying to find objects from HTML markup.
   
   So, to the extent that you can use little or no HTML and a pile of JavaScript to create
this app for your customer, you should be able to use AS instead of JS, and get the benefits
of compile-time type-checking (assuming you make the 3rd-party APIs strongly-typed via typedefs/externs).
   
   You could then just use MaterialDesignLite components instead of the Royale versions. 
But is that really "using Royale"?  You are just replacing JS with AS.   If you want Royale
containers and layout you need to implement IUIBase on those components, but you don't have
to worry about the SWF target.
   
   If someone has a huge Flex app using Flexicious Grid, the way to migrate them off of Flash
with the least changes to their code is to use the emulation components and present any 3rd-party
JS components as IUIComponents instead of IUIBase because the emulation components are purposefully
presenting a Flex-like API.  But again, you can do that without worrying about the SWF side
and in the end, there should be tons fewer lines of code to debug.  Their business logic should
be relatively untouched.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message