Replies: 10 comments 10 replies
-
Thank you for starting this poll. The auto-index page makes NiceGUI code base (and many new features) so much more complicated to implement. When we started implementing NiceGUI a few years back we wanted to make it as simple as possible to write a minimalistic ui. Thats why we came up with the auto-index page-concept: simply |
Beta Was this translation helpful? Give feedback.
-
That's a very interesting question, @evnchn! We're discussing the pros and cons of the auto-index client regularly since it adds quite some complexity to the library code. But let me collect a few arguments for the auto-index page:
Of course, such apps could certainly be implemented without the auto-index client. But this can be troublesome:
And as @rodja mentioned:
|
Beta Was this translation helpful? Give feedback.
-
Extending further, I have recalled that I was asked whether I want telemetry for my Next.js project Well, the computer that I was developing on back than was super slow, so I turned it off to potentially save performance. But I could see how that would otherwise be useful to see which functions got the most love, and potentially have some automatic bug reports. It could be a far far goal, but we can consider a similar approach. But, I think privacy is a top concern for this one. |
Beta Was this translation helpful? Give feedback.
-
I'd also like to raise:
|
Beta Was this translation helpful? Give feedback.
-
I'm using a dynamic page routing system for my application. Is it auto-index page? During application startup, the system scans all modules in the pages folder and registers them in a central registry. When user makes a request, the handler matches the URL path against this registry to locate and instantiate the appropriate page component. @ui.page('/{path:path}')
async def dynamic_module_page(request: Request):
path = request.url.path.strip('/')
route = f'/{path}'
pageinfo = pagemanager.get_pages().get(route)
if pageinfo:
try:
module = importlib.import_module(pageinfo.modulepath)
if hasattr(module, pageinfo.classname):
ModuleClass = getattr(module, pageinfo.classname)
ModuleClass(pageinfo=pageinfo, request=request)
|
Beta Was this translation helpful? Give feedback.
-
@falkoschindler should we title it to "have you tried using / not using @ui.page" then clarify "not using @ui.page = auto-index page" |
Beta Was this translation helpful? Give feedback.
-
From my point of view the simplicity of just writing a few lines of UI is the only real reason to keep the auto-index page (and hence the whole complicated concept of shared pages). Finally, in #5005 we are developing a compelling idea to define a single callback function as main entry point and make it almost as simple as the current auto-index page: from nicegui import ui
def root():
ui.label('Hello World!")
ui.run(root) @evnchn hinted in #4729 that there are other reasons for shared pages. I'm not convinced that the benefits outweigh the technical trouble. For example:
Therfore, I'm a big fan of dropping the auto-index client feature. |
Beta Was this translation helpful? Give feedback.
-
I am a Robotics Engineer and I use nicegui to create UI for interacting with robotics systems. The concept of a shared state page (auto-index page) is absolutely a very useful thing to have, as usually the UI elements is representing some hardware. For my application, it will be valuable to be able to also mark other pages into a “shared state page”. |
Beta Was this translation helpful? Give feedback.
-
I personally enjoy the auto-index page option. I find it super useful for initial development, quick prototyping, that sort of thing. I wouldn't cry if it disappeared, but I like that its there. |
Beta Was this translation helpful? Give feedback.
-
Thanks, @hank880907 and @BlankAdventure, for sharing your perspective! It inspired us to think about our plans for the auto-index client once again. Apart from a long list of problems with this feature (see #4472 (comment)), we identified three important aspects and possible solutions:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I just now read about the auto-index page in https://nicegui.io/documentation/section_pages_routing#auto-index_page as well as some interesting issues that are found only in it such as #4335 (if I read the PR and corresponding issues correctly)
Personally, I have never used the auto-index page, nor even figured out why one would want to use it. I use bindings (and worse case polling) for any kind of data update in the page, also for those that are shared.
Now, my ideas are not very creative 😅. In fact, it would be best if you can share your creations using the auto-index page in the comments below, or even better, in https://github.com/zauberzeug/nicegui/discussions/categories/show-and-tell
Coincidentally, I think this data will be useful in preparing for the next major update?
16 votes ·
Beta Was this translation helpful? Give feedback.
All reactions