What is the architectural implementation of GRUI? - grui

I downloaded the Ext React components, but could not find more information about it.
How is it different from the ExtJS Grid?
How much KB does it consume?

Code specific to Ext JS Grid was cherry-picked, minified, modified, optimized, and written as a React-to-Ext JS connector that inputs the information passed using React and displayed in an Ext JS Grid. 
Basic components like Columns, Toolbars, Editors, were developed in React to make the React ecosystem consistent during consumption. 
The Ext JS (Grid) footprint was reduced from 1.8 MB to a mere 300 KB.

Related

How to avoid duplicate styles in angular 2 bundled CSS?

I was checking bundle sizes in a production build generated by a ng-cli based project. There are a couple of third-party NPM packages defining some angular 2 components and in their CSS styles they embed some data-URI encoded text. Just for completeness, in one case it's part of a custom #font-face{src:url(data:application/octet-stream;..., in another is part of a background-image:url(data:image/png;....
It occurred to me to notice that those large bits of styles, and actually entire chunks of CSS, are repeated twice in their bundles.
Q1: Is there a way to avoid repeating such CSS parts twice? Is that due to the way the library is being bundled by angular? Or due to the way the library is authored/built/...?
Q2: What are the guidelines for angular 2 component library authors on how to ship fonts and image assets? This is in case there's a better way and I can work with authors to change things.
TA

AngularJS With Multiple Components and CSS

As I become more familiar with Angular, and the vast number of modules out there for making an application really shine, I am also becoming overwhelmed at understanding the basic logic of CSS overloading, and how to manage the imports to get the desired behavior.
For instance, I have pulled the following libraries into my Angular application; Boostrap, Bootcards, boostrap-select, font-awesome, and some custom bootstrap-wizard libraries for a modal tab-based wizard.
All of these libraries require being defined in the index.html page of my Angular app (both the CSS files the JS files). How do you manage the desired behaviors so that one components styles don't override another components styles? What are the best practices around bringing in multiple components and using them in an Angular app, without negatively affecting the applications previous behaviors?
You have 3 choices:
Place more important CSS files AFTER less important ones so the more important override when both have same attribute names.
Manually go in stylesheet and change attribute names.
Instead of including the stylesheet in index, include it in your html file

Flex - Source Size vs. Compile Size

Could you explain why a Flash Builder source folder - no larger than 2 MB - compiles into a SWF exceeding 15 MB with debugging turned off (exported release build)?
There is only 1 embedded image at about 93k - no other images. The application is not that complicated, basically calls are made to a MySQL db to display information, as well as store information. I have used drop shadows and borders, but all standard to Flash Builder. Some custom classes and one custom skin.
Thank you...
Here is listing of the files:
.DS_Store
mx_4.5.1.21328.swz
Main.html
playerProductInstall.swf
Main.swf > 15 MB
rpc_4.5.1.21328.swz
amf_config.ini
services
assets
skins
charts_4.5.1.21328.swz
spark_4.5.1.21328.swz
framework_4.5.1.21328.swz
sparkskins_4.5.1.21328.swz
gateway.php
swfobject.js
history
textLayout_2.0.0.232.swz
This seems pretty large to me.
When you say "Debugging Turned Off" what does that mean? Did you export a release build? Or did you just press the "play" button to run your code instead of the "Debug" button?
Do you have the Flex Framework linkage type set to RSL (AKA External) or Merge into Code?
Are you using an external libraries (SWC)? A framework, such as RobotLegs or Swiz, could add to the size of the SWF; but will probably not be located in the source folder.
Well, well...thought I'd revisit this since I found the problem - a font in a css file with embed set to 'true'. This font wasn't even being used, so I removed it and the css file completely (not in use either). They probably got inserted way early in the project. Code now hovering around 1 MB and less than that for the export build. Hope this helps someone. Cheers!
Flex is a collection of ActionScript classes and components, so when you build an app based on Flex, some of these classes get embedded into your application.
Something as simple as a <s:Button means that the byte code of spark.components.Button has to be included into your application along with your custom code, it's not part of the runtime.

Setting up Flex / AIR project structure for a large number of images?

We build prototypes and demo applications in Flex 4.5.1 and AIR 2.7 for mobile and desktop use. These tend to involve a large number of full-screen .PNG files. Lately we have been looking at ways to segment our code for flexibility and multi-screen re-use.
What suggestions do people have for segmenting the project and libraries such that compile times are minimal and images are easy to replace?
A couple of strategies pop to mind:
Externalize the assets from in-line [Embed] statements, to using a CSS file.
Configure the CSS to compile as a seperate SWF, and load it at runtime. This should minimize the amount of PNG encoding the compiler is doing during your normal compilation process.
If that still doesn't speed it up enough (I've found that the incremental compiler sometimes gets mixed up and re-encoded the embedded assets, killing compiler speed), move the CSS files to a separate project altogether.
This option is preferable, as loading your images at runtime gives you better flexibility in your multi-screen projects.
Alternatively:
If using CSS isn't an option for some reason, move your [Embed]'s from your main project to a separate SWC project, and embed them on classes.
Add the swc as a dependant project
Reference the assets via the classes.
eg:
// assets-project/src/Images.as
public class Images {
[Embed('/assets/img/defaultAvatar.png')]
public static var defaultAvatar:Object;
}
// main-project/src/SomeView.mxml
<s:BitmapImage source="{Images.defaultAvatar"} />

Min. Flex Module size is ~30kb and contains Framework classes. How to remove them?

Compile the following module with all framework SWC-s excluded in release mode in Flex 4:
<mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"/>
The SWF size will be 35,658 bytes.
Now generate link report via -link-report for this SWF and load it via -load-externs. Size of the SWF now is 33.174 bytes.
If you check link report now, you will see that some framework classes like mx.modules:IModuleInfo or mx.utils:LoaderUtil are still there.
How to exclude them from SWF?
You are excluding framework SWCs by using RSLs, right?
If I had to guess, those classes are required by Modules and there is a reason for compiling them into the class. I'm sure Adobe was meticulous when creating RSLs and put a lot of thought into what should or should not be included in the main SWF.
I wonder why this is important, though. A 30K swf is really small.
The problem is that the standard components are not in the client runtime enviroment.
For example, in Flash with AS2 or AS3 if you use a ComboBox you have more than 20KB of overhead because the binaries for the component must be packed with your swf. This happend with Flex too. To make an small binary I used an small footprint library with the flash components, but this was for Flash AS2.
Good Luck.
I guess you have to dig through the link report. Find out which classes depend on mx.modules:IModuleInfo and mx.utils:LoaderUtil, and you're likely to understand how or why this happens.
It must be quite many classes, because the once mentioned including their dependencies have 6 KB raw and 2.8 KB optimized size.
greetz
back2dos

Resources