Code Monkey home page Code Monkey logo

nodegui / qodejs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nodejs/node

29.0 29.0 10.0 811.47 MB

Qode is a lightly modified fork of Node.js that allows injecting a third party event loop alongside Node's event loop. It is designed to be used together with `@nodegui/nodegui` and Qt

Home Page: https://nodegui.org/

License: Other

JavaScript 59.44% Makefile 0.26% Shell 0.20% R 0.03% HTML 0.80% C++ 24.48% Python 11.63% C 2.57% DTrace 0.18% Roff 0.05% Batchfile 0.21% Emacs Lisp 0.07% Perl 0.06% Assembly 0.01% Objective-C++ 0.01% TypeScript 0.01%
nodejs qode qt

qodejs's Introduction

NodeGui

All Contributors JS Party #96 Build and Test status Discuss on GitHub

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling.πŸš€

NodeGUI is powered by Qt6 πŸ’š which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.

If you are looking for React based version, check out: React NodeGUI.

If you are looking for Vue based version, check out: Vue NodeGUI.

If you are looking for Svelte based version, check out: Svelte NodeGUI

Visit https://nodegui.github.io/nodegui for docs.

logo

How does it look?

demo_linux demo_win demo_mac
kitchendemo_macdemo_win

Code Examples

https://github.com/nodegui/examples


Features

  • 🧬 Cross platform. Works on major Linux flavours, Windows, and MacOS.
  • πŸ“‰ Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
  • πŸ’… Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
  • βœ… Complete Nodejs API support (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
  • πŸŽͺ Native widget event listener support. Supports all events available from Qt / NodeJs.
  • πŸ’Έ Can be used for Commercial applications.
  • πŸ•΅οΈβ€β™‚οΈ Good Devtools support.
  • πŸ“š Good documentation and website.
  • πŸ§™β€β™‚οΈ Good documentation for contributors.
  • πŸ¦ΉπŸ»β€β™€οΈ Good support for dark mode (Thanks to Qt).
  • πŸ…First class Typescript support. (Works on regular JS projects too πŸ˜‰).

Getting Started

Installation

To install latest stable release:

npm install @nodegui/nodegui

To install the latest version available on master branch:

npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz

or a shorter version:

npm i http://master-release.nodegui.org

If the installation fails to download the Qt binaries, a mirror can be used by setting the following environment variable and running the install command again:

QT_LINK_MIRROR=<alternative domain> # eg. QT_LINK_MIRROR=https://qt-mirror.dannhauer.de

npm install @nodegui/nodegui

See FAQs for more details.

Community guides

Talks/Podcasts

Docs for contributing

It is easier than you think, try it

Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: Contributing developer docs.

Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md

Building from source

This section is useful for those wanting to work on NodeGui itself.

Required tooling

NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT. Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/

TL;DR:

MacOS

brew install cmake
brew install make

Windows

https://cmake.org/download/

Linux (Debian/Ubuntu)

sudo apt-get install pkg-config build-essential
sudo apt-get install cmake make
sudo apt-get install mesa-common-dev libglu1-mesa-dev

Linux (Fedora/RHEL/CentOS)

sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf groupinstall "C Development Tools and Libraries"
sudo dnf install mesa-libGL mesa-libGL-devel

Building

Once you have cloned this git repository, run this to build:

npm install
npm run build

The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.

Using your own custom Qt installation (Optional)

Compiling Qt from source

You will need to download and install Qt from source since there are no binaries from Qt for M1 yet.

(https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/)

git clone git://code.qt.io/qt/qt5.git qt6
cd qt6
git checkout 6.6

./init-repository --module-subset=essential -f
git submodule init qtsvg
git submodule update qtsvg

cd ..
mkdir qt6-6.6-macOS-release
cd qt6-6.6-macOS-release

../qt6/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d  -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation  -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript

make -j15

make install

This should install Qt into something like this /usr/local/Qt-6.6.0 (your directory can change. This will be displayed when running make)

Pointing nodegui to use your custom Qt installation

Now just set export QT_INSTALL_DIR=<your qt path> . In the above example it would look something like this export QT_INSTALL_DIR=/usr/local/Qt-6.6.0. Add this in your .zshrc or .bashrc so that you dont need to repeat this process again.

Now just rm -rf node_modules and do npm install again.

The logs should say something like CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation.

Running example programs

A number of small programs to show different parts of the Qt API are in src/examples. They can be run directly with:

npm run qode dist/examples/modelview_1_readonly.js

Updating docs

npm run docs

then followed by:

cd website && GIT_USER=<your_git_username> yarn deploy

Funding

NodeGui is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi. Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.

Buy Me a Coffee at ko-fi.com Β  Β issuehunt

Special Thanks

Code of Conduct

https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md

License

MIT

Backers πŸš€

Thanks goes to these wonderful people.

Yuriy Yazlovytskyy
Yuriy Yazlovytskyy
John Susek
John Susek
Marc Dijoux
Marc Dijoux
Stephen Belanger
Stephen Belanger
Rustam
Rustam

Maintainers ✨

People maintaining this project.

Atul R
Atul R
Simon Edwards
Simon Edwards

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Lucas Ramage

πŸ“–

Denis Sikuler

πŸ“–

Nahuel JosΓ©

πŸ’¬

Kakul Gupta

πŸ’»

Rahul Gaba

πŸ’»

PaweΕ‚ Borecki

πŸ’»

Marcus S. Abildskov

⚠️

Átila Camurça Alves

πŸ“–

James Hibbard

πŸ’»

Soonwoo Hong

πŸ’»

Roy Sommer

πŸ’»

Paulo Coghi

πŸ€”

Balthild Ires

πŸ’»

Dimitar Nestorov

πŸ’»

Mikko Sairio

πŸ’»

Pepijn

πŸ’»

slidinghotdog

πŸ’»

Bundyo (Kamen Bundev)

πŸ’»

feng8848

πŸ’»

Maksim Karelov

πŸ’»

mspencer92

πŸ’»

blncd2020

πŸ“–

gluaxspeed

πŸ’»

Solant

πŸ’»

Shubham Zanwar

πŸ’»

Singha360

πŸ’»

Mihkel

πŸ’»

Stephen A

πŸ’»

桁君酱

πŸ’»

Adam Gastineau

πŸ’»

swittk

πŸ’»

craftingmod

πŸ’»

Doug Barbieri

πŸ’»

HENRIQUE DE SOUZA NERY

πŸ’»

Ruslan Garifullin

πŸ’»

Ranieri

πŸ’» πŸ“–

Nathanael Anderson

πŸ’»

Ross

πŸ’» πŸ“–

4h7l

πŸ’»

Maks

πŸ’»

zhb124404

πŸ“–

Wyatt Kirby

πŸ’»

Steven Koch

πŸ’»

Simon Edwards

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

qodejs's People

Contributors

addaleax avatar aduh95 avatar apapirovski avatar bnoordhuis avatar bridgear avatar cjihrig avatar danbev avatar indutny avatar isaacs avatar jasnell avatar joyeecheung avatar lpinca avatar mhdawson avatar mscdex avatar mylesborins avatar piscisaureus avatar refack avatar richardlau avatar ronag avatar rvagg avatar ry avatar sam-github avatar shigeki avatar targos avatar tjfontaine avatar tniessen avatar tootallnate avatar trevnorris avatar trott avatar vsemozhetbyt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qodejs's Issues

HTTP server running with qode cannot accept incoming connections

Version

No response

Platform

macOS

Subsystem

No response

What steps will reproduce the bug?

Run this with Qode environment:
require('http').createServer(function (req, res) { res.end('OK'); }).listen(3000);

The http server can accept local connections but not connections from other computer inside the same LAN. If we run with node instead of qode, this http server can accept all connections.

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

HTTP connections from external IPs are not accepted

Additional information

No response

No linux arm64 support

npm install fails on debian 11 (bullseye) with

οΏ½[KοΏ½[?25hnpm ERR! code 1
npm ERR! path /home/darko/GitHub/nodegui-starter/node_modules/@nodegui/qode
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Error while setting up Qode:  Error: Error while downloading Qode v16.4.0:https://github.com/nodegui/qodejs/releases/download/v16.4.0-qode/v16.4.0-qode-linux-arm64.tar.gz. Not Found
npm ERR!     at download (/home/darko/GitHub/nodegui-starter/node_modules/@nodegui/qode/src/downloader.js:33:11)
npm ERR!     at processTicksAndRejections (node:internal/process/task_queues:96:5)
npm ERR!     at async setupQode (/home/darko/GitHub/nodegui-starter/node_modules/@nodegui/qode/src/setup.js:19:3)
npm ERR!     at async main (/home/darko/GitHub/nodegui-starter/node_modules/@nodegui/qode/install.js:7:5)

Command failed

Tried to run nodegui-starter and got this error:

error D:\mlp-mpv\nodegui-starter\node_modules\@nodegui\qode: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: D:\mlp-mpv\nodegui-starter\node_modules\@nodegui\qode
Output:
Error while setting up Qode:  Error: Error while downloading Qode v16.4.0:https://github.com/nodegui/qodejs/releases/download/v16.4.0-qode/v16.4.0-qode-win32-ia32.tar.gz. Not Found
    at download (D:\mlp-mpv\nodegui-starter\node_modules\@nodegui\qode\src\downloader.js:33:11)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async setupQode (D:\mlp-mpv\nodegui-starter\node_modules\@nodegui\qode\src\setup.js:19:3)

Allow packaging scripts onto qode executables

Right now, projects packaged using nodegui/packer still run the REPL by default when executed with no target script. This is undesirable behaviour, obviously, and the lack of clarity around that behaviour has spawned many issues on the packer project, so there clearly needs to be some way to override that behaviour in the qode executable for packaged applications. Particularly on Windows, the change to the windowing system causes the executable to run the REPL while having no stdio, causing a non-interactive and essentially dead process that must be manually killed.

One method would be to allow for simply catenating a script onto the executable, which could be the entire application script, or simply a loader for some external resources (loose scripts, ASAR archives, whatever the user wants) and having qode automatically execute this script if present, rather than invoking the REPL.

Another approach would be to try creating qode executables integrating the patches from pkg, potentially allowing leveraging pkg to build executables with packaged scripts and resources on top of the Qodejs binary instead of Nodejs. This would have a huge number of other benefits, such as bytecode execution, asset packing, default flags, and so on. Executables built with these patches cannot be easily used for development, however, so separate builds of qode for development and use in packaging would be needed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.