Using ES6 on Electron app with io.js - electron

I am writing cross-platform application with electron.
I want to be enable ES6 arrow-function feature in main process using like iojs --harmony_arrow_functions.
Electron already installed successfully on io.js 3.1.0 .
How I can do it with io.js?

If you go to the electron releases, in major/minor release notes you can see which version of nodejs it is using:
https://github.com/atom/electron/releases/tag/v0.36.0
Upgrade to Node 5.1.1.
I'm not totally sure which version of node arrow functions first became available but I can confirm that they are available in the latest version, 5.2.0.
Relatedly, to easily switch between versions of node I highly recommend using nvm:
https://github.com/creationix/nvm
That way you can easily switch to match updated versions of electron and you can automate it quite easily as well.

Electron was switched to nodejs, currently 5.1 see here - https://github.com/atom/electron/releases/tag/v0.36.0

Related

How to check if electron app is running a portable build?

I build an electron app that will be distributed as both portable and installable version.
I added electron-updater to get the installed version automatically updated. I see that portable version is downloading the update as well, even though it cannot update.
I am looking for a function isPortable() in electron to switch off autoupdater in portable app. For now i found out that I can check process.env.PORTABLE_EXECUTABLE_DIR for directory but I wonder if there is more straightforward option.

How do I build and install an electron app for raspbian using appimage

I am working on creating an electron appimage for my raspberry pi 4 to use in my car. I want to be able to use auto-updates from electron-builder so that I wont have to take apart the R-PI every time I want to update it.
I have come across many articles,
https://itsfoss.com/use-appimage-linux/
https://www.youtube.com/watch?v=KiehhZ6Wb-4
saying that you can go to the file properties and check "execute file as program" but this is not the case for raspbian. Raspbian does not have this option in its file properties.
It could be how I am building and releasing my program. For more information, here is the project I am working on: https://github.com/bomeers/Piro/releases/tag/v0.0.3
and here is the source code: https://github.com/bomeers/Piro/tree/dev
Is it even worth using electron? Should I choose Qt (python) instead? Anything helps, thanks!
I have been building and running Electron Apps in AppImage format on Raspbian for quite a while and it (mostly) works without any issues. Some advice however:
If possible use the latest Raspbian "Buster" as previous versions can not properly build recent versions of Electron due to a glibc issue
Set the proper target armv7l, this (currently) still applies to the RPI 4
Use at least Electron version 5.0.10 as previous versions of the 5.x branch had a weird issue of AppImage format Apps crashing when you clicked any menu item
If you build your App using electron-builder you may need to manually add a working version of mksquashfs as described here
Other than that I never found any issues and it works just fine on Raspberry 3 / 3+ and 4.
* Edit *
An example how to configure the build target for Linux / Raspberry 4 in package.json:
linux: {
target: {
target: 'appimage',
arch: ['armv7l']
}
}

Change Dart VM version

I want to use the stable release of the sdk, which should be 2.2.0, but when I in the console check the version with the command "dart --version", it says I am running "Dart VM version: 2.1.0".
I have tried to upgrade via choco, and it says that I already have 2.2.0 installed.
Do I have multiple versions av Dart installed and can switch between them?
If so, can I set a default version?
I'll just mark this as answered with the comment of jamsdlin, as it was the correct answer for me.
When you run dart, you'll run whichever dart binary is found first in your search PATH. You have multiple versions installed. Uninstall the old version or modify PATH so that the location for 2.2.0 occurs first.

Upgrading Cordova 1.9 to 2.0 version

I need to upgrade my application which is using Cordova 1.8 version to Cordova 2.0 version. I followed the steps mentioned in the http://cordova.apache.org/docs/en/2.8.0/guide_upgrading_ios_index.md.html. My application's running for 1.9 but when am trying to upgrade it to 2.0 version am not able to find 'Preprocessor Macro' in build setting.
Also I am not able to find 'CordovaLib' folder, but in the 10th step they have mentioned related to PreprocessorMacro which am not able to find.
As you main motivation seems to be up to date with the last version of Cordova, I would recommend to create a new clean project with Cordova 2.8 and import your html files in the www folder.
Upgrading version by version is painful and you will not get any benefits from it. However, you might not get any performance improvement but you will get a better support from the community.

Upgrade Phonegap for iOS (from 1.4.1 to latest)

I would like to know if anyone has experience in upgrading phonegap. Would like to get some help.
I have an iOS Phonegap-based project that uses phonegap 1.4.1.
I need to update it to the latest version. The latest version is currently 2.2.0
The steps that described in the phone gap document only tells us how to upgrade from one version to the other, but it doesn't help me in upgrade phone gap from a very old version to the latest one.
http://docs.phonegap.com/en/2.2.0/guide_upgrading_ios_index.md.html#Upgrading%20Cordova%20iOS
I can see three BIG changes from 1.4.1 to the latest version.
From 1.4.1 to 1.5.0, PhoneGap.framework has been renamed to Cordova.framework
From 1.9.0 to 2.0.0, Cordova.framework has been removed, instead it uses CordovaLib as a sub-project.
From 2.0.0 to 2.1.0, Automatic Reference Counting (ARC) is introduced to CordovaLib
I am not sure what is the best approach for me to upgrade my old phonegap, I don't feel confident to jump straight from 1.4.1 to 2.2.0, by given the fact that there is no documents/tutorials to follow.
I am thinking to upgrade the phonegap from 1.4.1 to 1.9 first, and then upgrade 1.9.0 to 2.0.0 and to 2.2.0. But it seems a big job.
Please give me some suggestion on it, or is there anyone come across this?
Thanks in advance.
My recommendation is:
Create a totally new project.
Copy your www assets into the new www
Refer to the new cordova .js file in your index.html
Re-add your Plugins (make sure the plugins support the new Cordova version)
Update your Cordova.plist settings to reflect what you want, see the Project Settings on http://docs.cordova.io
Update your whitelist, see the Whitelist Guide on http://docs.cordova.io
It's really depends on how much your app hooks into the phonegap's "native" calls,..
If it's mostly your own codes, I'd just start a new project and copy the html folder over, find and replace the mentions phonegap.js to cordova.js. Chances are, the app will work, if it doesn't, it should be a minor fix.
Or check out https://build.phonegap.com/ - phonegap's cloud base builder.

Resources