You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2020/03/31 10:01:49 UTC

[GitHub] [cordova-js] erisu opened a new pull request #227: doc(README): update

erisu opened a new pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227
 
 
   ### Motivation, Context & Description
   
   - Improve README
   
   ### Checklist
   
   - [x] I've updated the documentation if necessary
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400921505
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
 
 Review comment:
   ```suggestion
       |-build-tools/ ......... build tasks
       |-build-tools/ ......... custom bundler for our CommonJS-like modules
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] erisu merged pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
erisu merged pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400953922
 
 

 ##########
 File path: README.md
 ##########
 @@ -104,51 +125,44 @@ Once the new js file has been added, any new projects created will use the updat
 
 ## Adding a New Platform
 
-1. Add your platform as a directory under the `legacy-exec` folder.
-2. Write a module that encapsulates your platform's `exec` method and
-   call it `exec.js`. The `exec` method is a JavaScript function
-   that enables communication from the platform's JavaScript environment
-   into the platform's native environment. Each platform uses a different
-   mechanism to enable this bridge. We recommend you check out the other
-   platform `exec` definitions for inspiration. Drop this into the
-   `src/legacy-exec/<platform>` folder you created in step 1. The `exec` method has the following method
-   signature: `function(success, fail, service, action, args)`, with the
-   following parameters:
-      - `success`: a success function callback
-      - `fail`: a failure function callback
-      - `service`: a string identifier that the platform can resolve to a
-        native class
-      - `action`: a string identifier that the platform can resolve to a
-        specific method inside the class pointed to by `service`
-      - `args`: an array of parameters to pass to the native method invoked
-        by the `exec` call
-   It is required that new platform additions be as consistent as
-   possible with the existing `service` and `action` labels.
-2. Define your platform definition object and name it `platform.js`. Drop this into the `src/legacy-exec/<platform>` folder. This file should contain a **JSON** object with the following properties:
-    - `id`: a string representing the platform. This should be the same
-      name the .js file has
-    - `objects`: the property names defined as children of this property
-      are injected into `window`, and also *overrides any existing
-      properties*. Each property can have the following
-      child properties:
-      - `path`: a string representing the module ID that will define
-        this object. For example, the file `lib/plugin/accelerometer.js`
-        can be accessed as `"cordova/plugin/accelerometer"`. More details on how
-        the module IDs are defined are above under the "How It Works" section.
-      - `children`: in a recursive fashion, can have `path` and
-        `children` properties of its own that are defined as children of
-        the parent property object
-    - `merges`: similar to the above `objects` property, this one will
-      not clobber existing objects, instead it will recursively merge
-      this object into the specific target
-    - `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
-
-   The following is a simple example of a platform definition:
-
-    <pre>
+### In Your Platform Repository
+
+1. Create the `cordova-js-src` directory.
+
+2. Write a module that encapsulates your platform's `exec` method and call it `exec.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    The `exec` method is a JavaScript function that enables communication from the platform's JavaScript environment into the platform's native environment. Each platform uses a different mechanism to enable this bridge. We recommend you check out the other platform `exec` definitions for inspiration.
+
+    The `exec` method has the following method signature: `function(success, fail, service, action, args)`
+
+    **Methods Arguments:**
+
+    * `success`: a success function callback
+    * `fail`: a failure function callback
+    * `service`: a string identifier that the platform can resolve to a native class
+    * `action`: a string identifier that the platform can resolve to a specific method inside the class pointed to by `service`
+    * `args`: an array of parameters to pass to the native method invoked by the `exec` call
+
+    It is required that new platform additions be as consistent as possible with the existing `service` and `action` labels.
+
+3. Define your platform definition object and name it `platform.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    This file should contain a **JSON** object with the following properties:
+
+     * `id`: a string representing the platform. This should match the name of the `.js` file.
+     * `objects`: the property names defined as children of this property are injected into `window`, and also *overrides any existing properties*. Each property can have the following child properties:
+       * `path`: a string representing the module ID that will define this object. For example, the file `lib/plugin/accelerometer.js` can be accessed as `"cordova/plugin/accelerometer"`. More details on how the module IDs are defined are above under the "How It Works" section.
+       * `children`: in a recursive fashion, can have `path` and `children` properties of its own that are defined as children of the parent property object
+     * `merges`: similar to the above `objects` property, this one will not clobber existing objects, instead it will recursively merge this object into the specific target
 
 Review comment:
   ```suggestion
        * `bootstrap`: A function that sets up the platform. Must fire the `onNativeReady` channel when done.
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400970002
 
 

 ##########
 File path: README.md
 ##########
 @@ -162,19 +176,16 @@ Once the new js file has been added, any new projects created will use the updat
         }
       }
     }
-    </pre>
-
-3. You should probably add a `<platform>:{}` entry to the `Gruntfile` compile arrays.
-4. Make sure your native implementation executes the following JavaScript once all of the native side is initialized and ready: `require('cordova/channel').onNativeReady.fire()`.
-5. The `deviceready` event is important. To make sure that the stock
-   common JavaScript fires this event off, the device and network
-   connection plugins must successfully be instantiated and return
-   information about the connectivity and device information. The
-   success callbacks for these plugins should include calls to
-   `require('cordova/channel').onCordovaInfoReady.fire()` (for device
-   information) and
-   `require('cordova/channel').OnCordovaConnectionReady.fire()` (for
-   network information).
-6. Last but certainly not least: add yourself to the contributors list!
-   It's in the `package.json` file in the root of this repository. You
-   deserve it!
+    ```
+
+4. Make sure your native implementation executes the following JavaScript once all of the native side is initialized and ready:
+
+    ```javascript
+    require('cordova/channel').onNativeReady.fire()
+    ```
+
+5. The `deviceready` event is important. To make sure that the stock common JavaScript fires this event off, the device and network connection plugins must successfully be instantiated and return information about the connectivity and device information. The success callbacks for these plugins should include calls to `require('cordova/channel').onCordovaInfoReady.fire()` (for device information) and `require('cordova/channel').OnCordovaConnectionReady.fire()` (for network information).
 
 Review comment:
   ```suggestion
   ```
   
   AFAICT this information is outdated. These channels do not exist in `cordova-js`. To delay the `deviceready` event until some other channel has fired, `waitForInitialization` is used now. This function is currently used only by plugins, not by platforms. Which makes sense, because platforms already have the `onNativeReady` channel which `deviceready` waits for anyway. So all in all we can chuck that point.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] erisu edited a comment on issue #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
erisu edited a comment on issue #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#issuecomment-606527055
 
 
   @raphinesse when you refactored the build tools, the README was not updated.
   
   It also seems the README was out-dated even before your changes anyways.
   
   If you have any chance, can you skim my README changes to see if it follows inline with what your build changes.
   
   **Some Additional Unknowns:**
   
   Step 3 of `In Your Platform Repository`, it mentions about the platform object with these properties: `id`, `objects`, `objects.path`, `objects.children`, `merges` & `initialize`...
   
   I am not exactly sure how accurate this data is anymore. Looking at all of our current platforms, we only use `id` and `bootstrap`. It seems that `initialize` might still exist but we switched for `bootstrap`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400941023
 
 

 ##########
 File path: README.md
 ##########
 @@ -104,51 +125,44 @@ Once the new js file has been added, any new projects created will use the updat
 
 ## Adding a New Platform
 
-1. Add your platform as a directory under the `legacy-exec` folder.
-2. Write a module that encapsulates your platform's `exec` method and
-   call it `exec.js`. The `exec` method is a JavaScript function
-   that enables communication from the platform's JavaScript environment
-   into the platform's native environment. Each platform uses a different
-   mechanism to enable this bridge. We recommend you check out the other
-   platform `exec` definitions for inspiration. Drop this into the
-   `src/legacy-exec/<platform>` folder you created in step 1. The `exec` method has the following method
-   signature: `function(success, fail, service, action, args)`, with the
-   following parameters:
-      - `success`: a success function callback
-      - `fail`: a failure function callback
-      - `service`: a string identifier that the platform can resolve to a
-        native class
-      - `action`: a string identifier that the platform can resolve to a
-        specific method inside the class pointed to by `service`
-      - `args`: an array of parameters to pass to the native method invoked
-        by the `exec` call
-   It is required that new platform additions be as consistent as
-   possible with the existing `service` and `action` labels.
-2. Define your platform definition object and name it `platform.js`. Drop this into the `src/legacy-exec/<platform>` folder. This file should contain a **JSON** object with the following properties:
-    - `id`: a string representing the platform. This should be the same
-      name the .js file has
-    - `objects`: the property names defined as children of this property
-      are injected into `window`, and also *overrides any existing
-      properties*. Each property can have the following
-      child properties:
-      - `path`: a string representing the module ID that will define
-        this object. For example, the file `lib/plugin/accelerometer.js`
-        can be accessed as `"cordova/plugin/accelerometer"`. More details on how
-        the module IDs are defined are above under the "How It Works" section.
-      - `children`: in a recursive fashion, can have `path` and
-        `children` properties of its own that are defined as children of
-        the parent property object
-    - `merges`: similar to the above `objects` property, this one will
-      not clobber existing objects, instead it will recursively merge
-      this object into the specific target
-    - `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
-
-   The following is a simple example of a platform definition:
-
-    <pre>
+### In Your Platform Repository
+
+1. Create the `cordova-js-src` directory.
+
+2. Write a module that encapsulates your platform's `exec` method and call it `exec.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    The `exec` method is a JavaScript function that enables communication from the platform's JavaScript environment into the platform's native environment. Each platform uses a different mechanism to enable this bridge. We recommend you check out the other platform `exec` definitions for inspiration.
+
+    The `exec` method has the following method signature: `function(success, fail, service, action, args)`
+
+    **Methods Arguments:**
+
+    * `success`: a success function callback
+    * `fail`: a failure function callback
+    * `service`: a string identifier that the platform can resolve to a native class
+    * `action`: a string identifier that the platform can resolve to a specific method inside the class pointed to by `service`
+    * `args`: an array of parameters to pass to the native method invoked by the `exec` call
+
+    It is required that new platform additions be as consistent as possible with the existing `service` and `action` labels.
+
+3. Define your platform definition object and name it `platform.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    This file should contain a **JSON** object with the following properties:
+
+     * `id`: a string representing the platform. This should match the name of the `.js` file.
+     * `objects`: the property names defined as children of this property are injected into `window`, and also *overrides any existing properties*. Each property can have the following child properties:
+       * `path`: a string representing the module ID that will define this object. For example, the file `lib/plugin/accelerometer.js` can be accessed as `"cordova/plugin/accelerometer"`. More details on how the module IDs are defined are above under the "How It Works" section.
+       * `children`: in a recursive fashion, can have `path` and `children` properties of its own that are defined as children of the parent property object
+     * `merges`: similar to the above `objects` property, this one will not clobber existing objects, instead it will recursively merge this object into the specific target
+     * `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
+
+    The following is a simple example of a platform definition:
+
+    ```json
 
 Review comment:
   ```suggestion
       ```js
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400957384
 
 

 ##########
 File path: README.md
 ##########
 @@ -104,51 +125,44 @@ Once the new js file has been added, any new projects created will use the updat
 
 ## Adding a New Platform
 
-1. Add your platform as a directory under the `legacy-exec` folder.
-2. Write a module that encapsulates your platform's `exec` method and
-   call it `exec.js`. The `exec` method is a JavaScript function
-   that enables communication from the platform's JavaScript environment
-   into the platform's native environment. Each platform uses a different
-   mechanism to enable this bridge. We recommend you check out the other
-   platform `exec` definitions for inspiration. Drop this into the
-   `src/legacy-exec/<platform>` folder you created in step 1. The `exec` method has the following method
-   signature: `function(success, fail, service, action, args)`, with the
-   following parameters:
-      - `success`: a success function callback
-      - `fail`: a failure function callback
-      - `service`: a string identifier that the platform can resolve to a
-        native class
-      - `action`: a string identifier that the platform can resolve to a
-        specific method inside the class pointed to by `service`
-      - `args`: an array of parameters to pass to the native method invoked
-        by the `exec` call
-   It is required that new platform additions be as consistent as
-   possible with the existing `service` and `action` labels.
-2. Define your platform definition object and name it `platform.js`. Drop this into the `src/legacy-exec/<platform>` folder. This file should contain a **JSON** object with the following properties:
-    - `id`: a string representing the platform. This should be the same
-      name the .js file has
-    - `objects`: the property names defined as children of this property
-      are injected into `window`, and also *overrides any existing
-      properties*. Each property can have the following
-      child properties:
-      - `path`: a string representing the module ID that will define
-        this object. For example, the file `lib/plugin/accelerometer.js`
-        can be accessed as `"cordova/plugin/accelerometer"`. More details on how
-        the module IDs are defined are above under the "How It Works" section.
-      - `children`: in a recursive fashion, can have `path` and
-        `children` properties of its own that are defined as children of
-        the parent property object
-    - `merges`: similar to the above `objects` property, this one will
-      not clobber existing objects, instead it will recursively merge
-      this object into the specific target
-    - `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
-
-   The following is a simple example of a platform definition:
-
-    <pre>
+### In Your Platform Repository
+
+1. Create the `cordova-js-src` directory.
+
+2. Write a module that encapsulates your platform's `exec` method and call it `exec.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    The `exec` method is a JavaScript function that enables communication from the platform's JavaScript environment into the platform's native environment. Each platform uses a different mechanism to enable this bridge. We recommend you check out the other platform `exec` definitions for inspiration.
+
+    The `exec` method has the following method signature: `function(success, fail, service, action, args)`
+
+    **Methods Arguments:**
+
+    * `success`: a success function callback
+    * `fail`: a failure function callback
+    * `service`: a string identifier that the platform can resolve to a native class
+    * `action`: a string identifier that the platform can resolve to a specific method inside the class pointed to by `service`
+    * `args`: an array of parameters to pass to the native method invoked by the `exec` call
+
+    It is required that new platform additions be as consistent as possible with the existing `service` and `action` labels.
+
+3. Define your platform definition object and name it `platform.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    This file should contain a **JSON** object with the following properties:
+
+     * `id`: a string representing the platform. This should match the name of the `.js` file.
+     * `objects`: the property names defined as children of this property are injected into `window`, and also *overrides any existing properties*. Each property can have the following child properties:
+       * `path`: a string representing the module ID that will define this object. For example, the file `lib/plugin/accelerometer.js` can be accessed as `"cordova/plugin/accelerometer"`. More details on how the module IDs are defined are above under the "How It Works" section.
+       * `children`: in a recursive fashion, can have `path` and `children` properties of its own that are defined as children of the parent property object
+     * `merges`: similar to the above `objects` property, this one will not clobber existing objects, instead it will recursively merge this object into the specific target
+     * `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
 
 Review comment:
   ```suggestion
        * `initialize`: an optional function that is called after the global scope setup is done (i.e. Cordova and all plugins are ready)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400962156
 
 

 ##########
 File path: README.md
 ##########
 @@ -162,19 +176,16 @@ Once the new js file has been added, any new projects created will use the updat
         }
       }
 
 Review comment:
   Seems you can't post a suggestion to non-diff code, but the above example should be something like
   
   ```js
   module.exports = {
       id: 'atari',
       bootstrap: function() {
           require('cordova/channel').onNativeReady.fire();
       }
   };
   ```
   which is the file from `osx` with the ID changed: https://github.com/apache/cordova-osx/blob/master/cordova-js-src/platform.js

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400931543
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
+    |-pkg/ ................. generated platform cordova.js files
+    |-src/
+    |  |-cordova.js ........ common Cordova stuff
+    |  |-common/ ........... base modules shared across platfoms
+    |  |  |-argscheck.js ... utility to checks given arguments' types
+    |  |  |-base64.js ...... base64 utilites (toArrayBuffer & fromArrayBuffer)
+    |  |  |-builder.js ..... injects in our classes onto window and navigator
+    |  |  |-channel.js ..... pub/sub implementation for custom framework events
+    |  |  |-init.js ........ common locations to add Cordova objects to browser globals
 
 Review comment:
   ```suggestion
       |  |  |-init.js ........ bootstraps the Cordova platform, inject APIs and fire events
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400940659
 
 

 ##########
 File path: README.md
 ##########
 @@ -104,51 +125,44 @@ Once the new js file has been added, any new projects created will use the updat
 
 ## Adding a New Platform
 
-1. Add your platform as a directory under the `legacy-exec` folder.
-2. Write a module that encapsulates your platform's `exec` method and
-   call it `exec.js`. The `exec` method is a JavaScript function
-   that enables communication from the platform's JavaScript environment
-   into the platform's native environment. Each platform uses a different
-   mechanism to enable this bridge. We recommend you check out the other
-   platform `exec` definitions for inspiration. Drop this into the
-   `src/legacy-exec/<platform>` folder you created in step 1. The `exec` method has the following method
-   signature: `function(success, fail, service, action, args)`, with the
-   following parameters:
-      - `success`: a success function callback
-      - `fail`: a failure function callback
-      - `service`: a string identifier that the platform can resolve to a
-        native class
-      - `action`: a string identifier that the platform can resolve to a
-        specific method inside the class pointed to by `service`
-      - `args`: an array of parameters to pass to the native method invoked
-        by the `exec` call
-   It is required that new platform additions be as consistent as
-   possible with the existing `service` and `action` labels.
-2. Define your platform definition object and name it `platform.js`. Drop this into the `src/legacy-exec/<platform>` folder. This file should contain a **JSON** object with the following properties:
-    - `id`: a string representing the platform. This should be the same
-      name the .js file has
-    - `objects`: the property names defined as children of this property
-      are injected into `window`, and also *overrides any existing
-      properties*. Each property can have the following
-      child properties:
-      - `path`: a string representing the module ID that will define
-        this object. For example, the file `lib/plugin/accelerometer.js`
-        can be accessed as `"cordova/plugin/accelerometer"`. More details on how
-        the module IDs are defined are above under the "How It Works" section.
-      - `children`: in a recursive fashion, can have `path` and
-        `children` properties of its own that are defined as children of
-        the parent property object
-    - `merges`: similar to the above `objects` property, this one will
-      not clobber existing objects, instead it will recursively merge
-      this object into the specific target
-    - `initialize`: a function that fires immediately after the `objects` (see above) are defined in the global scope
-
-   The following is a simple example of a platform definition:
-
-    <pre>
+### In Your Platform Repository
+
+1. Create the `cordova-js-src` directory.
+
+2. Write a module that encapsulates your platform's `exec` method and call it `exec.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    The `exec` method is a JavaScript function that enables communication from the platform's JavaScript environment into the platform's native environment. Each platform uses a different mechanism to enable this bridge. We recommend you check out the other platform `exec` definitions for inspiration.
+
+    The `exec` method has the following method signature: `function(success, fail, service, action, args)`
+
+    **Methods Arguments:**
+
+    * `success`: a success function callback
+    * `fail`: a failure function callback
+    * `service`: a string identifier that the platform can resolve to a native class
+    * `action`: a string identifier that the platform can resolve to a specific method inside the class pointed to by `service`
+    * `args`: an array of parameters to pass to the native method invoked by the `exec` call
+
+    It is required that new platform additions be as consistent as possible with the existing `service` and `action` labels.
+
+3. Define your platform definition object and name it `platform.js`. This file should be added into the `<platform-repo>/cordova-js-src` directory which was created from step 1.
+
+    This file should contain a **JSON** object with the following properties:
 
 Review comment:
   ```suggestion
       This file should export an object with the following properties:
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400926930
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
+    |-pkg/ ................. generated platform cordova.js files
+    |-src/
+    |  |-cordova.js ........ common Cordova stuff
+    |  |-common/ ........... base modules shared across platfoms
+    |  |  |-argscheck.js ... utility to checks given arguments' types
+    |  |  |-base64.js ...... base64 utilites (toArrayBuffer & fromArrayBuffer)
+    |  |  |-builder.js ..... injects in our classes onto window and navigator
 
 Review comment:
   ```suggestion
       |  |  |-builder.js ..... utilities to install a set of properties onto an object
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400921505
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
 
 Review comment:
   ```suggestion
       |-build-tools/ ......... custom bundler for our CommonJS-like modules
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400963594
 
 

 ##########
 File path: README.md
 ##########
 @@ -162,19 +176,16 @@ Once the new js file has been added, any new projects created will use the updat
         }
       }
     }
-    </pre>
-
-3. You should probably add a `<platform>:{}` entry to the `Gruntfile` compile arrays.
-4. Make sure your native implementation executes the following JavaScript once all of the native side is initialized and ready: `require('cordova/channel').onNativeReady.fire()`.
-5. The `deviceready` event is important. To make sure that the stock
-   common JavaScript fires this event off, the device and network
-   connection plugins must successfully be instantiated and return
-   information about the connectivity and device information. The
-   success callbacks for these plugins should include calls to
-   `require('cordova/channel').onCordovaInfoReady.fire()` (for device
-   information) and
-   `require('cordova/channel').OnCordovaConnectionReady.fire()` (for
-   network information).
-6. Last but certainly not least: add yourself to the contributors list!
-   It's in the `package.json` file in the root of this repository. You
-   deserve it!
+    ```
+
+4. Make sure your native implementation executes the following JavaScript once all of the native side is initialized and ready:
+
+    ```javascript
+    require('cordova/channel').onNativeReady.fire()
+    ```
 
 Review comment:
   ```suggestion
   ```
   
   Mentioned in the description of bootstrap and demonstrated in my suggested example. I think we can remove this paragraph.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] erisu edited a comment on issue #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
erisu edited a comment on issue #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#issuecomment-606527055
 
 
   @raphinesse when you refactored the build tools, the README was not updated.
   
   It also seems the README was out-dated even before your changes anyways.
   
   If you have any chance, can you skim my README changes to see if it follows inline with what your build changes.
   
   **Some Additional Unknowns:**
   
   Step 3 of `In Your Platform Repository`, it says talks about an object with these properties: `id`, `objects`, `objects.path`, `objects.children`, `merges` & `initialize`...
   
   I am not exactly sure how accurate this data is anymore. Looking at all of our current platforms, we only use `id` and `bootstrap`. It seems that `initialize` might still exist but we switched for `bootstrap`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] erisu commented on issue #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
erisu commented on issue #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#issuecomment-606527055
 
 
   @raphinesse when you refactored the build tools, the README was not updated.
   
   It also seems the README was out-dated even before that. If you have any chance, can you skim my changes to see if it follows inline with what your build changes.
   
   Some additional unknowns:
   
   Step 3 of `In Your Platform Repository`, it says talks about an object with these properties: `id`, `objects`, `objects.path`, `objects.children`, `merges` & `initialize`...
   
   I am not exactly sure how accurate this data is anymore. Looking at all of our current platforms, we only use `id` and `bootstrap`. It seems that `initialize` might still exist but we switched for `bootstrap`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400924041
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
+    |-pkg/ ................. generated platform cordova.js files
+    |-src/
+    |  |-cordova.js ........ common Cordova stuff
+    |  |-common/ ........... base modules shared across platfoms
+    |  |  |-argscheck.js ... utility to checks given arguments' types
 
 Review comment:
   ```suggestion
       |  |  |-argscheck.js ... utility for type-checking arguments during runtime
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [cordova-js] raphinesse commented on a change in pull request #227: doc(README): update

Posted by GitBox <gi...@apache.org>.
raphinesse commented on a change in pull request #227: doc(README): update
URL: https://github.com/apache/cordova-js/pull/227#discussion_r400933060
 
 

 ##########
 File path: README.md
 ##########
 @@ -21,74 +21,95 @@
 
 # cordova-js
 
+[![NPM](https://nodei.co/npm/cordova-js.png)](https://nodei.co/npm/cordova-js/)
+
 [![Node CI](https://github.com/apache/cordova-js/workflows/Node%20CI/badge.svg?branch=master)](https://github.com/apache/cordova-js/actions?query=branch%3Amaster)
 
 A unified JavaScript layer for [Apache Cordova](http://cordova.apache.org/) projects.
 
 ## Project Structure
 
-    ./
-     |-src/
-     |  |-cordova.js ........ common Cordova stuff
-     |  |-common/ ........... base modules shared across platfoms
-     |  |  |-builder.js ..... injects in our classes onto window and navigator
-     |  |  |-channel.js ..... pub/sub impl for custom framework events
-     |  |  |-init.js ........ common locations to add Cordova objects to browser globals
-     |  |  |-exec.js ........ interface stub for each platform specific version of exec.js
-     |  |  |-platform.js .... stub for platform's specific version of platform.js
-     |  |  '-utils.js ....... closures, uuids, object, cloning, extending prototypes
-     |  |
-     |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
-     |  |  |-bootstrap.js ... bootstrap the Cordova platform, inject APIs and fire events
-     |  |  '-require.js ..... module definition and require() impl
-     |  |
-     |  |-legacy-exec/ ...... contains old platform specific modules
-     |  |  |-<platform>/ .... contains the platform-specific base modules
-     |
-     |-tasks/ ............... custom grunt tasks
-     |-tests/ ............... unit tests
-     |
-     '-pkg/ ................. generated platform cordova.js files
+  ```text
+  ./
+    |-build-tools/ ......... build tasks
+    |-pkg/ ................. generated platform cordova.js files
+    |-src/
+    |  |-cordova.js ........ common Cordova stuff
+    |  |-common/ ........... base modules shared across platfoms
+    |  |  |-argscheck.js ... utility to checks given arguments' types
+    |  |  |-base64.js ...... base64 utilites (toArrayBuffer & fromArrayBuffer)
+    |  |  |-builder.js ..... injects in our classes onto window and navigator
+    |  |  |-channel.js ..... pub/sub implementation for custom framework events
+    |  |  |-init.js ........ common locations to add Cordova objects to browser globals
+    |  |  |-utils.js ....... closures, uuids, object, cloning, extending prototypes
+    |  |  |
+    |  |  |-exec/ .......... exec methods
+    |  |  |  '-proxy.js .... utility for adding and removing exec proxy methods
+    |  |
+    |  |-scripts/ .......... non-module JS that gets concated to cordova.<platform>.js
 
 Review comment:
   ```suggestion
       |  |-scripts/ .......... non-module JS that gets concatenated to cordova.<platform>.js
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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