You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Alex Harui <ah...@adobe.com.INVALID> on 2019/08/16 00:36:50 UTC

File Handling (was Re: inject_html in the framework via rawgit)

Greg's email coincided with some other interesting file-handling issues that might be worth a discussion.

The issue I ran into was that the old MX RichTextEditor has some icon buttons.  In Flex, those buttons are embedded.  We are not (yet) supporting embedding in Royale, so the question is how to deliver the icon files into the user's bin/js-debug and bin/js-release output folders?

IMO, this is related to the rawgit issue in that inject_html users may want to control the URL that gets injected and want to specify a file in the output folder.

IMO, the basic question is:  how can you specify to the compiler a file to be included in the output folder?

It seems easy enough to pack more files into SWCs.  The compiler already has a capability for JS output to copy ALL of the files in a theme swc (a swc specified as a theme) into the output folder.  The problem with that is that it is ALL when you probably just want the files for a particular component.  I don't think I want to see per-component theme asset SWCs.

Now some folks may argue that this is not the job of the compiler at all.  Folks need to use build scripts/tools like Ant and Maven to grab files.  That is acceptable to me.  We could provide patterns to use in Ant and Maven to grab files from a SWC.

But if we decide to involve the compiler, then we have options.  The simplest is probably to allow -include-file COMPC syntax in MXMLC with some additional syntax to specify which SWC to look in.

More automated would be some metadata or css somewhere (even a @include_file directive like @inject_html) so the compiler will copy files needed by a class if a class is used in the output.

Thoughts?
-Alex

On 8/14/19, 6:47 PM, "Greg Dove" <gr...@gmail.com> wrote:

    "RawGit is now in a sunset phase and will soon shut down" [1]
    
    It just came to my attention today that some of the framework code uses
    script tag injections for rawgit urls, and I checked that service... it
    could be shut down as early as October 2019.
    This looks to only be used in MXRoyale and AceEditor.
    
    One of the uses seems to be for base64 encoding and decoding, which
    (hopefully) can be replaced with native browser functions, I think [2]
    
    For now, I am just highlighting this. I realize we are in release mode for
    0.96, but we probably want to ensure another release before too long with
    alternative script urls before that service drops out.
    
    1. https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frawgit.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7Cd5b77fe779684f45eb5d08d721228dba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637014304634757274&amp;sdata=PBow7tF5obtNnJZMEzXEOoVQ4A%2FYUBdj%2Fm8A73Zyf60%3D&amp;reserved=0
    2. https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcaniuse.com%2F%23feat%3Datob-btoa&amp;data=02%7C01%7Caharui%40adobe.com%7Cd5b77fe779684f45eb5d08d721228dba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637014304634757274&amp;sdata=Z%2FlbQ%2B5bsnm8bgOdJEmcYZNek5XCdkWAKPXruGbHCUk%3D&amp;reserved=0
    


Re: File Handling (was Re: inject_html in the framework via rawgit)

Posted by Carlos Rovira <ca...@apache.org>.
Hi Alex,

I had to fight with assets for Jewel. I ended solving it in Maven. This
approach could appear a bit cumbersome for our users since they need to
think how to deal with it, and they could say us: "hey! I'm using a SDK...I
should not need to spend time solving that, SDK should do it for me", and
that's in true, but as always, it's a matter of time, contribution, and so
on,..

If we give compiler capabilities my personal opinions are:

* It would be great that royale could be smart enough to just grab the
assets that are in use in the application and left the unused ones out, so
application will have only things to use.
* The other problem is about references to that assets, since if we have a
CSS file with lots of unused references that will be a real problem, since
people will be loading lots of things they does not need.

The typical case will be an example app with just a button and a text input
that brings all the icons from components like CheckBox or RadioButton (and
many others), but are not used.

Seems to me that some management *per component* should be good to have
only assets and references to those assets (that in the end is what makes
the difference since is what triggers the load for the user end) in the
final output.





El vie., 16 ago. 2019 a las 2:37, Alex Harui (<ah...@adobe.com.invalid>)
escribió:

> Greg's email coincided with some other interesting file-handling issues
> that might be worth a discussion.
>
> The issue I ran into was that the old MX RichTextEditor has some icon
> buttons.  In Flex, those buttons are embedded.  We are not (yet) supporting
> embedding in Royale, so the question is how to deliver the icon files into
> the user's bin/js-debug and bin/js-release output folders?
>
> IMO, this is related to the rawgit issue in that inject_html users may
> want to control the URL that gets injected and want to specify a file in
> the output folder.
>
> IMO, the basic question is:  how can you specify to the compiler a file to
> be included in the output folder?
>
> It seems easy enough to pack more files into SWCs.  The compiler already
> has a capability for JS output to copy ALL of the files in a theme swc (a
> swc specified as a theme) into the output folder.  The problem with that is
> that it is ALL when you probably just want the files for a particular
> component.  I don't think I want to see per-component theme asset SWCs.
>
> Now some folks may argue that this is not the job of the compiler at all.
> Folks need to use build scripts/tools like Ant and Maven to grab files.
> That is acceptable to me.  We could provide patterns to use in Ant and
> Maven to grab files from a SWC.
>
> But if we decide to involve the compiler, then we have options.  The
> simplest is probably to allow -include-file COMPC syntax in MXMLC with some
> additional syntax to specify which SWC to look in.
>
> More automated would be some metadata or css somewhere (even a
> @include_file directive like @inject_html) so the compiler will copy files
> needed by a class if a class is used in the output.
>
> Thoughts?
> -Alex
>
> On 8/14/19, 6:47 PM, "Greg Dove" <gr...@gmail.com> wrote:
>
>     "RawGit is now in a sunset phase and will soon shut down" [1]
>
>     It just came to my attention today that some of the framework code uses
>     script tag injections for rawgit urls, and I checked that service... it
>     could be shut down as early as October 2019.
>     This looks to only be used in MXRoyale and AceEditor.
>
>     One of the uses seems to be for base64 encoding and decoding, which
>     (hopefully) can be replaced with native browser functions, I think [2]
>
>     For now, I am just highlighting this. I realize we are in release mode
> for
>     0.96, but we probably want to ensure another release before too long
> with
>     alternative script urls before that service drops out.
>
>     1.
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Frawgit.com%2F&amp;data=02%7C01%7Caharui%40adobe.com%7Cd5b77fe779684f45eb5d08d721228dba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637014304634757274&amp;sdata=PBow7tF5obtNnJZMEzXEOoVQ4A%2FYUBdj%2Fm8A73Zyf60%3D&amp;reserved=0
>     2.
> https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcaniuse.com%2F%23feat%3Datob-btoa&amp;data=02%7C01%7Caharui%40adobe.com%7Cd5b77fe779684f45eb5d08d721228dba%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C1%7C637014304634757274&amp;sdata=Z%2FlbQ%2B5bsnm8bgOdJEmcYZNek5XCdkWAKPXruGbHCUk%3D&amp;reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira