-
Notifications
You must be signed in to change notification settings - Fork 52
This library requires Flex #9
Comments
@thegoldenmule |
That's not quite true. The [Bindable] metadata tag requires the Flex framework. |
[Bindable] metadata is only relevant to Flex, but its presence shouldn't prevent you from compiling without Flex. The AS3 compiler will just throw out any metadata dags it doesn't recognize. I'm using promise-as3 in an AS3-only project just fine, without any modifications. |
My concerns still remain--this library requires Flex, plain and simple. When I try to compile without linking to Flex, it chokes on both the Bindable tags and mx.rpc.AsynchToken. |
@thegoldenmule |
What AS3 compiler are you using that "chokes" on |
@patrick, |
@ThomasBurleson What I'm saying is that an AS3 compiler should be able to compile code containing any metadata notation without a fuss. Adding |
The [Bindable] metatag requires mx.binding.BindingManager. |
@thegoldenmule My understanding is that metadata is just annotation, nothing else. You could put anything you want inside of metadata brackets and compile it. From an AS3 language standpoint, no dependencies are ever implied by metadata. However, the compiler you're using may interpret the metadata and perform work. This is what the Flex compiler does, generating code that, among other things, requires You can still use the MXMLC compiler to compile this project and use it with an AS3-only project. Typically, the Flex framework is linked in as an external dependency, which means it won't add very much to the SWC size, except for the generated code for binding support. The SWC I've generated this way is about 14kb -- tiny. This SWC will not require the Flex framework to be used within an AS3-only project. |
What other compilers are there? Flash CS? |
There's the Flash CS compiler, the new ASC 2.0, Haxe and possibly others. I'm not suggesting MXMLC isn't fine, it was just for the sake of the argument. Point is, if you're already using MXMLC to compile your AS3 code, you can use this library as-is. The single dependency from the Flex framework, mx.rpc.AsyncToken, will be compiled in from the framework source, but will have a very small impact on the file size. |
The [Bindable] metadata is no longer used following the Promises/A+ compliant rewrite. (See #2.)
|
We could potentially compare the qualified class name against the String The other option that comes to mind would be conditional compilation, but I think only MXMLC supports that. |
COMPC also supports conditional compilation. I think that works well to solve this issue. See my commit above. |
I don't believe that conditional compilation is the best solution here - it forces those compilation arguments onto any project that chooses to use this library. Instead I'd prefer an opt-in (plugin) approach. I'll see what I can come up with. |
When compiled as a SWC (speaking of which, this library probably needs an Ant build script.. and versioning), this change should allow the library to be used in plain AS3 projects without pulling in Flex. As such, this issue can probably be closed. |
This issue is still open for now, as I'd like to restructure the project similarly to hamcrest-as3 and linkify-as3. This would include:
I welcome pull requests on any of these. |
I'd like to support this idea. |
possible fix for one point from CC-Archived#9
- the build.xml was originally created by @ThomasBurleson and modiefied by me - as I don't know how to get all the changes in from his fork ThomasBurleson/promise-as3 through all those git branches I just started from the current master and did what was suggested in CC-Archived#9 (comment)
promise-as3 is a misleading title for this project. Perhaps promise-flex is better? This library requires the Flex framework which a large number of projects do not use do to its massive overhead. Flex is not required for this project, why is it a dependency?
The text was updated successfully, but these errors were encountered: