You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ra...@apache.org on 2020/12/01 12:10:47 UTC

[cordova-js] branch master updated: docs: some minor improvements (#234)

This is an automated email from the ASF dual-hosted git repository.

raphinesse pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-js.git


The following commit(s) were added to refs/heads/master by this push:
     new 2278ac5  docs: some minor improvements (#234)
2278ac5 is described below

commit 2278ac51d26eaa149e858f27f5e770eef0bc2498
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Tue Dec 1 13:10:38 2020 +0100

    docs: some minor improvements (#234)
    
    * docs: improve project structure overview
    
    * docs: split long paragraph
---
 README.md | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 6b28d51..d430bd3 100644
--- a/README.md
+++ b/README.md
@@ -33,8 +33,10 @@ A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) proj
   ./
     |-build-tools/ ......... custom bundler for our CommonJS-like modules
     |-pkg/ ................. generated platform cordova.js files
-    |-src/
+    |
+    |-src/ ................. the code that makes up Cordova's JavaScript runtime
     |  |-cordova.js ........ common Cordova stuff
+    |  |
     |  |-common/ ........... base modules shared across platfoms
     |  |  |-argscheck.js ... utility for type-checking arguments during runtime
     |  |  |-base64.js ...... base64 utilites (toArrayBuffer & fromArrayBuffer)
@@ -43,12 +45,12 @@ A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) proj
     |  |  |-init.js ........ bootstraps the Cordova platform, inject APIs and fire events
     |  |  |-utils.js ....... closures, uuids, object, cloning, extending prototypes
     |  |  |
-    |  |  |-exec/ .......... exec methods
-    |  |  |  '-proxy.js .... utility for adding and removing exec proxy methods
+    |  |  '-exec/ .......... exec methods
+    |  |     '-proxy.js .... utility for adding and removing exec proxy methods
     |  |
-    |  |-scripts/ .......... non-module JS that gets concatenated to cordova.<platform>.js
-    |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-    |  |  '-require.js ..... module definition and require() implementation
+    |  '-scripts/ .......... non-module JS that gets concatenated to cordova.<platform>.js
+    |     |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
+    |     '-require.js ..... module definition and require() implementation
     |
     '-tests/ ............... unit tests
   ```
@@ -101,7 +103,9 @@ The **Cordova** *native-to-webview* bridge is initialized in `src/scripts/bootst
   cordova.require('cordova/channel').onNativeReady.fire()
   ```
 
-The `boot` method does all the work.  First, it grabs the common platform definition (under `src/common/common.js`) and injects all of the objects defined there onto `window` and other global namespaces. Next, it grabs all of the platform-specific object definitions (as defined under `src/<platform>/platform.js`) and overrides those onto `window`. Finally, it calls the platform-specific `initialize` function (located in the platform definition). At this point, Cordova is fully initialize [...]
+The `boot` method does all the work.  First, it grabs the common platform definition (under `src/common/common.js`) and injects all of the objects defined there onto `window` and other global namespaces. Next, it grabs all of the platform-specific object definitions (as defined under `src/<platform>/platform.js`) and overrides those onto `window`.
+
+Finally, it calls the platform-specific `initialize` function (located in the platform definition). At this point, Cordova is fully initialized and ready to roll. Last thing we do is wait for the `DOMContentLoaded` event to fire to make sure the page has loaded properly. Once that is done, Cordova fires the `deviceready` event where you can safely attach functions that consume the Cordova APIs.
 
 ## Testing
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org