You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Harbs <ha...@gmail.com> on 2016/07/31 09:21:31 UTC

FlexJS Application

Right now a FlexJS Application is always being attached to the <body> tag and the width/size etc. is assumed to be the whole browser window.

This is problematic. There’s plenty of applications where the app is a specific part of a web page with a header, footer, navigation, etc.

Now, before someone tells me we can just always embed an application in an iframe, let me tell you that it’s not always an option. The biggest stumbling block is a major bug in iOS where the virtual keyboard is not available to apps within iframes. This caused me to give iOS special handling of an HTML app I wrote to use a div instead of an iframe.

I think we should add a “hostID” property to Application which Application would use to find the div it attaches itself to at startup. There should also be x,y,width,height and alpha properties on Application to get this info on the div. In fact, I think an Application should be an IUIBase.

I’ll be happy to make these changes, but I wanted to discuss this before I do.

Harbs

Re: FlexJS Application

Posted by Harbs <ha...@gmail.com>.
Here’s my thoughts.

As far as scripts go:

Currently, FlexJS is polluting the Global namespace with an awful lot of junk. Ideally, there should be a single global entry point and unless things are specifically attached to the window (or some other global), externally accessible variables and methods should go through a defined path.

To me it makes sense that the app would be a global object and everything else would be wrapped inside a scope. Application could have a “globals” object which could have properties and functions attached to it as necessary.

I’m not sure what modules would look like in FlexJS, but I think there should be a prescribed method for using modules rather than just sticking everything in globals to make it universally available. I think modules deserves its own discussion.

Templates are a good idea, but it’s not critical for me personally. In production, you’re generally going to have custom built HTML and for testing, I generally don’t need anything besides the actual app. There should probably be prescribed tags in the template where the FlexJS scripts go, as well as the initialization code.

I’m not sure making MXML the template makes so much sense, but maybe. I guess you could describe HTML snippets within the MXML structure.


On Jul 31, 2016, at 5:08 PM, Alex Harui <ah...@adobe.com> wrote:

> Good topic.  For sure, we don't want to require Iframe.
> 
> A related topic is Jude's suggestion to allow for different HTML Templates
> instead of the one that we currently generate.
> 
> Currently Application is sort of assuming it wraps everything.  IMO, there
> might be more than just a search for hostID required to have it be a part
> of the HTML especially if it has to co-exist with another FlexJS app in
> the same body.  Where do Scripts get injected, for example?
> 
> There is a vision for FlexJS where it "always" wraps everything and other
> HTML you might have put in your template is just in the MXML so the MXML
> serves as the template.
> 
> Before we make any changes here, I'd like to finish the
> Application/FactoryClass changes just to save on merge hassle.
> 
> Thoughts?
> -Alex
> 
> On 7/31/16, 2:21 AM, "Harbs" <ha...@gmail.com> wrote:
> 
>> Right now a FlexJS Application is always being attached to the <body> tag
>> and the width/size etc. is assumed to be the whole browser window.
>> 
>> This is problematic. There’s plenty of applications where the app is a
>> specific part of a web page with a header, footer, navigation, etc.
>> 
>> Now, before someone tells me we can just always embed an application in
>> an iframe, let me tell you that it’s not always an option. The biggest
>> stumbling block is a major bug in iOS where the virtual keyboard is not
>> available to apps within iframes. This caused me to give iOS special
>> handling of an HTML app I wrote to use a div instead of an iframe.
>> 
>> I think we should add a “hostID” property to Application which
>> Application would use to find the div it attaches itself to at startup.
>> There should also be x,y,width,height and alpha properties on Application
>> to get this info on the div. In fact, I think an Application should be an
>> IUIBase.
>> 
>> I’ll be happy to make these changes, but I wanted to discuss this before
>> I do.
>> 
>> Harbs
> 


Re: FlexJS Application

Posted by Alex Harui <ah...@adobe.com>.
Good topic.  For sure, we don't want to require Iframe.

A related topic is Jude's suggestion to allow for different HTML Templates
instead of the one that we currently generate.

Currently Application is sort of assuming it wraps everything.  IMO, there
might be more than just a search for hostID required to have it be a part
of the HTML especially if it has to co-exist with another FlexJS app in
the same body.  Where do Scripts get injected, for example?

There is a vision for FlexJS where it "always" wraps everything and other
HTML you might have put in your template is just in the MXML so the MXML
serves as the template.

Before we make any changes here, I'd like to finish the
Application/FactoryClass changes just to save on merge hassle.

Thoughts?
-Alex

On 7/31/16, 2:21 AM, "Harbs" <ha...@gmail.com> wrote:

>Right now a FlexJS Application is always being attached to the <body> tag
>and the width/size etc. is assumed to be the whole browser window.
>
>This is problematic. There’s plenty of applications where the app is a
>specific part of a web page with a header, footer, navigation, etc.
>
>Now, before someone tells me we can just always embed an application in
>an iframe, let me tell you that it’s not always an option. The biggest
>stumbling block is a major bug in iOS where the virtual keyboard is not
>available to apps within iframes. This caused me to give iOS special
>handling of an HTML app I wrote to use a div instead of an iframe.
>
>I think we should add a “hostID” property to Application which
>Application would use to find the div it attaches itself to at startup.
>There should also be x,y,width,height and alpha properties on Application
>to get this info on the div. In fact, I think an Application should be an
>IUIBase.
>
>I’ll be happy to make these changes, but I wanted to discuss this before
>I do.
>
>Harbs


Re: FlexJS Application

Posted by Alex Harui <ah...@adobe.com>.

On 7/31/16, 8:29 PM, "piotrz" <pi...@gmail.com> wrote:

>Hi Harbs,
>
>I think this functionality should be optional. Maybe it should be some
>kind
>of bead. Can it be?

Or maybe just a different application class "DivApplication" or something
like that.

-Alex


Re: FlexJS Application

Posted by piotrz <pi...@gmail.com>.
Hi Harbs,

I think this functionality should be optional. Maybe it should be some kind
of bead. Can it be? 

Piotr



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-Application-tp54275p54279.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.