This is an automated email from the ASF dual-hosted git repository.
andreww pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-docs.git
The following commit(s) were added to refs/heads/develop by this push:
new 000658f Update production.md
000658f is described below
commit 000658f6d30aaa1a78cf4f394b760b3e06136d22
Author: Andrew Wetmore <[email protected]>
AuthorDate: Thu Feb 1 19:13:32 2018 -0400
Update production.md
Small changes, plus a link added.
---
.../application-tutorial/production.md | 23 ++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
diff --git a/create-an-application/application-tutorial/production.md
b/create-an-application/application-tutorial/production.md
index 6a3526a..9ca02f6 100644
--- a/create-an-application/application-tutorial/production.md
+++ b/create-an-application/application-tutorial/production.md
@@ -20,15 +20,17 @@ title: Making a production version
# Making a production version
-The version in the "js-debug" folder is considered a "debug version" or
"development version". If you looked at all of the files in the folder or
copied them to a web server, you probably noticed there are quite a few, and
each takes time to load.
+The version in the "js-debug" folder is considered a "debug version" or
"development version". If you looked at all of the files in the folder or
copied them to a web server, you probably noticed there are quite a few, and
that each takes time to load.
-These versions are designed to be more easily debugged. Each source file has
an equivalent .js file with nice readable variable and function names. If they
are small enough and fast enough, it is perfectly fine to deploy the
development version.
+These versions are designed to be more easily debugged. Each source file has
an equivalent .js file with nice, readable variable and function names. If the
files are small enough and fast enough, it is perfectly fine to deploy the
development version.
-A production version will combine just about all of the .js into a single .js
file, renaming variables and function names from things like "Application" to
just "aa". This is done using the Google Closure Compiler and the results are
easier to manage (fewer files to copy) and also should load faster (fewer
requests for files and smaller total file sizes).
+A production version will combine just about all of the .js into a single .js
file, renaming variables and function names from things like "Application" to
just "aa". This is done using the <a
href="https://developers.google.com/closure/compiler/" target="_blank">Google
Closure Compiler</a> and the results are easier to manage (fewer files to copy)
and also should load more quickly (because there are fewer requests for files
and smaller total file sizes).
-To create a production version, don't set debug=true. The compiler will still
produce the js-debug folder, but then will pass it to the Google Closure
Compiler that will generate a production or "release" version in a "js-release"
folder. The build process will take longer as the Google compiler crunches
through all of the files. There may be additional warnings, and hopefully, no
errors. If there is an error, then the production version will probably not
run.
+If you are using an IDE, it probably provides an option for creating a
production version. On the command line, to create a production version, don't
set debug=true. The compiler will still produce the js-debug folder, but it
then will pass it to the Google Closure Compiler that will generate a
production or "release" version in a "js-release" folder.
-So, create a production version by running:
+The build process will take longer as the Google compiler crunches through all
of the files. There may be additional warnings, and hopefully, no errors. If
there is an error, then the production version will probably not run.
+
+On the command line, create a production version by running:
```
<path to Royale SDK>/royale-asjs/js/bin/mxmlc GitHubCommitsViewer.mxml
@@ -40,18 +42,19 @@ If you've used NPM to install Royale, you can just run:
mxmlc GitHubCommitsViewer.mxml
```
-Then if your browser worked when you viewed the js-debug folder you can view
the js-release folder, or copy the
-js-release folder to your webserver.
+Then if your browser worked when you viewed the application in the js-debug
folder, you can review the production version the same way in the js-release
folder; or you can copy the js-release folder to your webserver.
-You will probably not see any rows of commits. And if you look in the
console, you should see an error that looks like:
+You will probably not see any rows of commits. And if you look in the
console, you may see an error that looks like:
```
TypeError: undefined is not an object (evaluating 'e.Vf.Qf')
```
-Why is the production version not working? Because as the Google Closure
Compiler renamed variables, it also renamed variables in the code that fetches
fields from the data.
+Why is the production version not working? Because as the Google Closure
Compiler renamed variables, it also renamed variables in the code that fetches
fields from the data.
+
+How do you prevent certain variables from being renamed? One way is by not
using as many plain objects, especially when those objects come from an
external source. If a plain object is used entirely internally, then the Google
Closure Compiler can rename all references to a property like "message" to just
"mm". Google doesn't know or have a way to know that the objects in this
tutorial are coming from a server.
-How do you prevent certain variables from being renamed? One way is by not
using as many plain objects, especially when those objects come from an
external source. If a plain object is used entirely internally, then the
Google Closure Compiler can rename all references to a property like "message"
to just "mm". Google doesn't know or have a way to know that the objects in
this tutorial are coming from a server. There is more than one way to keep
Google Closure Compiler from renaming [...]
+There is more than one way to keep Google Closure Compiler from renaming
variables, but not using plain objects has other advantages as we'll see in the
next section.
{:align="center"}
[Previous Page](create-an-application/application-tutorial/security.html) \|
[Next Page](create-an-application/application-tutorial/value-objects.html)
--
To stop receiving notification emails like this one, please contact
[email protected].