This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/royale-docs.git
The following commit(s) were added to refs/heads/master by this push:
new 857878d More fixes in the app tutorial
857878d is described below
commit 857878d771b48aad8e1ecfe2ec0f618cddead7c8
Author: Carlos Rovira <[email protected]>
AuthorDate: Tue Sep 3 20:59:20 2019 +0200
More fixes in the app tutorial
---
create-an-application/application-structure.md | 6 +++---
create-an-application/application-tutorial.md | 2 +-
create-an-application/application-tutorial/debug.md | 18 +++++++++++++-----
create-an-application/application-tutorial/deploy.md | 2 +-
create-an-application/application-tutorial/security.md | 2 +-
get-started/development-tools.md | 2 +-
6 files changed, 20 insertions(+), 12 deletions(-)
diff --git a/create-an-application/application-structure.md
b/create-an-application/application-structure.md
index 5806497..68105a6 100644
--- a/create-an-application/application-structure.md
+++ b/create-an-application/application-structure.md
@@ -28,13 +28,13 @@ Royale applications are usually comprised of many files. If
you are in rapid-pro
There are multiple popular ways of dividing an Application into coherent and
reusable pieces: Model-View (MV), Model-View-Controller (MVC), and other
alphabet soup like MVP, MVVM, HMVC and more. This documentation will not
address these patterns in detail. You can read more about them on the internet.
-Whatever you decide for how many files you will have, another thing to keep in
mind is that Royale can produce different kinds of output, like SWFs for Adobe
FlashPlayer or Adobe AIR as well as HTML/JS/CSS for browsers and Apache Cordova
applications. So, the recommended practice is to create a folder for your
project files and a set of subfolders within it. The Royale compiler detects
certain common folder patterns and automatically chooses where to put output
folders, although you can [...]
+> Whatever you decide for how many files you will have, another thing to keep
in mind is that Royale can produce different kinds of output, like SWFs for
Adobe FlashPlayer or Adobe AIR as well as HTML/JS/CSS for browsers and Apache
Cordova applications. So, the recommended practice is to create a folder for
your project files and a set of subfolders within it. The Royale compiler
detects certain common folder patterns and automatically chooses where to put
output folders, although you c [...]
If you are using an [IDE](get-started/development-tools) that supports Royale,
it will create the standard folder structure for you when you create a Royale
project. If you are working outside of an IDE, and perhaps using command-line
instructions to compile your code, here is how to structure your project.
-Let's say you are creating a project called MyFirstRoyaleApp. Create a
MyFirstRoyaleApp folder and in it create a folder named "src". Put your source
code in there. If you do that, the compiler will put the output in a "bin"
folder that it creates.
+Let's say you are creating a project called `MyFirstRoyaleApp`. Create a
`MyFirstRoyaleApp` folder and in it create a folder named `src`. Put your
source code in there. If you do that, the compiler will put the output in a
`bin` folder that it creates.
-If you use [Apache Maven](https://maven.apache.org){:target='_blank'} to build
your app, you can use one of the Maven archetypes, which put the main
application source code 3 levels deep in a "src/main/royale" folder structure.
Other kinds of files then go in "src/main/resource", "src/main/config" and so
on. Maven instructs the compiler to put the output in a "target/javascript/bin"
folder.
+If you use [Apache Maven](https://maven.apache.org){:target='_blank'} to build
your app, you can use one of the [Maven
archetypes](get-started/development-tools.html#apache-maven), which put the
main application source code 3 levels deep in a `src/main/royale` folder
structure. Other kinds of files then go in `src/main/resource`,
`src/main/config` and so on. Maven instructs the compiler to put the output in
a `target/javascript/bin` folder.
Most Royale applications use an [MXML](features/mxml) file as the main
application file. Other files are written in MXML or
[ActionScript](features/as3) depending on whether you are assembling pieces or
writing custom logic. You can write a Royale Application without using MXML at
all, but you'll end up writing more code.
diff --git a/create-an-application/application-tutorial.md
b/create-an-application/application-tutorial.md
index 0a0d37b..9714eff 100644
--- a/create-an-application/application-tutorial.md
+++ b/create-an-application/application-tutorial.md
@@ -54,7 +54,7 @@ The first six segments will result in a functional
application.
The next four segments will discuss further improvements needed to make a
production-ready version.
-7. [Debugging](create-an-application/application-tutorial/debug.html) This
segment introduces a couple of techniques for figuring out why your app isn't
working as expected.
+7. [Debugging](create-an-application/application-tutorial/debug) This segment
introduces a couple of techniques for figuring out why your app isn't working
as expected.
8. [Security](create-an-application/application-tutorial/security.html) This
segment discusses how to deal with network access to other domains.
diff --git a/create-an-application/application-tutorial/debug.md
b/create-an-application/application-tutorial/debug.md
index 8b8acf4..3c774d5 100644
--- a/create-an-application/application-tutorial/debug.md
+++ b/create-an-application/application-tutorial/debug.md
@@ -16,13 +16,19 @@
layout: docpage
title: Debug the application
+description: Find and resolve defects or problems within a Royale application.
+permalink: /create-an-application/application-tutorial/debug
---
# Debug the application
-If the application built and showed a set of columns but no commit data, then
you are probably running a browser that has a tighter security model than some
other browsers. Some browsers won't let an application access data from
another domain without permission.
+Find and resolve defects or problems within a Royale application.
-But to verify that, or whenever something goes wrong in your application, the
first step is to open the console window for your browser. How to do that
depends on the browser, but basically, the output JavaScript is going to be
executed until it throws an "uncaught exception" and code that was supposed to
run after that won't and that will result in lots of things not working.
+If the application built and showed a set of columns but no commit data, then
you are probably running a browser that has a tighter security model than some
other browsers.
+
+> Some browsers won't let an application access data from another domain
without permission.
+
+But to verify that, or whenever something goes wrong in your application, the
first step is to open the console window for your browser. How to do that
depends on the browser, but basically, the output JavaScript is going to be
executed until it throws an *"uncaught exception"* and code that was supposed
to run after that won't and that will result in lots of things not working.
In one browser, the console said:
@@ -31,11 +37,13 @@ Failed to load file:///.../bin/js-debug/project.json: Cross
origin requests are
supported for protocol schemes: http, data, chrome, chrome-extension,
https.
```
-Because I had simply opened the file from my computer's file viewer in the
browser, the browser opened it under the file:/// protocol and wouldn't allow
access from my computer to GitHub.
+Because I simply opened the file from my computer's file viewer in the
browser, the browser opened it under the `file:///` protocol and wouldn't allow
access from my computer to GitHub.
+
+So, to do further testing you will need to set up a web server for the
application or copy the application to a web server and run it from there. If
you look in the `js-debug` folder, you will find a lot of files you have to
copy. You can't just copy the `index.html` file.
-So, to do further testing you will need to set up a web server for the
application or copy the application to a web server and run it from there. If
you look in the "js-debug" folder, you will find a lot of files you have to
copy. You can't just copy the index.html file.
+Back to the topic of debugging for a moment. Most browsers also have debuggers
with breakpoints. Your application `.mxml` and `.as` files have each been
turned into a `.js` file that the browser will let you set breakpoints in and
step through. Some IDEs support the ability to see your `.mxml` and `.as` files
in the debugger.
-Back to the topic of debugging for a moment. Most browsers also have debuggers
with breakpoints. Your application .mxml and .as files have each been turned
into a .js file that the browser will let you set breakpoints in and step
through. Some IDEs support the ability to see your .mxml and .as files in the
debugger.
+> if you compiled your application with
[sourcemaps](https://www.html5rocks.com/en/tutorials/developertools/sourcemaps){:target='_blank'}
using `-source-map=true` compiler option, the Royale compiler will generate
source maps for each `.js` file and you'll see a `.js.map` at the same level.
Anyway, to get this application to access GitHub, we have to make the
application available on a web server and learn a bit about security.
diff --git a/create-an-application/application-tutorial/deploy.md
b/create-an-application/application-tutorial/deploy.md
index deed671..2c09a8f 100644
--- a/create-an-application/application-tutorial/deploy.md
+++ b/create-an-application/application-tutorial/deploy.md
@@ -37,5 +37,5 @@ src="assets/application-tutorial/index.html"></iframe>
Or maybe the commits won't appear. In fact, many browsers will not run this
app successfully. Let's figure out why.
{:align="center"}
-[Previous Page](create-an-application/application-tutorial/build) \| [Next
Page](create-an-application/application-tutorial/debug.html)
+[Previous Page](create-an-application/application-tutorial/build) \| [Next
Page](create-an-application/application-tutorial/debug)
diff --git a/create-an-application/application-tutorial/security.md
b/create-an-application/application-tutorial/security.md
index c3008b5..5eaba4a 100644
--- a/create-an-application/application-tutorial/security.md
+++ b/create-an-application/application-tutorial/security.md
@@ -32,4 +32,4 @@ It is up the external resource to decide whether you can
access it or not. And e
Fortunately, for this tutorial, GitHub's APIs are very permissive. Once you
have your application on a website it should now show rows of commits even if
it wasn't when running from file://.
{:align="center"}
-[Previous Page](create-an-application/application-tutorial/debug.html) \|
[Next Page](create-an-application/application-tutorial/production.html)
+[Previous Page](create-an-application/application-tutorial/debug) \| [Next
Page](create-an-application/application-tutorial/production.html)
diff --git a/get-started/development-tools.md b/get-started/development-tools.md
index 7b9a603..c3687ed 100644
--- a/get-started/development-tools.md
+++ b/get-started/development-tools.md
@@ -50,7 +50,7 @@ Royale provides [Royale CLI](get-started/royale-cli), a tool
to simplify creatin
## Apache Maven
-You can use Apache Maven to compile your Royale application. Visit the [Apache
Maven Project](https://maven.apache.org){:target='_blank'} to learn more about
Maven. Each of the examples in the examples folder is set up to be built with
Maven, and the archetypes folder contains Maven Archetypes.
+You can use Apache Maven to compile your Royale application. Visit the [Apache
Maven Project](https://maven.apache.org){:target='_blank'} to learn more about
Maven. Each of the examples in the examples folder is set up to be built with
Maven, and the archetypes folder contains **Maven Archetypes**.
## Apache Ant