From 87e0c812e9de44c96b33a65432decbd012c2d17a Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Mon, 5 Oct 2015 17:48:48 +0300 Subject: [PATCH 1/2] Update native modules doc --- docs/tutorial/using-native-node-modules.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/docs/tutorial/using-native-node-modules.md b/docs/tutorial/using-native-node-modules.md index 0e6477fc4c04..491415b900ac 100644 --- a/docs/tutorial/using-native-node-modules.md +++ b/docs/tutorial/using-native-node-modules.md @@ -6,16 +6,17 @@ the location of Electron's headers when building native modules. ## Native Node Module Compatibility -Since Node v0.11.x there were vital changes in the V8 API. So generally all -native modules written for Node v0.10.x won't work for newer Node or io.js -versions. And because Electron internally uses __io.js v3.1.0__, it has the -same problem. +Native modules might break when Node starts using a new version of V8. +To make sure the module you're interested in will work with Electron, you should +check if it supports the internal Node version used by Electron. +You can check what version of Node is used in Electron by looking it up in +the [releases](https://github.com/atom/electron/releases) page or by using +`process.version` (see [Quick Start](https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md) +for example). -To solve this, you should use modules that support Node v0.11.x or later, -[many modules](https://www.npmjs.org/browse/depended/nan) do support both now. -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 or later -versions of Node or io.js. +Consider using [NAN](https://github.com/nodejs/nan/) for your own modules, since +it makes it easier to support multiple versions of Node. It's also helpful for +porting old modules to newer versions of Node so they can work with Electron. ## How to Install Native Modules From c3cd438d34a265074c2896a688811d5f71f6d60a Mon Sep 17 00:00:00 2001 From: Eran Tiktin Date: Mon, 5 Oct 2015 21:12:29 +0300 Subject: [PATCH 2/2] Replace io.js references with node.js references --- README.md | 2 +- docs/api/native-image.md | 2 +- docs/tutorial/quick-start.md | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index fa122c9b6c6f..94d4c09982be 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ :zap: *Formerly known as Atom Shell* :zap: The Electron framework lets you write cross-platform desktop applications -using JavaScript, HTML and CSS. It is based on [io.js](http://iojs.org) and +using JavaScript, HTML and CSS. It is based on [Node.js](https://nodejs.org) and [Chromium](http://www.chromium.org) and is used in the [Atom editor](https://github.com/atom/atom). diff --git a/docs/api/native-image.md b/docs/api/native-image.md index df2bb96ff9da..097a8130c243 100644 --- a/docs/api/native-image.md +++ b/docs/api/native-image.md @@ -142,7 +142,7 @@ Returns a boolean whether the image is empty. Returns the size of the image. -[buffer]: https://iojs.org/api/buffer.html#buffer_class_buffer +[buffer]: https://nodejs.org/api/buffer.html#buffer_class_buffer ### `image.setTemplateImage(option)` diff --git a/docs/tutorial/quick-start.md b/docs/tutorial/quick-start.md index 94368df09c1c..5300d754a69b 100644 --- a/docs/tutorial/quick-start.md +++ b/docs/tutorial/quick-start.md @@ -2,7 +2,7 @@ Electron enables you to create desktop applications with pure JavaScript by providing a runtime with rich native (operating system) APIs. You could see it -as a variant of the io.js runtime that is focused on desktop applications +as a variant of the Node.js runtime that is focused on desktop applications instead of web servers. This doesn't mean Electron is a JavaScript binding to graphical user interface @@ -22,8 +22,9 @@ multi-process architecture is also used. Each web page in Electron runs in its own process, which is called __the renderer process__. In normal browsers, web pages usually run in a sandboxed environment and are not -allowed access to native resources. Electron users, however, have the power to use -io.js APIs in web pages allowing lower level operating system interactions. +allowed access to native resources. Electron users, however, have the power to +use Node.js APIs in web pages allowing lower level operating system +interactions. ### Differences Between Main Process and Renderer Process @@ -129,7 +130,7 @@ Finally the `index.html` is the web page you want to show:

Hello World!

- We are using io.js + We are using Node.js and Electron .