Using QLPreviewPanel with Electron - node.js

We are looking into migrating our Objc Application to an Electron one, since the native one is just a WebWrapper around a website already.
We are missing one important feature: the ability to use QuickLook to preview files.
We managed to wrap qlmanage (Quick Look Server debug and management tool) in a npm module (based on this older code) but this is not the same as using QLPreviewPanel.
qlmanage launches an app in the Dock, and can spawn multiple instances of it, unlike QLpreviewPanel.
Does anyone managed to use Quicklook properly with Electron?
Is it possible to create a npm module in C++ using the Foundation Framework from Apple, and then requiring this module from Electron?
Any insight would be greatly appreciated.

We ended up adding this feature directly in Electron.
This will be released soon on the BrowserWindow api, with the following method signature:
previewFile(path [,displayname])
This way everyone gets to use it!

Related

React NodeGUI - Question about technology. Choosing Desktop Platform

I estimate possibility to write Report Desktop Application using React NodeGUI. There is some questions what I need to find answer before starting to develop by NodeGUI. Could you help me to figure out.
What way is to load program extension dynamicaly in React NodeGUI. For example: If I want to change business logic and visualization of my program without compile code. Is it possible?
What way is to load program extension dynamicaly in React NodeGUI. For example: If I want to change business logic and visualization of program adding some program module code of other developers. How way is it possible to do?
What way is to work with XML files in React NodeGui?
Is there possibility to run other program code written by C/C++ or other languages? What restriction of running non-native JS modules?
What way is to connect to SQL or NoSQL DB (PostgreSQL, Oracle, Mongo and etc)?
What are reasons yet to write or not write Desktop Applications by React NodeGUI?
React NodeGui is just another npm module that you would install in a nodejs program. It is a pure javascript library. It depends on NodeGui which is another regular npm module. NodeGui contains C++ code which acts as a nodejs addon. But for all purposes think of nodegui and react nodegui as regular npm modules. An app built with these libraries is a regular nodejs app.
What way is to load program extension dynamicaly in React NodeGUI. For example: If I want to change business logic and visualization of my program without compile code. Is it possible?
All business logic is written in javascript so any change in those would follow the same flow of how you would in a nodejs app.
What way is to load program extension dynamicaly in React NodeGUI. For example: If I want to change business logic and visualization of program adding some program module code of other developers. How way is it possible to do?
Yes you can use all npm modules available in npm that works with nodejs.
What way is to work with XML files in React NodeGui?
You can find a lot of npm modules you can use to parse and work with xml files in the npm registry.
Is there possibility to run other program code written by C/C++ or other languages? What restriction of running non-native JS modules?
Yes it is possible to run non js code by building them as NodeJs addons.
What way is to connect to SQL or NoSQL DB (PostgreSQL, Oracle, Mongo and etc)?
You have a lot of modules available in the npm registry for these which work with NodeJs.
What are reasons yet to write or not write Desktop Applications by React NodeGUI?
Reasons to use:
- NodeGui apps are native apps so they get all the benefits of native apps. They are snappy, they are accessible and run with low memory and cpu usage.
Reasons not to use:
Its under development so is only recommended for hobby projects as of Dec 2019.
PS: I am the author of the library

node js - How do I create build for commercial usage?

I am working on node js application and it is now ready to use. I want to make exe of this application so that it can be used for commercial usage.
Up to now I have used enclose module using which I have compiled the code of application but I have found some issues in that (app got crash on idle condition). App is running good without enclose or compiled code.
I have searched on google and found some alternate modules like JXcore, Node webkit and Electron etc. but JX core giving error same as in SO question.
In node web-kit, it's functionality is not looking suitable as we need its executable and some dll's along with our code, which makes our package bulky.
I have also tried jxcore. The main problem with the exe's and with modules that we use is their ability to work with native modules, in my case the Kinect.node module. This module cannot be compiled. We need a workaround to package only this along with our .exe file. Enclose provides this workaround in its inbuilt functionality.
Also looking a response from EncloseJS, which is actually run by just one person who gives further instructions upon purchase. A purchase is needed for commercial usage.
In case of Electron, It is supporting only Electron-based application source code. So If I choose this then I have to modify my application code.
So can any one suggest me what can I do to make exe file from node js code there?
Thank you!
I had the same issue before, the node js application close when running in background. now i am using process manager2 (pm2), it is working fine and if the application is crash due to any other reason it is automatically started again.
I have gotten my answer:
First, reason was DiskDB database, it was not compatible with the node webkit so that is why I was getting error of native modules.
Now I am using sqlite3 module for local database. It is better than DiskDB.
Second, One reason was free version of enclose, Paid version of Enclose JS module ignores the timeout issue which I was getting.
This way I have resolved my question.

Using NodeJS module in Titanium Studio

All, I am trying to using third party NodeJS SDK in Titanium Studio. However, I consistently encounter dependency issues, such as util.js, utils.js, ms.js, events.js etc. I tried to add the missing module manually, but it looks like it will become un-tractable as there are so many dependencies.
My questions are :
1. Is that possible to use NodeJS based SDK in Titanium Studio .
2. If so, what is the right approach to include the dependencies.
Thanks a lot!
Titanium can't get Coffee scripts to work natively (assuming you want to deploy the TitaniumWrapper.coffee). A possible solution you may want to try is hooking a plugin http://billdawson.com/titanium_coffee_script/ in order to pre-compile Coffee scripts.
You can also try to embed everything using a Tiwebview that wraps HTML to load mojio-js.js but you would still need to observe events mojio client (like replacing keys, login an user and create a few model instances).
Hope you find the info useful and can serve for further research.

Desktop applications with Meteor.js

The options I've found for creating desktop applications in HTML, CSS, and JavaScript are:
Electron (formerly Atom-Shell)
NW.js (formerly Node-Webkit)
However, there doesn't seem to be any clear implementation for using meteor.js with these.
NW.js
I've seen some other questions of people asking this, but no implementation. Can't even figure out by the answers what I should be trying to put together:
Meteor leaderboard app on node-webkit
Demeteorizer with node-webkit
How can I start a Meteor instance before launching a node-webkit?
This guys actually got it running but doesn't say how: https://stackoverflow.com/questions/25508737/iron-router-routing-fails-on-reload-in-node-webkit
The idea proposed here is interesting—loading the desktop application completely from the web. However, I would like to allow my users to use the application offline.
Electron
There is an actual implementation, meteor-desktop-app, but it has no clear support for Windows. However, the atom-shell does support Windows just as NW.js does.
Has anyone figured out an implementation to allow meteor.js to operate as a desktop application?
If you drop the code from meteor-desktop-app into Electron Starter, you'll get Windows + Mac + Linux for free, as well as a build system you can definitely use for Real Apps.
Check out mongoclient's scaffold directory, it'll lead you to your electron app if you follow the steps from readme.

Steps to use Nodejs modules like assert and paralleljs with Titanium appcelerator

I want to use the assert and paralleljs modules in mobile apps developed with Titanium Appcelerator. If anyone has used these modules or similar to this, please help me to use these too.
Thanks in advance.
That would be great! The problem I think is that javascript (at least at it's current version) isn't multi-threaded. it's built to be event driven - and if you use event driven well, you can get pretty good performance. What paralleljs does is using web-workers which are not available in Titanium.
What you might be able to to is write some kind of webview that will run the work inside it and report back to Titanium.
Take a look at the following:
How to create multithreading in mobile sdk
Titanium Worker Thread Module
You'll have to test it and see if it's memory/performance efficient.

Resources