-
Notifications
You must be signed in to change notification settings - Fork 477
Improving new stack and prepare. #218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
db3665b
(update) gitignore
dmx974 30812e5
Merge branch 'Comfy-Org:main' into main
dmx974 fb02b87
Merge branch 'main' of github.com:dmx974/ComfyUI_frontend
dmx974 6b02f6d
(fix) api for crystools.monitor
dmx974 fab3d35
(update) prettier and code format
dmx974 efcd6ae
(update) CSS formatting
dmx974 6c1f240
(update) add components.d.ts to gitignore
dmx974 97222be
(update) add package-lock.json to gitignore
dmx974 3f8128a
(add) config file
dmx974 026ac21
(add) unplugin, vueuse, iconify, vuerouter
dmx974 05b4d0d
(update) remove crystools message from websocket handler
dmx974 ca5eaf0
(update) tailwind config
dmx974 3b2cc59
(add) spinner component
dmx974 fb3f2da
(add) loader component
dmx974 d66e4b1
(add) default and graph layouts
dmx974 579dc9a
(update) extract system nodeDefs from nodeDefStore
dmx974 1c8f721
(update) use config file to get app version instead of window
dmx974 8c2fd7d
(add) BlockUI component
dmx974 e207e45
(add) in house VueConfirm
dmx974 d5a6712
(add) in house VueToast
dmx974 8c16ca1
(add) vue headlessui
dmx974 cbc2c76
(fix) tailwind CSS not working
dmx974 de32bd5
(fix) SideToolBar
dmx974 f603a92
(add) mainStore, prepare for progress bar
dmx974 4a1ab6a
(remove) icons and unused CSS
dmx974 13dfe7e
(update)
dmx974 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| export default { | ||
| // @ts-ignore | ||
| app_version: __COMFYUI_FRONTEND_VERSION__ | ||
| } | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ComfyUI version is binded on
windowalready. Binding onwindowallows wider access by extension developers.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am also happy to bind it to
appto avoid further contaminate thewindownamespace.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want wider access by extension developers, but secure access. That's exactly the whole point of what we are trying to do here: removing the unnecessary and unrestricted access to the window and our DOM from extension developers. This is insane in terms of security and complexity. I will provide a complete SDK to handle this, where everything will be sandboxed in an iframe. The frontend will then expose an API and a communication protocol through a SDK. Anyone who wants to create a plugin or extension will have to adhere to strict specifications and use the SDK. Look at what Telegram is doing with their Mini Apps concept; this is where we want to go.
We are getting closer and closer to a clean front stack and codebase, but there is still a giant mess inside /src/scripts/ui. This all needs to be removed for good and converted to reusable Vue components. No direct DOM manipulation should be allowed for creating or removing elements, modals, and no access to our JS scope for plugins, extensions etc. We will provide authors with a secure and well-designed SDK and specifications so they can build plugins, extensions (and even full featured apps) on top of Comfy.
The approach I suggest is the following:
All our components should be like this: short, sandboxed with clear separation of concerns, easy to read and reusable:
Trying to maintain long-term compatibility with the old way of doing things (extensions that directly access the window scope and the app object) will lead us straight to disaster, increasing technical debt, code complexity and the number of hacks (e.g., teleports in divs with fixed IDs of elements created directly in the DOM bypassing Vue, for example).
For instance, we should create a Vue modal by starting with only 2 settings, bind these settings to pinia correctly (in a proper settings store), once it's done and working, we remove those 2 settings from the legacy UI ($el...) modal. Repeat until the legacy settings modal can be totally removed. Also arrange the settings in tabs, like I've done on the screenshots below (no page scrolling, clear visible Submit call to action button on the bottom of the modal).
What we want at the end is just the LiteGraph, and everything else around made with reusable Vue components, like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the approach. In fact we only did minimal work converting the legacy js code to ts. The legacy features should be migrated to Vue one by one. However, I think how this migration should be done need some further discussion.
Here are some of my concerns:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah migrating feature by feature sounds good 👍