Is it possible to build an AngularJS App without using multiple files - angularjs

I was wondering if it is possible to build an AngularJS app in a single file versus having multiple .js files.

During developing having one file makes no sense, cause it is very hard to support such code. For production you can use special tools, so user will see only one js file. This is done for angular itself -- you can find angular source to contain plenty of files, while when you include angular in project you include just one angular-XXX.js file.

Related

qooxdoo: How to handle non build time plugins?

Given the case that you have a basic GUI that must be extensible by plugins not known when the generate run of the main GUI is done. Contributable plugins may consist of some manifest, resources, localization, some code that is executable in the GUI environment and can provide custom widgets.
From what I see in the moment, it could be done by
Let a plugin developer build against the ordinary source, generating a part for the plugin. Then manually register a qx.io.part.Part with the generated parts to the GUI running on the non developer side.
Just load a combined source JS for that plugin, containing the resources and load them manually via eval.
I'd personally prefere the first one, as it already includes everything that might be used by a plugin. But it uses a method that is marked as internal.
Are there any experiences with that? Are there other, more elegant ways to achieve that?

Splitting Go App Into Multiple Files for GoLang

I am using the GoLang version of the Go Application Engine to run my website. Mostly for learning.
I am at a point where I want to write multiple Go Service endpoints to support the site (mostly on the admin side). I would like to separate these so that not everything is in the same file (for maintenance sake), but cannot seem to get my head around this.
Is there a way to separate a GoApp in GoLang into multiple files to serve up and handle the incoming requests?
Ideally this would be a single interface style wrapper file that then calls into the more complex methods that are in their own files. I did think about putting the .go files by type into separate folders so that my YAML file could just route, but that does not seem as nice.
To summarize, in the simplest sense, Go automatically compiles .go files in the same folder when you execute go build.
Documentation: http://golang.org/doc/code.html

Improve TinyMCE performance in Angular app

I've set up tinyMCE in my angular application by using the latest (4.x) version of tinyMCe and the latest version of angular-ui/ui-tinymce (https://github.com/angular-ui/ui-tinymce).
All of the code is minified.
In my application I have multiple instances of tinyMCE on a page (up to three) and the application uses the angular routing mechanism.
Everything is set up correctly, the editors work (and each of them has their own configuration).
The problem I'm facing now is performance. Whenever I load a new page the tinyMCE instances recreate themselves even if they are already there (= in the dom)! Creating a tinyMCE editor takes some time (up to 3 seconds) The amount of text in it doesn't seem to matter much.
I've tried using tinyMCE's gzip compressor but I couldn't get it to work.
What actions can I take to improve the performance in my application?
If at all relevant: I'm using a Java backend and AngularJs version 1.2.16
How-to optimize initialization speed of TinyMCE
(Wanna see original article?)
Here are some actions to take to boost initialization/loading time of TinyMCE.
Use and install the TinyMCE Compressor.
This will bundle all JavaScript HTTP requests into one big request and also gzip compress them by 75%.
Enable the button_tile_map option (should be enabled by default).
This makes the icons load faster since multiple image requests are replaced with a few tilemap requests.
Compress other scripts using the custom scripts option inside the compressor.
There might be other third party scripts on the same page. These can be added to the compressor as well.
Disable plugins that you don't need.
Remember to both remove them from the tinyMCE.init and the tinyMCE_GZ.init calls.
There is currently no compressor for TinyMCE 4 for Java backend, unfortunatelly.
And as you've already said, all of the code is minified.
So the only thing I can advice: remove unused plugins and reduce a number of requests by concatenating multiple JS files into as few files as possible.

Is YUI Compressor useless for ExtJS app minification

My manager wants me to look into initially using YUI Compressor to minify our ExtJS 4.2 app.
So I wrote a python file to concatenate all my ExtJS app files into a single file, and then minify that one file with YUI Compressor.
But I get errors related to objects not found, because order matters with JavaScript.
So for an app with many files, with multiple developers adding new files, it seems questionable whether YUI Compressor can be effectively used to minify ExtJS apps.
Is this true, or am I missing something?
YUI Compressor is must-have tool in the deployment process because it reduces js and css files in about 40%.
In your case you should use YUI Compressor AFTER you compile your ExtJS app into one js file. This is not effective to compress dozens of tiny files before concatenating them.
Of course the order of files for concatenation matters. It is based on dependency requirements declared in each file (which is actually ExtJS class).
I was tired to use Sencha.cmd because it's huge, inconvenient to install on servers, hard to automate and integrate into deployment processes.
I developed my own tool Extapp which makes the ExtJS applications builds. It requires java jre environment to run jar file.
Extapp : https://github.com/liberborn/extapp
Using YUI is not useless, the problem lies with concatenating files without analyzing the dependencies between them.

Organizing multiple Composite WPF applications to share a single Shell

How can I organize multiple Composite WPF applications so that they share a single Shell project but populate their module catalogs from different App.config files?
I am writing a suite of applications using Composite Application Guidance for WPF. Each application's functionality is determined by the availability of different modules, which are listed in the Shell's App.config. By giving each application a different App.config, I can specify which modules each application may use.
However I would like to share a single Shell project between all of the applications for common look and feel. Initially I created a Solution for each application, added the Shell project, and then added the relevant modules. The problem is that the common Shell project only has one App.config file, and I cannot change it on a per-Solution basis.
Populating the catalog through code does not avoid this problem--there would still be application-specific code in the Shell that must somehow be activated by the Solution I am using.
What I decided to do was to treat the Shell as its own module. Each application has its own solution and project, which contain the individual App.config files. They also have their own Bootstrapper classes. The Bootstrapper in each application instantiates the Shell.
Apart from hard coding modules, and loading modules from the configuration, you can also load modules dynamically from a given directory.
So to set up different "apps" that all use the same shell, I'd create a batch file that copies the right modules for each app to separate folders, thus creating the different applications.
The Composite Guidance Library documentation has more on setting up your project to load modules dynamically from a directory.

Resources