All Projects → frankhale → Nwjs Edge Example1

frankhale / Nwjs Edge Example1

Licence: gpl-3.0
An example using Edge in NW.js directly from the DOM

Programming Languages

javascript
184084 projects - #8 most used programming language
csharp
926 projects

Projects that are alternatives of or similar to Nwjs Edge Example1

Ionic3 Angular43 Httpclient
Example of Ionic 3 and the new Angular 4.3 HTTPClient
Stars: ✭ 20 (-47.37%)
Mutual labels:  example
Extending Tea
Example of an extension to The Elm Architecture
Stars: ✭ 30 (-21.05%)
Mutual labels:  example
Rxjava Android Samples
Learning RxJava for Android by example
Stars: ✭ 7,520 (+19689.47%)
Mutual labels:  example
Space rocks
Asteroids-like game made with Godot Engine 3.0.
Stars: ✭ 20 (-47.37%)
Mutual labels:  example
Generals.io Node.js Bot Example
An example Node.js bot for generals.io. Learn more at http://dev.generals.io/api#tutorial
Stars: ✭ 28 (-26.32%)
Mutual labels:  example
Pixar raytracer
Ported to Rust from https://mattwarren.org/2019/03/01/Is-CSharp-a-low-level-language/
Stars: ✭ 31 (-18.42%)
Mutual labels:  example
Chill Netcat
UDP-only netcat implementation with OCaml / MirageOS
Stars: ✭ 13 (-65.79%)
Mutual labels:  example
Kitchen In Travis
Chef cookbook example to run test-kitchen inside Travis CI.
Stars: ✭ 36 (-5.26%)
Mutual labels:  example
Workcation
How to use Inertia.js to build a Vue.js frontend within a Ruby on Rails application
Stars: ✭ 28 (-26.32%)
Mutual labels:  example
Limbobyexample
Examples for the Limbo Programming Language
Stars: ✭ 34 (-10.53%)
Mutual labels:  example
Duckietv
A web application built with AngularJS to track your favorite tv-shows with semi-automagic torrent integration
Stars: ✭ 942 (+2378.95%)
Mutual labels:  nwjs
Pwa Example
A short example illustrating some essential steps for creating a progressive web app (PWA).
Stars: ✭ 28 (-26.32%)
Mutual labels:  example
Terraform Sqs Lambda Trigger Example
Example on how to create a AWS Lambda triggered by SQS in Terraform
Stars: ✭ 31 (-18.42%)
Mutual labels:  example
React Native Npm Version
Example of React-Native application with version from package.json and npm version bump.
Stars: ✭ 20 (-47.37%)
Mutual labels:  example
Golang Docker Build Tutorial
A template project to create a minimal Docker image for a Go application
Stars: ✭ 36 (-5.26%)
Mutual labels:  example
React Redux Boilerplate Example
Stars: ✭ 15 (-60.53%)
Mutual labels:  example
Suicrux
🚀 Ultimate universal starter with lazy-loading, SSR and i18n. [not maintained]
Stars: ✭ 958 (+2421.05%)
Mutual labels:  example
Figmagic Example
Using Figmagic (simplifying design token generation and asset extraction) with Webpack 5, React 16, Styled Components.
Stars: ✭ 37 (-2.63%)
Mutual labels:  example
Elementarypython
Python application template for elementary OS.
Stars: ✭ 36 (-5.26%)
Mutual labels:  example
Adhokku
A toy PaaS
Stars: ✭ 32 (-15.79%)
Mutual labels:  example

#nwjs-edge-example (Edge directly from DOM)

An example usage of NW.js and Edge.JS. This code calls a function inside a .NET class library from the DOM.

NWJS-Edge-Example-Screenshot

Having Trouble Building Edge for NW.js?

There are a lot of things that can go wrong preventing this example from working. For example, new NW.js builds containing Node versions that are not yet supported by Edge. Additionally getting a build environment setup on Windows can be challenging and difficult.

If you cannot get Edge built to work directly in NW.js then you may want to look at my new example which demonstrates using Edge from NW.js via spawning a regular Node process and interacting with it via Socket.IO. This allows for shipping a known good version of Node that Edge supports while preventing the complexities of building Edge for NW.js.

https://github.com/frankhale/nwjs-edge-example2

Usage

NOTE: Need NW.js?

  • Clone or download a zip of this repository
  • Unzip into it's own folder (assuming folder named edge-test-app)
  • Unzip NW.js
  • Copy nw-edge-example folder to NW.js folder
  • Open command prompt to the NW.js folder
  • Follow build instructions below to build the module
  • Run using the command: nw nw-edge-example

C# Class Library

The SimpleLibrary.dll is built from the Hello.cs source file. I've omitted the Visual Studio project to build this from this repository. This library only contains one function as noted in the Hello.cs. Notice the function signature is special because by default Edge.JS wants to call asynchronous methods so it does not block the Javascript engine.

If you want to see more examples of using Edge.JS please see it's Github repository located at:

https://github.com/tjanczuk/edge

Development

Building Edge.JS for NW.js

Edge.JS has to be rebuilt using nw-gyp in order for it to work from within NW.js.

NOTE: By default Edge.JS is built using node-gyp and only works within Node.JS.

Things you need in order to build Edge.JS for use within NW.js:

  • Visual Studio 2013
  • Python 2.7.x
  • Node.JS 5.x
  • nw-gyp (npm install -g nw-gyp)

Next, open a command prompt to your source code directory and install the Edge.JS module using npm:

Create a folder on your desktop (for illustration call it my-app) and copy the Node-Webkit runtime files to it.

Next open a command prompt to the my-app folder and install the Edge.JS module:

c:\>cd my-app
c:\my-app>npm install edge

This will create a node-modules folder and then install edge into that folder. Now we need to recompile Edge using nw-gyp (instead of node-gyp which it is built with by default).

c:\my-app\>cd node_modules\edge
c:\my-app\node_modules\edge>nw-gyp configure --target=v0.13.3 --msvs_version=2013 --arch=x64
c:\my-app\node_modules\edge>nw-gyp build

Once the build finishes, the new module will be in:

c:\my-app\node_modules\edge\build\Release

Copy edge_coreclr.node and edge_nativeclr to: (depending on your architecture, I built against x64)

c:\my-app\node_modules\edge\lib\native\win32\x64\5.1.0

Author(s)

Frank Hale <[email protected]>
30 May 2016

License

GNU GPL v3 - see LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].