Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

FlexJS Frequently Asked Questions (FAQ)

...

FlexJS is the next-generation Flex SDK that that has the goal of allowing applications developed in MXML and ActionScript to not only run in the Flash/AIR runtimes, but also to run natively in the browser without Flash, on mobile devices as a PhoneGap/Cordova application, and in embedded JS environments such as Chromium Embedded Framework used in the Adobe Common Extensibility Platform . FlexJS has the potential to allow your MXML and ActionScript code to run in even more places than Flash currently does.

Is FlexJS Backward Compatible With the Flex SDK?

The FlexJS framework will not be Unlike the Flex SDK, which tried to get you to use either the MX or Spark component set, FlexJS is being designed to support a wider variety of component sets.  Most of the development effort so far has focused on the "Basic" set, which is not 100% compatible with the current Flex SDK. Many  For the Basic component set, many implementation decisions will be decided by what will result in optimal JS output as well as what can be implemented in the short term in JS.

Work has started on trying to make a heavier, slower component set that more closely mimics the MX and/or Spark component set.  It still won't be 100% backward compatible because the JS runtimes don't support things like weak references, but should be much more compatible.  However, this is a huge undertaking.  Volunteers are definitely need to help on this component set.

However, the goal is definitely to try to utilize as much existing MXML and ActionScript in existing applications as possible, and leverage the knowledge base and skill sets of experienced Flex developers and even leverage the tools such as Adobe Flash Builder. If you have an application consisting of 10,000 lines of MXML and 100,000 lines of ActionScript, instead of having to rewrite each and every line directly to JS or to some other JS framework, you should be able to use FlexJS and rewrite significantly fewer lines to get this code to run without Flash. FlexJS will support "states", databinding, and CSS just like the current Flex SDK (with some limitations).

How much work will it be to switch from Flex to FlexJS?

A quick assessment of the how much work it will be to switch to FlexJS can be done by searching existing code for "import flash". Files that import classes from Flash packages are generally using APIs that will not be in early versions of FlexJS. Note that importing flash classes in MXML files is not required so finding use of low-level Flash APIs in MXML files is not practical. Some Flash classes are events which may be supported by FlexJS.

One way to think about the migration to FlexJS is to ask whether you would have had to rewrite it anyway. For example, the FlexJS compiler does not support E4X expressions. JS has no E4X equivalent, so you would have had to re-code E4X expressions whether you switched to FlexJS or some other JS framework. If possible there is no support at this time for Remote Object. If possible, switching to JSON is recommended as it is supported in both AS and JS.

Does FlexJS Support E4X?

Yes, E4X was recently added to FlexJS. You can find out more about it Using XML in FlexJS and E4X Observations.

What level of Browser support is required?

The plan is to support IE8 IE9 and later, and relatively recent versions of FireFox and Chrome and probably even Safari. Thus  Mobile browsers will work as well, enabling your FlexJS web apps to be used virtually anywhere, even on IOS devices.  Thus an HTML5-capable browser is not a requirement to use FlexJS. There may be different versions of the JS components that are HTML5-dependent that provide faster or smaller output if you can require HTML5 browsers for your target customers.

Can we use JS Frameworks like JQuery or Dojo?

There can be more than one JS version of a FlexJS componentAs mentioned above, FlexJS intends to support a wider range of component sets. There is already a prototype of a JS version of an Application class that includes the startup code for a JQuery app few components that leverage JQueryUI.  The Application class sets up JQuery and then the Button component wraps the JQuery Button. Thus it is possible to use MXML and AS to construct a JQuery application.

...

One unanswered concern at this time is about performance of the JS output. We won't know for sure until we get enough infrastructure working to run a large app, but the goal is for the JS framework Basic component set is for the JS code to be as low overhead as possible. If you were to migrate your app to JS either directly or via some other JS framework, you would most likely use some sort of object-oriented concepts in this app. When creating components for FlexJS we look at what those constructs might be and then translate them to AS classes thus keeping overhead lower than writing code that leverages Flash and then trying to translate it to JS. Thus, if there is a performance problem with the FlexJS output, it would likely have been the case even if you had used some other JS framework.

...

The current Flex SDK represents many years of development. There is no way a volunteer-based effort can quickly reproduce a next-generation of all of that code. Not all of it will be re-created in FlexJS as some APIs, especially XML/E4X APIs, will probably not translate well to JS. But under the hood, the new framework is designed to leverage incremental development. The most common APIs of the most popular UI controls will be developed first, then additional functionality will be added over time. How soon that happens depends on how many people get involved and contribute.

...

Participation in any form is encouraged and welcomed. To follow the development of FlexJS, please subscribe to the Apache Flex mailing list dev@flex.apache.org. This is a high traffic list that covers development of the current Flex SDK as well, but we try to mark all FlexJS discussion with the subject "FlexJS (legacy)".

Where do I get the source code?

...