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/10/30 14:24:04 UTC

inflate/deflate

I have a need for inflate and deflate (multiple needs actually).

There’s a number of javascript libraries which do this already. Probably the most widely accepted one is pako[1]. Pako is robust, but its size is not insignificant (45KB for inflate and deflate 27KB for deflate and 22KB for inflate).

Another option for just inflate is tiny-inflate[2]. While not as robust, it’s very small at 3KB before gzipping. The only issue I see with it is that it’s a port from the C tinyf library[3]. I’m not sure how compatible that is with Apache licensing.

I’m not sure whether to do an ActionScript port of one of these libraries, or just link to the original JS library. The advantage of linking is that it can be linked to a CDN to make downloads smaller. i.e.[4]

Is there a standardized way of integrating CDN links of JS libraries at output?

[1]https://github.com/nodeca/pako
[2]https://github.com/devongovett/tiny-inflate
[3]https://bitbucket.org/jibsen/tinf
[4]https://cdnjs.com/libraries/pako

Re: inflate/deflate

Posted by Carlos Rovira <ca...@codeoscopic.com>.
So cool. :)

You're working on a branch of the project? or maybe outside it? I think
this could be a great addition to FlexJS :)

2016-11-02 18:31 GMT+01:00 PKumar <pr...@gmail.com>:

> Currently i am trying to port amfjs library only, Porting the RemoteObject
> involves more tasks as having  ChannelSet,  Channel & Operation classes so
> i
> can pick it in future.
>
>
>
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/inflate-deflate-tp56108p56171.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



-- 

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: inflate/deflate

Posted by PKumar <pr...@gmail.com>.
Currently i am trying to port amfjs library only, Porting the RemoteObject
involves more tasks as having  ChannelSet,  Channel & Operation classes so i
can pick it in future.



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/inflate-deflate-tp56108p56171.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: inflate/deflate

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

very interested in your AMFJS integration. these means you have a working
port of AMFJS? Are you working/planing in RemoteObject port?
Could you share more about it?
thanks!

2016-10-31 16:58 GMT+01:00 PKumar <pr...@gmail.com>:

> I used <inject_html>  with my  custom custom  for AMFJS integration and it
> works ok. check below code:
>
> public class AMFJS
>         {
>
>                 /**
>                  * <inject_html>
>                  *
>                  * </inject_html>
>                  */
>                 public function AMFJS()
>                 {
>
>                 }
>
>                 public function sendAMFReq():void
>                 {
>                         COMPILE::JS
>                         {
>                                 var amfClient:Object = new ((window as
> Object).amf).Client("patientService",
> "http://localhost:8080/BlazeDS/messagebroker/amf");
>                                 var operation:Object = amfClient.invoke("
> patientService",
> "getPatientNames", []);
>                                 operation.then(onResult , onFault);
>                         }
>                 }
>
>                 private function onResult(res:Object):void
>                 {
>                         trace("Response =" + res);
>                 }
>
>                 private function onFault(err:Object):void
>                 {
>                         trace("Error=" + err);
>                 }
>         }
>
>
>
> --
> View this message in context: http://apache-flex-
> development.2333347.n4.nabble.com/inflate-deflate-tp56108p56135.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.
>



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

Re: inflate/deflate

Posted by PKumar <pr...@gmail.com>.
I used <inject_html>  with my  custom custom  for AMFJS integration and it
works ok. check below code:

public class AMFJS
	{
		
		/** 
		 * <inject_html>
		 * 	
		 * </inject_html>
		 */ 
		public function AMFJS()
		{
			
		}
		
		public function sendAMFReq():void
		{
			COMPILE::JS
			{
				var amfClient:Object = new ((window as
Object).amf).Client("patientService",
"http://localhost:8080/BlazeDS/messagebroker/amf");
				var operation:Object = amfClient.invoke("patientService",
"getPatientNames", []);
				operation.then(onResult , onFault);
			}
		}
		
		private function onResult(res:Object):void
		{
			trace("Response =" + res);
		}
		
		private function onFault(err:Object):void
		{
			trace("Error=" + err);
		}
	}



--
View this message in context: http://apache-flex-development.2333347.n4.nabble.com/inflate-deflate-tp56108p56135.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Re: inflate/deflate

Posted by Harbs <ha...@gmail.com>.
Good to know.

I’ll probably be trying it in the next few days.

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

> 
> 
> On 10/31/16, 8:02 AM, "Harbs" <ha...@gmail.com> wrote:
> 
>> <inject_html> is used in classes which subclass Application. How would it
>> work for classes which might be used in multiple locations in an app?
> 
> <inject_html> works for any class, not just Application.
> 
>> 
>> For example, if I want to implement a BinaryData.inflate() (in a subclass
>> or utility class) how could I use <inject_html> and be sure it will be
>> injected once and only once?
> 
> All .js files are examined for not just <inject_html> but also for
> circularities and goog.require dependencies.  We build a list as we
> examine all of these files and modify the output .html file.  Someone else
> just saw it work recently for non-Application classes.
> 
> -Alex
> 


Re: inflate/deflate

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

On 10/31/16, 8:02 AM, "Harbs" <ha...@gmail.com> wrote:

><inject_html> is used in classes which subclass Application. How would it
>work for classes which might be used in multiple locations in an app?

<inject_html> works for any class, not just Application.

>
>For example, if I want to implement a BinaryData.inflate() (in a subclass
>or utility class) how could I use <inject_html> and be sure it will be
>injected once and only once?

All .js files are examined for not just <inject_html> but also for
circularities and goog.require dependencies.  We build a list as we
examine all of these files and modify the output .html file.  Someone else
just saw it work recently for non-Application classes.

-Alex


Re: inflate/deflate

Posted by Harbs <ha...@gmail.com>.
<inject_html> is used in classes which subclass Application. How would it work for classes which might be used in multiple locations in an app?

For example, if I want to implement a BinaryData.inflate() (in a subclass or utility class) how could I use <inject_html> and be sure it will be injected once and only once?

On Oct 31, 2016, at 3:28 PM, Alex Harui <ah...@adobe.com> wrote:

> 
> 
> On 10/30/16, 7:24 AM, "Harbs" <ha...@gmail.com> wrote:
> 
>> 
>> I’m not sure whether to do an ActionScript port of one of these
>> libraries, or just link to the original JS library. The advantage of
>> linking is that it can be linked to a CDN to make downloads smaller.
>> i.e.[4]
>> 
>> Is there a standardized way of integrating CDN links of JS libraries at
>> output?
> 
> Unless you need something that ByteArray.compress can't do on the SWF
> side, might as well just link to the original.  The <inject_html>
> "directive" should work.  See how it is used in CreateJS and elsewhere.
> 
> HTH,
> -Alex
> 
> 


Re: inflate/deflate

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

On 10/30/16, 7:24 AM, "Harbs" <ha...@gmail.com> wrote:

>
>I’m not sure whether to do an ActionScript port of one of these
>libraries, or just link to the original JS library. The advantage of
>linking is that it can be linked to a CDN to make downloads smaller.
>i.e.[4]
>
>Is there a standardized way of integrating CDN links of JS libraries at
>output?

Unless you need something that ByteArray.compress can't do on the SWF
side, might as well just link to the original.  The <inject_html>
"directive" should work.  See how it is used in CreateJS and elsewhere.

HTH,
-Alex