NiceGUI vs. JustPy #247
Closed
falkoschindler
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have been asked what makes NiceGUI preferable to JustPy. In this thread we'd like to summarize our thoughts about NiceGUI's advantages over JustPy.
More recent version of Vue, Quasar and Tailwind
NiceGUI is based on Vue 3, Quasar 2 and Tailwind 3.
JustPy, in contrast, still uses Vue 2, Quasar 1 and Tailwind 2.
Especially for Vue 2 active support ended in early 2022. We think it is crucial to build upon a more recent web framework.
Simple yet extensible UI API
NiceGUI focusses on a simple and easy-to-use API that ideally doesn't require prior knowledge of HTML and web development. But it's still very extensible with custom elements, attributes, events and new components.
As an example, a "Hello World" app is only three lines with NiceGUI. But it can also be used to build complex user interfaces and websites like nicegui.io itself.
Layout API based on nesting
As discussed in an earlier comment there are several approaches for describing layout in code:
Implicit nesting via scopes
We wanted NiceGUI to be an intuitive API for creating user interfaces. UIs are typically hierarchically organized and markup languages like HTML reflect that visually:
That's why we wanted a UI description with NiceGUI to have a similar form:
JustPy, on the other hand, becomes tricky to read when nesting UI elements:
(Sure, you could create some objects inline. But if you need their references, it clutters quickly.)
Thus, with NiceGUI you don't create hierarchy via
parent
/children
arguments oradd/insert
methods, but via indentation and scoping. I.e. using awith
statement opens a scope and new elements are automatically nested there. This is unusual, but turns out very handy.FastAPI instead of Starlette
NiceGUI is based on FastAPI, which allows for using more advanced web features like authentication, validation, and documentation. Another neat side effect is the ability to add a NiceGUI UI to an existing FastAPI backend.
There is some discussion about whether FastAPI is a good choice. But NiceGUI's dependency is rather loose and could be replaced if needed.
Beta Was this translation helpful? Give feedback.
All reactions