Giter VIP home page Giter VIP logo

nim-webui's People

Contributors

clzls avatar hassandraga avatar konsumer avatar neroist 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

nim-webui's Issues

hello_world.exe crashes no matter what pwd is used

I am using latesed cloned webui4nim and webui. I have copied webui\include\*.h to this webui4nim
So I can generated hello_world.exe in MSYS2+Mingw64 on my windows 10 64bits with just nim c -r hello_world.nim

hello_world.exe can be lauched. However, no matter what password is used, when I click "check password", it crashed. But as we know, some message should be printed in MSYS2 console

Can't build examples if cloning nonrecursive

When I tried to test the examples, I manually cloned this repo, but because of nim.cfg, the compiling failed.

C:\Users\...\webui-main\examples>nim c -d:useWebviewStaticLib call_nim_from_js.nim
Hint: used config file 'C:\Nim\config\nim.cfg' [Conf]
Hint: used config file 'C:\Nim\config\config.nims' [Conf]
Hint: used config file 'C:\Users\...\webui-main\examples\nim.cfg' [Conf]
............................................................................................
C:\Users\...\webui-main\webui\bindings.nim(76, 12) Error: cannot find: ./webui/src/mongoose.c

Copying the example folder outside of the repo folder will work. Also, just removing nim.cfg works too.

Regular cloning (nonrecursive) tries to rebuild webui.c instead of using the already installed one.

Some thought about crashes when calling js from Nim

Similar to #5 , I went into some crashes when working with hello_world.nim using Nimble package.
In devel mode it crashes silently when clicked, in release mode it works but sometimes it still crashes.
I tried to change webui.nim:261 from

data = buffer.join().strip(leading = false, chars = {'\x00'})

to

data = $(cast[cstring](addr buffer[0]))

Then it seems to work smoothly, with thread:off. Not tested much and not using nightly build, but I want to note it here for others who is willing to make further investigations about it.

My env: Nim Compiler Version 1.6.12 [Windows: amd64]

New `bindJs` template?

It would be cool to have some kind of "bindJS" template, where it takes the given Nim code and transpiles it to JS to then binds the generated JS code to the id.

TLS Support

The next version 2.4.0 will include TLS Encryption between the GUI and the Nim application. This will make compiling WebUI from the source more challenging for the Nim wrapper.

I suggest making the Nim wrapper using the static pre-built library which makes things very easy as it does not need to compile WebUI from the source.

can't install with nimble (mongoose.h)

Possibly related to #2

I am on OSX (M1) Ventura 13.3, nim 1.6.10, nimble 0.13.1

I can do nimble install webui without error, but not track it as a dependency in my project.

If I add this to my nimble file:

requires "https://github.com/neroist/webui.git"

or:

requires "webui >= 0.2.1"

I get this, when I try to nimble run:

/Users/konsumer/.nimble/pkgs/webui-0.2.1/webui/webui/src/mongoose.c:20:10: fatal error: 'mongoose.h' file not found
#include "mongoose.h"
         ^~~~~~~~~~~~

write meaningful commit messages

As a new user trying to understand the state of this library, the commit messages have been a significant impediment. The six most recent commit messages are indicative of the difficulty.

updateee
beta
event
at procs
submodule
.

Commit messages that summarize what has changed and why would be greatly appreciated. The article How to Write a Git Commit Message might be a useful guide to follow.

Frontend framework support

See this: webui-dev/webui#109
I tried to do as I was advised by @AlbertShown, or rather change the path imports of all js/and css scripts in the html file to out/path instead of path, but it had exactly no effect.

Error receiving script files for current html
image
But this script's located right
image

Right now my page looks like this when I export HTML from React through NextJS
image
But it should be like this:
image

Exported this page to github pages is: https://griffith1deady.github.io/languages

Minimal code for error is:

import std/os, webui

var window: Window

proc main = 
  window = newWindow(1)
  window.runtime = NodeJs
  window.show("languages.html")
  wait()

setCurrentDir(currentSourcePath().parentDir() & "/out")

main()

All source files with pages & resources, more precisely exporting my site https://github.com/griffith1deady/griffith1deady.github.io packed in an archive:
NIM.zip

Also, you may notice some visual differences between my resources and those on the work site: all this is because I just used earlier commits.

Do I think something is just blocking the distribution of files?

text_editor.nim says undeclared field: 'rootFolder='

I am using nim in MSYS2+MINGW64 on windows 10 64 bits. I installed webui via nimble install webui

$ nim --version
Nim Compiler Version 1.9.3 [Windows: amd64]
Compiled at 2023-06-16
Copyright (c) 2006-2023 by Andreas Rumpf

git hash: 77beb152141f0efe4d5c93b784e42f973ba46551
active boot switches: -d:release

I can compile
when I try and run nim-webui-main\examples\hello_world.nim without problem. But for nim-webui-main\examples\text_editor\src\text_editor.nim, I get

C:\tmp\candel\src\text_editor.nim(43, 21) Error: undeclared field: 'rootFolder=' for type we
bui.Window [type declared in C:\Users\USER\.nimble\pkgs2\webui-2.3.0.1-4945446001c8ab19a5f
9fbcbf1d771b9da4a324e\webui.nim(13, 3)]

Website

I suggest removing the website folder and keep it only in the webui repo, because it has the FTP auto deploy so we can have only one official online documentation that has all the APIs.

https://webui.me/docs/#/

Version

I suggest we keep all repos in the same version. For example, WebUI is now on v2.3.0, so all repo releases should be on the same version v2.3.0. And if any bug fix happens only on that repo, then we publish 2.3.0.1, 2.3.0.2 etc... I did that with Go and Python so I can easily know what version of the WebUI library is used.

WebUI v2.2.0

WebUI v2.2.0 is ready for release.

Big changes:

  1. Now, webui.h it's become more straightforward and smaller and optimized for wrapper creation
  2. webui_show() will replace webui_open() and webui_new_server()
  3. webui_window_t struct becomes a simple void*
  4. To solves the complexity of memory leaks when executing JS, now, the wrapper creates a local buffer and passes it to webui_script()
  5. All core internal functions are removed from webui.h

To create the new Nim wrapper, run c2nim webui.h. And remove all other functions from the old version v2.1.1.
After that, we will start creating more big software in Nim as an example (Text editor, Media Player, Database viewer...), which will be very exciting to explore and learn new things!.

If you have any questions, please don't hesitate to ask me here.
Thank you for maintaining the WebUI Nim wrapper. I appreciate it ๐Ÿ‘

Showing images in tha app

I started using your library. It's quite nice, but i have a problem. I tried to create an image gallery. If the images are in the main app folder(where the exe file is) or, starting from the main app folder, in a sub folder they are shown. If instead the images are in another folder the images don't appear. How can i solve this problem? I cannot put all the images in the app folder. I tried to use file:// protocol and also ../../ relative path but nothing works

mwindows mode

I test the Nim wrapper. It's working perfectly ๐Ÿ‘
I suggest adding -mwindows into the linking command in bindings.nim to hide the terminal window in the final executable.

image

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.