Versions Compared

Key

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

...

FlexJS™ is the name for a next-generation Flex SDK 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.

...

The original motivation for FlexJS was the leveraging of existing Flex code bases. While Flash is expected to run in browsers that run on computers with traditional keyboards for years to come, existing Flex customers are finding that they want their applications to run in places that Flash/AIR will not run because some of their end users are now allowed to use devices like tablets as their only computer. The cost of migrating an application is high, and the risks around quality control are significant, especially when migrating to a less-strict language like JavaScript. A Connect presentation on FlexJS is available here .

However, as we've been working on FlexJS, it has become apparent that FlexJS should provide significant developer productivity gains for new projects as well.  Flex was popular because it made it easy and efficient to create robust applications.  Part of what made it easy and efficient was the Flash Player and AIR runtimes.  They had consistent behavior across browsers and desktop platforms.  But there were other things as well.  Flex provided:

...

In theory, any JavaScript that can be encapsulated and presented with a more strongly-typed API is a candidate for use by FlexJS. FlexJS will in turn make sure you use that API correctly, catching your mistakes sooner.  We have prototypes of applications that work with JQuery components.  FlexJS will have its own default set of UI widgets, but folks should be able to use just about any JavaScript UI framework if it can be wrapped in an ActionScript API.  FlexJS is less about the UI widgets and more about the productivity gains in using those widgets.

You can even write low-level JavaScript in ActionScript.  FlexJS provides a special library that contains class definitions for the built-in objects available to JavaScript in the browsers.  In other words, there are class definitions for HTMLElement, HTMLInputElement, and more.  By using these types in ActionScript and cross-compiling to JavaScript you will catch more errors sooner than you would just writing JavaScript.  In fact, all of the JavaScript code in the FlexJS UI libraries is written in ActionScript and cross-compiled.

The advantages of using higher-level languages should not be news:  it is why Dart and TypeScript and other languages are often used to write JavaScript apps.  What FlexJS also provides is the option to use a declarative language (MXML) as well.  In theory, any JavaScript UI Library could add support for MXML in the future.  But as of this writing, the FlexJS UI libraries are the only ones that support a declarative language and a semi-structure language from a single supplier.

How It Works

FlexJS application development (as opposed to framework component development) is based on the concept of parallel frameworks. The framework components will have both an AS and JS version, and a next-generation compiler knowns as Falcon will translate are written in ActionScript with conditional compilation for SWF-specific or JS-specific code.  An ActionScript and MXML compiler code-named "FalconJX" translates MXML and AS to JS and link links in JS "classes" instead of AS classes to create the JS output.

...