Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Welcome, Guest. Please login or register.
October 19, 2017, 08:03:22 PM
Home Help Search Login Register
News: Please DM @puremvc on Twitter to gain forum access. Spambots are why we can't have nice things.
Pages: [1] 2
Print
Author Topic: FlexJS version of MultiCore PureMVC  (Read 3596 times)
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« on: March 20, 2017, 01:48:23 PM »

Hi Cliff,

My names is Piotr Zarzycki and I am one of the PMC member of Apache Flex project. With the Team we are working on next generation Flex framework FlexJS. [1] One of our users Prashant created interesting demo when he was able to use MultiCore version of PureMVC to build application. He basically creates from sources of MultiCore PureMVC swc using FlexJS compiler. [2] (swc is in bin folder)

I like his demo cause it's simply showing that we are able to use PureMVC to build FlexJS applications. I would like to put this demo in our examples - make it available for each user who would like to use FlexJS.

We are building our examples and framework itself using Ant or Maven. I would like to prepare Prashant's demo to be buildable by Maven and make FlexJS version of PureMVC downloadable from Maven central.

- Would it be possible to put our FlexJS version of PureMVC.swc in maven central ?

[1] https://cwiki.apache.org/confluence/display/FLEX/FlexJS
[2] https://www.dropbox.com/s/2h2cdfyje5lojlh/PureMVC.zip

Thank you in advance,
Piotr
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #1 on: April 06, 2017, 03:25:30 PM »

Hi Piotr,

Sounds cool. Is there a repo where I can look at the code, and/or a running demo where we can see the demo running? I'd like to see the source code and understand more about how it works.

I'm glad to hear that the FlexJS work is continuing and that PureMVC is working well with it. I'm excited to hear more news from this realm!

Cheers,
-=Cliff>
Logged
openoli
Full Member
***
Posts: 44


View Profile
« Reply #2 on: April 19, 2017, 12:30:00 AM »

This is the related "Flex Users List" thread:
http://apache-flex-users.2333346.n4.nabble.com/FlexJS-PureMVC-with-FlexJS-td14880.html

I've started to port the EmployeeAdmin demo to FlexJS a while ago, hope I'll have some free cycles and can pull myself to finish it soon ;-)

Olaf
Logged
openoli
Full Member
***
Posts: 44


View Profile
« Reply #3 on: April 19, 2017, 01:40:03 AM »

Cliff, if you'd like to check out FlexJS+PureMVC by yourself, it's pretty easy:

1) Download and install the FlexJS SDK and setup your favorite IDE [1]
    (It's recommended to install the nightly build, bugs are expected!)
2) Create a FlexJS example project. Take a look at [2] to get an idea of the basic FlexJS app structure.
    (The "model" and "controller" beads are optional)
3) Copy your awesome PureMVC AS3 lib source to your example project (or use the swc from previous link)
4) Implement your PureMVC actors as you are used to
5) Your InitialView of your example project could look like this:

Code:
<js:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:js="library://ns.apache.org/flexjs/basic"
width="100%" height="100%"
initComplete="onInitComplete()">
<fx:Script>
<![CDATA[
import core.as3.ApplicationFacade;

public var facade:ApplicationFacade  = ApplicationFacade.getInstance("MySuperCore");

private function onInitComplete():void {
facade.startup(this);
}
]]>
</fx:Script>

<js:Group width="800" height="600">
          ...
</js:Group>

</js:View>

6) Compile your project
    (The compiler creates a Flash version and a JS/HTML5 version)
7) Done, hope it works well ;-)

Some hints if you would like to port Flex code to FlexJS:
You have to remove all flex/flash dependencies from your AS3 code and you have to replace your mx/spark components by FlexJS components.
Remember the popular Flex ArrayCollection (mx.collections.ArrayCollection) is also part of the Flex framework and has to be replaced by e.g. the FlexJS ArrayList.
The FlexJS component sets are not yet as rich as Flex mx/spark but FlexJS makes great progress.
Thanks to some smart guys FlexJS has captured the MaterialLight lib [3] which is available in the nightly build.
This could also be helpful [4].

HTH,
Olaf

[1] https://cwiki.apache.org/confluence/display/FLEX/Getting+Started+With+FlexJS
[2] https://cwiki.apache.org/confluence/display/FLEX/Application+Structure
[3] https://getmdl.io/started/
[4] https://nextgenactionscript.com/
« Last Edit: April 19, 2017, 01:44:04 AM by openoli » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #4 on: April 25, 2017, 10:49:29 AM »

Hi Olaf,

Looks pretty familiar. Smiley

I'll give it a look see!

Cheers,
-=Cliff>
Logged
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« Reply #5 on: May 07, 2017, 04:08:06 AM »

Hi Cliff,

Prashant just put PureMVCDemo to github [1]. I've added for library and example part poms for maven build. I called maven artifact "FlexJSPureMVC" [2]. There is an apache license header, but we can change it - cause I don't know what put there.

I did example build for you that you don't have to do it on yourself - it is zipped target folder. [3] Simple go to target/javascript/bin/js-debug/index.html to run demo.

The question is where we should go from there? I would like to have demo part in Apache Flex project - that's something what Prashant is willing to do, but what's with code of PureMVC itself? Where we should put it ? How can we have artifacts on the maven central repository ?

[1] https://github.com/pkumar-ghub/ApacheFlexJSDemo
[2] https://github.com/pkumar-ghub/ApacheFlexJSDemo/blob/master/PureMVC/pom.xml
[3] https://1drv.ms/u/s!ApVpLyjpHDC2zVZ7eF7Uk_wQ2A53


Thank you,
Piotr
« Last Edit: May 07, 2017, 04:11:23 AM by piotrzarzycki » Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #6 on: May 09, 2017, 02:18:30 PM »

Hi Piotr,

You can include it directly in the project if you like. Or if you know how to add it to Maven, let me know. Is there a file that needs to be added or does the library just need to be uploaded?

Cheers,
-=Cliff>
Logged
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« Reply #7 on: May 21, 2017, 09:45:43 PM »

Hi Cliff,

I'm sorry for the delays in responses I was occupy by ApacheCon. Smiley I think I know what I need to do, but there are still some questions to you.

1) In order to have flexjspuremvc.swc in maven repository I will have to probably pass through some paper work in sonatype [1]
2) Ideally would be if you could get into your github - pure mvc code with my prepared pom.xml - it would be some variation of [2] - maybe something /puremvc-flexjs-as3-multicore-framework. If it's rather not possible I will fork your repo and will be holding on my own everything.

Let me know what do you think.

[1] http://central.sonatype.org/
[2] https://github.com/PureMVC/puremvc-as3-multicore-framework

Thanks,
Piotr
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #8 on: May 27, 2017, 02:56:04 PM »

Refresh me why the JavaScript port won't do? Your suggested title puremvc-flexjs-as3-multicore-framework triggered me, because the framework should really be tied to a language and not a framework.

Cheers,
-=Cliff>
Logged
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« Reply #9 on: May 29, 2017, 11:20:54 PM »

Cliff,

You mean why JavaScript version of PureMVC will not work for us - I think it can work, but using it in FlexJS Application will be in that way slightly different. It will require wrappers written in ActionScript around JS version of PureMVC. - Cause this version is not understandable by FlexJS compiler.

Let me explain how actually this swc will help.

Basically when I'm taking your code and build it through FlexJS compiler (FalconJX) each classes is transpiled from ActionScript to JavaScript. I have one to one code - inside "puremvc-flexjs-as3-multicore-framework" - Each AS class has mirror to JavaScript class.

Let say that I would like to write application in FlexJS - I'm writing it in ActionScript using ActionScript port of PureMVC, but in order to compile my app to JavaScript version by FalconJX compiler I need "puremvc-flexjs-as3-multicore-framework" swc.

Of course I could use during compilation your AS version of PureMVC and compiling it each time along with my app, but I wanted to avoid that having  "puremvc-flexjs-as3-multicore-framework" swc.

Ideally would be store this swc somewhere in public maven repository, but your statement that framework should be tied to language not a framework I have started to think that maybe that was a bad idea. I just wanted to have more automate flow for development.

Thoughts ?

Piotr
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #10 on: May 31, 2017, 12:31:46 PM »

So, the "puremvc-flexjs-as3-multicore-framework" swc actually contains both the AS and the JS in it?

-=Cilff>
Logged
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« Reply #11 on: June 05, 2017, 03:04:47 AM »

Basically yes. Thanks to this SWC you can compile your app to: SWF and JS.
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #12 on: June 05, 2017, 10:44:13 AM »

Ok, in that case, I suppose your proposed name will make sense. Are the tests ported and working?

-=Cliff>
Logged
piotrzarzycki
Jr. Member
**
Posts: 11


View Profile WWW Email
« Reply #13 on: June 05, 2017, 11:54:09 PM »

I'm sorry about that, but not sure what do you mean - Do you mean those tests ? [1]. If yes - No I didn't prepare pom for tests, but if the thing is to prepare build for those tests to FlexJS and make runnable in Live Test Runner I can try, but it would be a long road, cause I will have to prepare flexunit to this things more.

If those tests has any dependency to Flash, probably I will have to fork repository and also make some changes to the unit tests to handle SWF sight.

[1] https://github.com/PureMVC/puremvc-as3-multicore-unittests

Piotr
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW
« Reply #14 on: June 12, 2017, 11:03:59 AM »

There is no flash dependency. I understand if it's difficult to get the test runner going, but for a framework, it's difficult to gain adoption if there aren't unit tests with full coverage. I think it would be fine for you to make your combined AS/JS swc available in Maven, but it would be nice if you include a link to a page on the FlexJS site that explains the nature of the swc.

Cheers,
-=Cliff>
Logged
Pages: [1] 2
Print
Jump to: