Use import_names and component_names to error on dependency.py conflicts
#5495
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Motivation
TL-DR:
dependency.pyisn't coded as tightly as it should, silently letting (possibly critical) errors slide into client-side instead of stopping them right away and preventing the server from launching in a verbose and attention-grabbing manner.I was working on #5493 and looking for space savings, when I found some interesting behaviour with regards to our dependency.py implementation.
importsat 2 places, libraries and ESM modulesnicegui/nicegui/dependencies.py
Lines 180 to 186 in eea9a48
If ESM modules are to have the same name as a library, the library would be shadowed.
imports intojs_importsat 2 places, one for.jscomponents, one for.vuecomponentsnicegui/nicegui/dependencies.py
Lines 193 to 207 in eea9a48
This one is a bit more serious: If you run import twice with same name, browser JS errors out entirely, and the page grinds to a halt (white screen)
Uncaught SyntaxError: Identifier 'BLAH' has already been declaredImplementation
import_namesandcomponent_namesProgress
Final notes
May break existing code which works (barely) in case 1, but I think we should break it, because the code isn't valid in the first place.