Capitilization, grammar, and punctuation changes
This commit is contained in:
parent
a69c312389
commit
f263a8e9d5
6 changed files with 51 additions and 51 deletions
|
@ -12,6 +12,6 @@ Prebuilt binaries of atom-shell for Linux, Windows and Mac can be found on the
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
Guides and the API reference is located in the
|
Guides and the API reference are located in the
|
||||||
[docs](https://github.com/atom/atom-shell/tree/master/docs) directory. It also
|
[docs](https://github.com/atom/atom-shell/tree/master/docs) directory. It also
|
||||||
contains documents describing how to build and contribute to atom-shell.
|
contains documents describing how to build and contribute to atom-shell.
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
# Technical differences to node-webkit
|
# Technical differences to Node-Webkit
|
||||||
|
|
||||||
Like node-webkit, atom-shell provides a platform to write desktop applications
|
Like Node-Webkit, atom-shell provides a platform to write desktop applications
|
||||||
with JavaScript and HTML, and has node integration to grant access to low level
|
with JavaScript and HTML, and has Node integration to grant access to low level
|
||||||
system in web pages.
|
system in web pages.
|
||||||
|
|
||||||
But there are also fundamental differences between the two projects that make
|
But there are also fundamental differences between the two projects that make
|
||||||
atom-shell a completely separate product from node-webkit:
|
atom-shell a completely separate product from Node-Webkit:
|
||||||
|
|
||||||
**1. Entry of application**
|
**1. Entry of application**
|
||||||
|
|
||||||
In node-webkit, the main entry of an application is a web page, you specify a
|
In Node-Webkit, the main entry of an application is a web page, you specify a
|
||||||
main page in the `package.json` and it would be opened in a browser window as
|
main page in the `package.json` and it would be opened in a browser window as
|
||||||
the application's main window.
|
the application's main window.
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ providing a URL directly, you need to manually create a browser window and load
|
||||||
html file in it with corresponding API. You also need to listen to window events
|
html file in it with corresponding API. You also need to listen to window events
|
||||||
to decide when to quit the application.
|
to decide when to quit the application.
|
||||||
|
|
||||||
So atom-shell works more like the node.js runtime, and APIs are more low level,
|
So atom-shell works more like the Node.js runtime, and APIs are more low level,
|
||||||
you can also use atom-shell for web testing purpose like
|
you can also use atom-shell for web testing purpose like
|
||||||
[phantomjs](http://phantomjs.org/),
|
[phantomjs](http://phantomjs.org/),
|
||||||
|
|
||||||
|
@ -32,17 +32,17 @@ need a powerful machine to build atom-shell.
|
||||||
|
|
||||||
**3. Node integration**
|
**3. Node integration**
|
||||||
|
|
||||||
In node-webkit, the node integration in web pages requires patching Chromium to
|
In Node-Webkit, the Node integration in web pages requires patching Chromium to
|
||||||
work, while in atom-shell we chose a different way to integrate libuv loop to
|
work, while in atom-shell we chose a different way to integrate libuv loop to
|
||||||
each platform's message loop to avoid hacking Chromium, see the
|
each platform's message loop to avoid hacking Chromium, see the
|
||||||
[`node_bindings`](../../atom/common/) code for how that was done.
|
[`node_bindings`](../../atom/common/) code for how that was done.
|
||||||
|
|
||||||
**4. Multi-context**
|
**4. Multi-context**
|
||||||
|
|
||||||
If you are an experienced node-webkit user, you should be familiar with the
|
If you are an experienced Node-Webkit user, you should be familiar with the
|
||||||
concept of node context and web context, these concepts were invented because
|
concept of Node context and web context, these concepts were invented because
|
||||||
of how the node-webkit was implemented.
|
of how the Node-Webkit was implemented.
|
||||||
|
|
||||||
By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)
|
By using the [multi-context](http://strongloop.com/strongblog/whats-new-node-js-v0-12-multiple-context-execution/)
|
||||||
feature of node, atom-shell doesn't introduce a new JavaScript context in web
|
feature of Node, atom-shell doesn't introduce a new JavaScript context in web
|
||||||
pages.
|
pages.
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* [node.js](http://nodejs.org)
|
* [Node.js](http://nodejs.org)
|
||||||
* clang and headers of GTK+ and libnotify
|
* clang and headers of GTK+ and libnotify
|
||||||
|
|
||||||
On Ubuntu you could install the libraries via:
|
On Ubuntu you could install the libraries via:
|
||||||
|
|
|
@ -29,6 +29,6 @@ your distribution that should be delivered to final users.
|
||||||
|
|
||||||
## Build with grunt
|
## Build with grunt
|
||||||
|
|
||||||
If you build your application with `grunt`, then there is a grunt task that can
|
If you build your application with `grunt` there is a grunt task that can
|
||||||
download atom-shell for current platform automatically:
|
download atom-shell for your current platform automatically:
|
||||||
[grunt-download-atom-shell](https://github.com/atom/grunt-download-atom-shell).
|
[grunt-download-atom-shell](https://github.com/atom/grunt-download-atom-shell).
|
||||||
|
|
|
@ -2,41 +2,41 @@
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
Generally, atom-shell enables you to create desktop applications with pure
|
Generally atom-shell enables you to create desktop applications with pure
|
||||||
JavaScript by providing a runtime with rich native APIs, you could see it as
|
JavaScript by providing a runtime with rich native APIs. You could see it as
|
||||||
an variant of node.js runtime that focused on desktop applications instead of
|
an variant of the Node.js runtime which is focused on desktop applications
|
||||||
web server.
|
instead of web server.
|
||||||
|
|
||||||
But it doesn't mean atom-shell is a JavaScript binding to GUI libraries, instead
|
It doesn't mean atom-shell is a JavaScript binding to GUI libraries. Instead,
|
||||||
atom-shell uses web pages as GUI, so you could also see it as a minimal Chromium
|
atom-shell uses web pages as GUI, so you could also see it as a minimal Chromium
|
||||||
browser, controlled by JavaScript.
|
browser, controlled by JavaScript.
|
||||||
|
|
||||||
### The browser side
|
### The browser side
|
||||||
|
|
||||||
If you had experience with node.js web applications, you would notice that there
|
If you had experience with Node.js web applications, you would notice that there
|
||||||
are types of JavaScript scripts: the server side scripts and the client side
|
are two types of JavaScript scripts: the server side scripts and the client side
|
||||||
scripts. The server side JavaScript, are the scripts that run on the node.js
|
scripts. The server side JavaScript are the scripts that run on the Node.js
|
||||||
runtime, and the client side JavaScript, are the ones that run on user's browser.
|
runtime, and the client side JavaScript are the ones that run on user's browser.
|
||||||
|
|
||||||
In atom-shell we have similar concepts, since atom-shell displays GUI by showing
|
In atom-shell we have similar concepts, since atom-shell displays GUI by showing
|
||||||
web pages, we would have **scripts that run in the web page**, and also have
|
web pages, we would have **scripts that run in the web page**, and also have
|
||||||
**scripts ran by the atom-shell runtime**, which created those web pages.
|
**scripts ran by the atom-shell runtime**, which created those web pages.
|
||||||
Like node.js, we call them **client scripts**, and **browser scripts**.
|
Like Node.js, we call them **client scripts**, and **browser scripts**.
|
||||||
|
|
||||||
In traditional node.js applications, communication between server side and
|
In traditional Node.js applications, communication between server side and
|
||||||
client side are usually done by web sockets. In atom-shell, we have provided
|
client side are usually done by web sockets. In atom-shell, we have provided
|
||||||
the [ipc](../api/ipc-renderer.md) module for browser side to client
|
the [ipc](../api/ipc-renderer.md) module for browser side to client
|
||||||
communication, and the [remote](../api/remote.md) module for easy RPC
|
communication, and the [remote](../api/remote.md) module for easy RPC
|
||||||
support.
|
support.
|
||||||
|
|
||||||
### Web page and node.js
|
### Web page and Node.js
|
||||||
|
|
||||||
Normal web pages are designed to not touch outside world, which makes them not
|
Normal web pages are designed to not touch outside world, which makes them
|
||||||
suitable for interacting with native systems, atom-shell provides node.js APIs
|
unsuitable for interacting with native systems. Atom-shell provides Node.js APIs
|
||||||
in web pages so you could access native resources in web pages, just like
|
in web pages so you could access native resources in web pages, just like
|
||||||
[node-webkit](https://github.com/rogerwang/node-webkit).
|
[Node-Webkit](https://github.com/rogerwang/node-webkit).
|
||||||
|
|
||||||
But unlike node-webkit, you could not do native GUI related operations in web
|
But unlike Node-Webkit, you could not do native GUI related operations in web
|
||||||
pages, instead you need to do them on the browser side by sending messages or
|
pages, instead you need to do them on the browser side by sending messages or
|
||||||
use the easy [remote](../api/remote.md) module.
|
use the easy [remote](../api/remote.md) module.
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ app/
|
||||||
└── index.html
|
└── index.html
|
||||||
```
|
```
|
||||||
|
|
||||||
The format of `package.json` is exactly the same with node's modules, and the
|
The format of `package.json` is exactly the same with Node's modules, and the
|
||||||
script specified by the `main` field is the startup script of your app, which
|
script specified by the `main` field is the startup script of your app, which
|
||||||
will run under the browser side. An example of your `package.json` is like
|
will run under the browser side. An example of your `package.json` is like
|
||||||
this:
|
this:
|
||||||
|
@ -65,7 +65,7 @@ this:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `main.js` should create windows and handle system events, and an typical
|
The `main.js` should create windows and handle system events, and a typical
|
||||||
example is:
|
example is:
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
|
@ -122,12 +122,12 @@ Finally the `index.html` is the web page you want to show:
|
||||||
|
|
||||||
## Run your app
|
## Run your app
|
||||||
|
|
||||||
After done writing your app, you could create a distribution of your app by
|
After you're done writing your app, you could create a distribution by
|
||||||
following the [Application distribution](./application-distribution.md) guide
|
following the [Application distribution](./application-distribution.md) guide
|
||||||
and then execute the packaged app, or you can just use the downloaded atom-shell
|
and then execute the packaged app. You can also just use the downloaded atom-shell
|
||||||
binary to execute your app directly.
|
binary to execute your app directly.
|
||||||
|
|
||||||
On Window:
|
On Windows:
|
||||||
|
|
||||||
```cmd
|
```cmd
|
||||||
$ .\atom-shell\atom.exe path-to-app\
|
$ .\atom-shell\atom.exe path-to-app\
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# Use native node modules
|
# Use native Node modules
|
||||||
|
|
||||||
The native node modules are supported by atom-shell, but since atom-shell is
|
The native Node modules are supported by atom-shell, but since atom-shell is
|
||||||
using a different V8 version from official node, you need to use `apm` instead
|
using a different V8 version from official Node, you need to use `apm` instead
|
||||||
of `npm` to install node modules.
|
of `npm` to install Node modules.
|
||||||
|
|
||||||
The usage of [apm](https://github.com/atom/apm) is quite similar to `npm`, to
|
The usage of [apm](https://github.com/atom/apm) is quite similar to `npm`, to
|
||||||
install dependencies from `package.json` of current project, just do:
|
install dependencies from `package.json` of current project, just do:
|
||||||
|
@ -12,18 +12,18 @@ $ cd /path/to/atom-shell/project/
|
||||||
$ apm install .
|
$ apm install .
|
||||||
```
|
```
|
||||||
|
|
||||||
But you should notice that `apm install module` wont' work because it will
|
But you should notice that `apm install module` won't work because it will
|
||||||
install a user package for [Atom Editor](https://github.com/atom/atom) instead.
|
install a user package for [Atom Editor](https://github.com/atom/atom) instead.
|
||||||
|
|
||||||
## Native node module compability
|
## Native Node module compability
|
||||||
|
|
||||||
Since node v0.11.x, there were vital changes of V8 API, so generally all native
|
Since Node v0.11.x there were vital changes in the V8 API. So generally all native
|
||||||
modules written for node v0.10.x wouldn't work for node v0.11.x, and since
|
modules written for Node v0.10.x wouldn't work for Node v0.11.x. Additionally
|
||||||
atom-shell internally uses node v0.11.9, it carries with the same problem.
|
since atom-shell internally uses Node v0.11.9, it carries with the same problem.
|
||||||
|
|
||||||
To solve it, you should use modules that support both node v0.10.x and v0.11.x,
|
To solve this, you should use modules that support both Node v0.10.x and v0.11.x.
|
||||||
and [many modules](https://www.npmjs.org/browse/depended/nan) do support the
|
[Many modules](https://www.npmjs.org/browse/depended/nan) do support both now.
|
||||||
both now. For old modules that only support node v0.10.x, you should use the
|
For old modules that only support Node v0.10.x, you should use the
|
||||||
[nan](https://github.com/rvagg/nan) module to port it to v0.11.x.
|
[nan](https://github.com/rvagg/nan) module to port it to v0.11.x.
|
||||||
|
|
||||||
## Other ways of installing native modules
|
## Other ways of installing native modules
|
||||||
|
@ -33,8 +33,8 @@ native modules.
|
||||||
|
|
||||||
### The node-gyp way
|
### The node-gyp way
|
||||||
|
|
||||||
First you need to check which node release atom-shell is carrying via
|
First you need to check which Node release atom-shell is carrying via
|
||||||
`process.version` (at the time of writing it is v0.10.5), then you can
|
`process.version` (at the time of writing it is v0.10.5). Then you can
|
||||||
configure and build native modules via following commands:
|
configure and build native modules via following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -43,7 +43,7 @@ $ HOME=~/.atom-shell-gyp node-gyp rebuild --target=0.10.5 --arch=ia32 --dist-url
|
||||||
```
|
```
|
||||||
|
|
||||||
The `HOME=~/.atom-shell-gyp` changes where to find development headers. The
|
The `HOME=~/.atom-shell-gyp` changes where to find development headers. The
|
||||||
`--target=0.10.5` is specifying node's version. The `--dist-url=...` specifies
|
`--target=0.10.5` is specifying Node's version. The `--dist-url=...` specifies
|
||||||
where to download the headers.
|
where to download the headers.
|
||||||
|
|
||||||
### The npm way
|
### The npm way
|
||||||
|
|
Loading…
Reference in a new issue