Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port FlexJS #272

Open
devlfm opened this issue Mar 28, 2017 · 4 comments
Open

Port FlexJS #272

devlfm opened this issue Mar 28, 2017 · 4 comments

Comments

@devlfm
Copy link

devlfm commented Mar 28, 2017

Hi,

Great work out here! I'm starting to feel that if someday I'll convert my app from flash to html5 it would be with StageXL! I've been listening discussions list on FlexJS, and seems they are doing a pretty good job, but.. All I see on FlexJS is divs/spans, and that's what I don't want... I'm wonder if you think it would be good for StageXL to have a "swc" or some port, so pleople that use FlexSDK (falcon) could use your implementation of canvas/webgl?

Kind regards!

@bp74
Copy link
Owner

bp74 commented Mar 30, 2017

Hi, sorry for the late reply. Yes that would be an interesting project, but someone would need to invest a lot of time to build something like this. You may take a look at the rockdot framework (link below). This is a UI framework build on top of StageXL.

https://github.com/block-forest/rockdot-framework

@audioMirror
Copy link

Our product is developed on Flash and Flex, and we use FlexJS with a custom backend to compile to Dart and StageXL (with modifications to make StageXL almost exactly match the Flash API).

Unfortunately our pipeline is proprietary, so we can't share it. It does work great, but it took a lot of work to create, and I doubt anyone else will do the work that we did.

With Flash dying (though it is a great language), I would suggest just using StageXL as a first-class library, and coding to it directly.

@nilsdoehring
Copy link
Collaborator

@audioMirror a pity that you can't share the pipeline – having invested into writing a converter myself, I'd be interested in learning more about yours. Besides that, any chance you could share some info what exactly you're pushing through it? Anything out in the open? StageXL could use some testimonials :-)

@audioMirror
Copy link

audioMirror commented Jul 18, 2018

No, I can't share the pipeline, but I can give some idea of what we have done, and you can see how much work it would be:

  • Make changes to StageXL so that more APIs are standard Flash (i.e. Event classes, etc.). These included adding the exact AS3 Graphics APIs to StageXL.
  • Write compatibility functions for AS3 String and List functions, etc. Hand-write some Flash classes in Dart, such as ByteArray, Date, etc.
  • Write a Dart backend to the FlexJS parser, that automatically outputs calls to compatibility methods when necessary.
  • Hand-implement some Flash classes such as UrlStream, and AMF serialization/deserialization.
  • Run Flex source through the FlexJS Dart converter.
  • Hand-fix the Flex Dart output, as it relies on some framework things that don't exist. For instance, we support multiple Stage classes, can't load SWFs, etc. Throw away the Flex classes that we don't use, and will take too long to port.
  • Clean up our application's source code to not use certain problem syntax that our converter doesn't or can't check for (i.e. certain automatic runtime type conversions). Luckily most of these cause Dart compiler warnings if not fixed.

We use Dart Angular for some non-canvas areas of the product, but everything else is programmatic Flex (not scripting mxml, though that could've been parsed and ported too, with much more work). We have a single codebase, and it just works in both Flash, and Dart and StageXL.

The work described took over a year by me. When it was time to pull the trigger, our application guy went from zero to mostly working in one week. The alternative was a total rewrite. As is, our product is even more stable than with AS3 only, as two compilers and two environments notice flaws.

If StageXL didn't exist, I would've had to write it, so I am very grateful for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants