You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Carlos Rovira <ca...@apache.org> on 2016/12/02 09:13:31 UTC

[FlexJS] dialog-polypfill third party JS

Hi,

I'm finding that MDL Dialog is based on dialog-polyfill:

https://github.com/GoogleChrome/dialog-polyfill
https://github.com/GoogleChrome/dialog-polyfill/blob/master/LICENSE

how should we manage this (taking account of the license)?

I could link as I'm doing with MDL to a hosted CDN here:
https://cdnjs.com/libraries/dialog-polyfill




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

Re: [FlexJS] dialog-polypfill third party JS

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

On 12/5/16, 12:34 AM, "Harbs" <ha...@gmail.com> wrote:

>
>On Dec 5, 2016, at 9:58 AM, Alex Harui <ah...@adobe.com> wrote:
>
>> 
>> 
>> On 12/4/16, 11:38 PM, "Harbs" <ha...@gmail.com> wrote:
>> 
>>> If this is code in the SDK, changing the URL in the generated HTML is
>>> painful.
>> 
>> I have not tried monkey-patching.  Does it not work?
>
>I’m not sure what you mean by monkey patching. (in this context)

The intent is for SWF monkey-patching to work the way it used to (put the
patched file in the source path).  JS monkey-patching is provided by
taking a copy of the output .JS file, placing it in the appropriate place
inside FLEXJS_HOME/frameworks/js/generated-sources and modifying it.  The
compiler should pull JS files from there before pulling JS files from the
SWCs.

>
>> Also, couldn't you just edit the output HTML?
>
>Sure. And that’s probably a good solution for deployment. But during
>development and debugging, the auto-generated HTML is very handy
>considering all the dependencies are automatically generated. Having to
>manually edit that every time your compile and debug is painful to say
>the least.

I would just set up a build script to do it.

-Alex


Re: [FlexJS] dialog-polypfill third party JS

Posted by Harbs <ha...@gmail.com>.
On Dec 5, 2016, at 9:58 AM, Alex Harui <ah...@adobe.com> wrote:

> 
> 
> On 12/4/16, 11:38 PM, "Harbs" <ha...@gmail.com> wrote:
> 
>> If this is code in the SDK, changing the URL in the generated HTML is
>> painful.
> 
> I have not tried monkey-patching.  Does it not work?

I’m not sure what you mean by monkey patching. (in this context)

> Also, couldn't you just edit the output HTML?

Sure. And that’s probably a good solution for deployment. But during development and debugging, the auto-generated HTML is very handy considering all the dependencies are automatically generated. Having to manually edit that every time your compile and debug is painful to say the least.


> -Alex
> 


Re: [FlexJS] dialog-polypfill third party JS

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

On 12/4/16, 11:38 PM, "Harbs" <ha...@gmail.com> wrote:

>If this is code in the SDK, changing the URL in the generated HTML is
>painful.

I have not tried monkey-patching.  Does it not work?
Also, couldn't you just edit the output HTML?

-Alex


Re: [FlexJS] dialog-polypfill third party JS

Posted by Harbs <ha...@gmail.com>.
If this is code in the SDK, changing the URL in the generated HTML is painful.

On Dec 5, 2016, at 8:45 AM, Alex Harui <ah...@adobe.com> wrote:

> 
> 
> On 12/4/16, 12:32 AM, "Harbs" <ha...@gmail.com> wrote:
> 
>> I started a compression class which uses pako. I have not yet committed
>> my code.
>> 
>> I’m including it like this:
>> 
>>       /**
>>        * FalconJX will inject html into the index.html file.  Surround
>> with
>>        * "inject_html" tag as follows:
>>        *
>>        * <inject_html>
>>        * <script
>> src="https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.3/pako.min.js"></scri
>> pt>
>>        * </inject_html>
>>        */
>> 
>> The client can always edit their HTML to load the file fro somewhere else
>> in case they don’t want to use the cdn.
>> 
>> One thing we might want to do would be to have a way to specify local
>> links to make it possible to debug these dependencies off-line.
> 
> Not sure what you mean.  Why not just download the file and change the URL
> to localhost?
> 
> -Alex
> 
>> 
>> On Dec 2, 2016, at 8:20 PM, Alex Harui <ah...@adobe.com> wrote:
>> 
>>>> interesting. Some example already set to see how to do this? something
>>>> already in place to take as example an make my own ?
>>> 
>>> We've not done this before, AFAIK.


Re: [FlexJS] dialog-polypfill third party JS

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

On 12/4/16, 12:32 AM, "Harbs" <ha...@gmail.com> wrote:

>I started a compression class which uses pako. I have not yet committed
>my code.
>
>I’m including it like this:
>
>        /**
>         * FalconJX will inject html into the index.html file.  Surround
>with
>         * "inject_html" tag as follows:
>         *
>         * <inject_html>
>         * <script
>src="https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.3/pako.min.js"></scri
>pt>
>         * </inject_html>
>         */
>
>The client can always edit their HTML to load the file fro somewhere else
>in case they don’t want to use the cdn.
>
>One thing we might want to do would be to have a way to specify local
>links to make it possible to debug these dependencies off-line.

Not sure what you mean.  Why not just download the file and change the URL
to localhost?

-Alex

>
>On Dec 2, 2016, at 8:20 PM, Alex Harui <ah...@adobe.com> wrote:
>
>>> interesting. Some example already set to see how to do this? something
>>> already in place to take as example an make my own ?
>> 
>> We've not done this before, AFAIK.
>


Re: [FlexJS] dialog-polypfill third party JS

Posted by Harbs <ha...@gmail.com>.
I started a compression class which uses pako. I have not yet committed my code.

I’m including it like this:

        /**
         * FalconJX will inject html into the index.html file.  Surround with
         * "inject_html" tag as follows:
         *
         * <inject_html>
         * <script src="https://cdnjs.cloudflare.com/ajax/libs/pako/1.0.3/pako.min.js"></script>
         * </inject_html>
         */

The client can always edit their HTML to load the file fro somewhere else in case they don’t want to use the cdn.

One thing we might want to do would be to have a way to specify local links to make it possible to debug these dependencies off-line.

On Dec 2, 2016, at 8:20 PM, Alex Harui <ah...@adobe.com> wrote:

>> interesting. Some example already set to see how to do this? something
>> already in place to take as example an make my own ?
> 
> We've not done this before, AFAIK.


Re: [FlexJS] dialog-polypfill third party JS

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

On 12/2/16, 9:59 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>>
>>
>> I'm not sure we have a way to manage random JS files in the tool chain.
>> JS files that use goog.provide can be included in a SWC and will be
>>copied
>> to the output folder by the compiler.  So you may want to consider
>>adding
>> some sort of goog.provide to that file.
>
>
>interesting. Some example already set to see how to do this? something
>already in place to take as example an make my own ?

We've not done this before, AFAIK.

>
>
>> Otherwise, folks will have to
>> manage it like any other asset.  The tool chain does support links to
>> random JS files via the inject_html directive.
>>
>
>so, gol.provide will be for bundle in swc...while inject_html will put the
>line in my index.html right?

Yep.

>
>
>>
>> Also, if this code can be called by other code in JS files being sent to
>> the Google Closure Compiler for minification/optimization, then an
>>externs
>> file for this file will need to be generated.
>>
>
>I think this is not the case. MDL talks about it as a "companion", so they
>provide some class css and  maybe js, but they suppose the dialog-polyfill
>is setup and in place. Right now externs are an obscure concept to me,
>where I could read about it and whats behind?

Google Closure Compiler docs contain information about externs.  Basically
it is a file format that describes which APIs should not be renamed by the
minifier because the files are loaded externally.  If the JS is not called
from any JS code we've written or compiled then you don't need an externs.
 Although it makes me wonder how any of that code gets called.

IMO, linking to it is simpler.  Folks can always download it and integrate
it into their html if they don't want to rely on the CDN.

-Alex


Re: [FlexJS] dialog-polypfill third party JS

Posted by Carlos Rovira <ca...@codeoscopic.com>.
>
>
> I'm not sure we have a way to manage random JS files in the tool chain.
> JS files that use goog.provide can be included in a SWC and will be copied
> to the output folder by the compiler.  So you may want to consider adding
> some sort of goog.provide to that file.


interesting. Some example already set to see how to do this? something
already in place to take as example an make my own ?


> Otherwise, folks will have to
> manage it like any other asset.  The tool chain does support links to
> random JS files via the inject_html directive.
>

so, gol.provide will be for bundle in swc...while inject_html will put the
line in my index.html right?


>
> Also, if this code can be called by other code in JS files being sent to
> the Google Closure Compiler for minification/optimization, then an externs
> file for this file will need to be generated.
>

I think this is not the case. MDL talks about it as a "companion", so they
provide some class css and  maybe js, but they suppose the dialog-polyfill
is setup and in place. Right now externs are an obscure concept to me,
where I could read about it and whats behind?



-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] dialog-polypfill third party JS

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

On 12/2/16, 4:02 AM, "carlos.rovira@gmail.com on behalf of Carlos Rovira"
<carlos.rovira@gmail.com on behalf of carlos.rovira@codeoscopic.com> wrote:

>Ok, so as we can add to our project, I will upload. I think is more safe.

I'm not sure we have a way to manage random JS files in the tool chain.
JS files that use goog.provide can be included in a SWC and will be copied
to the output folder by the compiler.  So you may want to consider adding
some sort of goog.provide to that file.  Otherwise, folks will have to
manage it like any other asset.  The tool chain does support links to
random JS files via the inject_html directive.

Also, if this code can be called by other code in JS files being sent to
the Google Closure Compiler for minification/optimization, then an externs
file for this file will need to be generated.

-Alex


Re: [FlexJS] dialog-polypfill third party JS

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Ok, so as we can add to our project, I will upload. I think is more safe.

Thanks Justin! :)

2016-12-02 12:08 GMT+01:00 Justin Mclean <ju...@classsoftware.com>:

> Hi,
>
> > so this mean I can bundle (upload to our project *git*)
>
> You only need to do that if i'st bundled in the release.
>
> > or better link to CDN JS (don't know reliability of this)
>
> If you do this then it's not bundled so there no need to do anything to
> LICENSE. The downside as you say the CDN may not be 100% up all the time or
> it may change location over time.
>
> Thanks,
> jJustin




-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] dialog-polypfill third party JS

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> so this mean I can bundle (upload to our project *git*)

You only need to do that if i'st bundled in the release.

> or better link to CDN JS (don't know reliability of this)

If you do this then it's not bundled so there no need to do anything to LICENSE. The downside as you say the CDN may not be 100% up all the time or it may change location over time.

Thanks,
jJustin

Re: [FlexJS] dialog-polypfill third party JS

Posted by Carlos Rovira <ca...@codeoscopic.com>.
Thanks Justin,
so this mean I can bundle (upload to our project *git*) or better link to
CDN JS (don't know reliability of this)



2016-12-02 11:28 GMT+01:00 Justin Mclean <ju...@classsoftware.com>:

> Hi,
>
> > I'm finding that MDL Dialog is based on dialog-polyfill:
> >
> > https://github.com/GoogleChrome/dialog-polyfill
> > https://github.com/GoogleChrome/dialog-polyfill/blob/master/LICENSE
> >
> > how should we manage this (taking account of the license)?
>
> It’s 3 clause BSD which is compatible, recommended way is to a short
> pointer to the full text of the license in our LICENSE file. [1]
>
> Thanks,
> Justin
>
> 1. http://www.apache.org/dev/licensing-howto.html#permissive-deps




-- 

Carlos Rovira
Director General
M: +34 607 22 60 05
http://www.codeoscopic.com
http://www.avant2.es

Este mensaje se dirige exclusivamente a su destinatario y puede contener
información privilegiada o confidencial. Si ha recibido este mensaje por
error, le rogamos que nos lo comunique inmediatamente por esta misma vía y
proceda a su destrucción.

De la vigente Ley Orgánica de Protección de Datos (15/1999), le comunicamos
que sus datos forman parte de un fichero cuyo responsable es CODEOSCOPIC
S.A. La finalidad de dicho tratamiento es facilitar la prestación del
servicio o información solicitados, teniendo usted derecho de acceso,
rectificación, cancelación y oposición de sus datos dirigiéndose a nuestras
oficinas c/ Paseo de la Habana 9-11, 28036, Madrid con la documentación
necesaria.

Re: [FlexJS] dialog-polypfill third party JS

Posted by Justin Mclean <ju...@classsoftware.com>.
Hi,

> I'm finding that MDL Dialog is based on dialog-polyfill:
> 
> https://github.com/GoogleChrome/dialog-polyfill
> https://github.com/GoogleChrome/dialog-polyfill/blob/master/LICENSE
> 
> how should we manage this (taking account of the license)?

It’s 3 clause BSD which is compatible, recommended way is to a short pointer to the full text of the license in our LICENSE file. [1]

Thanks,
Justin

1. http://www.apache.org/dev/licensing-howto.html#permissive-deps