niminem / neel Goto Github PK
View Code? Open in Web Editor NEWA Nim library for making Electron-like HTML/JS GUI apps, with full access to Nim capabilities.
License: MIT License
A Nim library for making Electron-like HTML/JS GUI apps, with full access to Nim capabilities.
License: MIT License
Please, could you include google-chrome-stable
to this line?
This is the name given i ArchLinux.
Every now and then I glance at this project . the concept seems very interesting , but I see that the project is at a standstill . Has the development been stopped ?
Suggestion : Use Axino widgets instead (or as an alternative to) of HTML + CSS:
Aim:
So, I need threadpool
for my current project.
So, I need to access callJs
from spawn
ed procedure.
So, it fails miserably.
Is it ever possible to use that library with multithreading ?
The code in neel.js (see neel.nim, line 254) for responding to a callJs request will swallow any exception caused by the function being called and make it look like the problem is a JSON parse error. Offending code section:
254 ws.onmessage = (data) => {
255 try {
256 let x = JSON.parse(data.data)
257 let v = Object.values(x)
258 neel.callJs(v[0], v[1])
259 } catch (err) {
260 let x = JSON.parse(data)
261 let v = Object.values(x)
262 neel.callJs(v[0], v[1])
263 }
264 }
If line 256 succeeds and the function called in line 258 then throws an exception, then the catch block attempts to re-parse the whole message as JSON, which fails with Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 2 of the JSON data
and the original exception which was thrown in the try block is lost.
I think this would do the trick:
254 ws.onmessage = (data) => {
255 let x;
256 try {
257 x = JSON.parse(data.data)
258 } catch (err) {
259 x = JSON.parse(data)
260 }
261 let v = Object.values(x)
262 neel.callJs(v[0], v[1])
263 }
Hi,
Is it possible for Neel
be used for a web application?
I would like to make a single executable web application I've seen done in the Go
programming language,
and was wondering if Neel
could be a candidate for these kinds of applications in Nim
.
Thanks
Matic
INFO Jester is making jokes at http://127.0.0.1:5000 (all interfaces)
DEBUG GET /
DEBUG 200 OK {"cache-control": @["no-store"]}
DEBUG GET /main.css
DEBUG 200 OK {"cache-control": @["no-store"]}
DEBUG GET /three.module.js
DEBUG 200 OK {"cache-control": @["no-store"]}
DEBUG GET /GLTFLoader.js
DEBUG 200 OK {"cache-control": @["no-store"]}
DEBUG GET /RoomEnvironment.js
DEBUG 200 OK {"cache-control": @["no-store"]}
DEBUG GET /lil-gui.module.min.js
DEBUG 200 OK {"cache-control": @["no-store"]}
JS:
import * as THREE from './three.module.js';
import { GLTFLoader } from './GLTFLoader.js';
import { RoomEnvironment } from './RoomEnvironment.js';
import { GUI } from './lil-gui.module.min';
Chrome:
GLTFLoader.js:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
RoomEnvironment.js:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
lil-gui.module.min.js:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
three.module.js:1
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.
As far as I understand, I need to set the MIME type on the server, how can I do this? I use three.js .
Hi, thx for the nice lib.
I am using version 0.4.0 + nim 1.4.8
and noticed that example app (also my app) can crash when the page is reloaded frequently.
Either this can be checked in the browser by spamming the F5 button.
Hello, when trying to run a basic example I receive the following error: Error: undeclared identifier: 'callProc'
I get this error:
Downloading https://github.com/Niminem/Neel using git
Verifying dependencies for [email protected]
Info: Dependency on jester@>= 0.5.0 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on httpbeast@>= 0.2.2 already satisfied
Verifying dependencies for [email protected]
Info: Dependency on asynctools@#0e6bdc3ed5bae8c7cc9 already satisfied
Verifying dependencies for asynctools@#0e6bdc3ed5bae8c7cc9
Info: Dependency on https://github.com/timotheecour/asynctools@#pr_fix_compilation already satisfied
Verifying dependencies for asynctools@#pr_fix_compilation
Info: Dependency on ws@>= 0.4.2 already satisfied
Verifying dependencies for [email protected]
Installing [email protected]
Building neel/neel using c backend
�[1m/tmp/nimble_1130/githubcom_NiminemNeel/src/neel.nim(16, 37) �[0m�[31mError: �[0mcannot open file: /tmp/nimble_1130/githubcom_NiminemNeel/src/assets/index.html�[36m�[0m
Prompt: Build failed for '[email protected]', would you like to try installing 'neel@#head' (latest unstable)? [y/N]
Nimble is apparently running your module when installing, please fix this.
UPDATE:
Got this error on linux and windows
Hi!
First of all, thank you so much for this amazing project! It has clearly encouraged me to start using Nim to create simple and shareable apps (still a beginner). Combining Nim's performance with a nice frontend in HTML/CSS/JS is a fantastic idea.
I have successfully created my first app on Linux, which works well. I am still figuring out how to bind C header files and shared libraries to the executable, but that's another subject. Now, I wanted to inquire if there is support for cross-compilation from Linux to Windows using Nim. According to the Nim Compiler User Guide, I tried to compile my app into a Windows executable using the following command:
nim c -d:mingw --threads:on --mm:orc --app:gui -d:release main.nim
This command successfully creates a main.exe
binary. However, when I try to run it on Windows, I encounter a black screen with the following error message (translated from French):
"This page does not work
Impossible to process this request via localhost at this time.
HTTP ERROR 500"
I have also attempted to compile the "filepicker" example, which works perfectly when compiled for Linux but encounters the same problem when compiled for Windows. Am I doing something wrong, or is cross-compilation not supported (yet)?
Thanks in advance
If an exposeProc
uses try/except and then calls callJs
from within the except
block, the app crashes with a segfault.
Try this:
exposeProcs:
proc tryExcept() =
try:
raise newException(CatchableError, "Oh no!")
except:
callJs("reportException", "except")
I'm not sure this is an issue with Neel so much as with Nim itself, but I figured it'd be better to point it out. What's going on here and how does one handle this?
I just started checking out these projects, but I'm thinking they might make a killer Nim project if put together. I'm thinking GraBulma and Nim would be good for building CrossBrowdy modules, and then using Neel to ship the clients? I'm going to check with the other developers to see what they think, but I thought I'd start here.
I'm having a problem which I'll file a separate issue for, but I'm not getting any pages to show up in Neel. I'm also not seeing any errors.
I know it's still early in the development cycle, but I'd thought I'd just check. It might be because I'm using a Mac.
https://crossbrowdy.com
https://github.com/juancarlospaco/grabulma
Hi @Niminem , thanks for the work, it was quite easy to get started with neel.
I have a problem though. The communication from backend to frontend seems to be very slow (or something that should not be blocking is blocking)
I have created tried to create a simple paint on canvas app, that catches the mouse move event on the frontend, sends the coordinates to backend, which prints them out and tells front end to paint them on the canvas. (Obviously redundant, just for the sake of the example.)
The coordinates are printed out immediately, when I comment out the call to frontend, with the call in place, large delays occur (multiple seconds). To make sure it is not the function itself, I have replaced it with an empty function on the front end side, and it had the same effect.
Environment
Nim 1.4.2 / Windows 10 ver. 2004 / Neel 0.2.7
Problem
My home and work PCs have two drives (C: is an SSD, D: is an HDD). If I run a Nim application that uses Neel on the drive that has Chrome installed, it runs. If I try it from the other drive, it fails.
i.e. from C:\temp\blah.exe - the executable runs (since Chrome is installed on the C: drive)
from D:\temp\blah.exe - I get the following error in a dialog box:
neel.nim(182) findChromeWindows
Error: unhandled exception: could not find Chrome in Program Files (x86) directory [CustomError]
I suspect the logic for detecting Chrome's install location in Neel needs to be beefed up.
Possible solution:
It may be possible to check the Windows registry to find the Chrome install location if the current logic can't find the exe. A quick check of Stack Overflow suggested the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe
I don't know if this registry key is always there/is the 'official' one but it exists on my Windows 10 install and points to the Chrome install folder.
Also, thanks for creating Neel! I've tried other Nim webview components and yours was the first that let me complete a small utility I needed.
Hi. Great project. Is there any chance you could use webview instead of or in addition to Chrome?
https://github.com/oskca/webview
Thanks.
Hi,
Trying to compile the filePicker.nim
give the following error:
C:\Users\someuser\.nimble\pkgs\neel-0.2.7\neel.nim(6, 20) Warning: inherit from a more precise exception type like ValueError, IOError or OSError. If these don't suit, inherit from
CatchableError or Defect. [InheritFromException]
C:\Users\someuser\.nimble\pkgs\jester-0.5.0\jester.nim(1298, 9) Hint: Asynchronous route: theRouter. [User]
C:\Users\someuser\Desktop\Neel-master\examples\filePicker.nim(21, 9) template/generic instantiation of `startApp` from here
C:\Users\someuser\.nimble\pkgs\neel-0.2.7\neel.nim(241, 16) template/generic instantiation of `router` from here
C:\Users\someuser\.nimble\pkgs\jester-0.5.0\jester.nim(1304, 35) template/generic instantiation of `async` from here
C:\Users\someuser\.nimble\pkgs\neel-0.2.7\neel.nim(292, 88) Error: type mismatch: got <string, proc (req: Request): string{.noSideEffect, gcsafe, locks: 0.}>
but expected one of:
proc `/`(head, tail: string): string
first type mismatch at position: 2
required type for tail: string
but expression 'path' is of type: proc (req: Request): string{.noSideEffect, gcsafe, locks: 0.}
3 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
expression: getCurrentDir() / "web" / path
Any ideas on how to solve this?
Specs:
i have this macro based code that allows you to automatically generate types for procedures, as well as generating calling lambdas for these procedures that simply accept a string and then convert it via json to a function argument object. i wrote this myself in 2 days, and i can share it with you if you need it. i wrote it for my webview2 bindings.
Hi great project you have here I am new to github in general and I want to help contribute to this project. Do you have any new features that needs implementation if so I would love to help implement them.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.