-
Notifications
You must be signed in to change notification settings - Fork 461
refactor: replace runtime isElectron with buildtime isDesktop
#7374
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
base: main
Are you sure you want to change the base?
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/14/2025, 03:37:39 AM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 12/14/2025, 03:46:30 AM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.23 MB (baseline 3.25 MB) • 🟢 -14 kBMain entry bundles and manifests
Status: 3 added / 3 removed Graph Workspace — 985 kB (baseline 986 kB) • 🟢 -264 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 6.07 kB (baseline 6.54 kB) • 🟢 -471 BTop-level views, pages, and routed surfaces
Status: 1 added / 1 removed Panels & Settings — 292 kB (baseline 298 kB) • 🟢 -6.65 kBConfiguration panels, inspectors, and settings screens
Status: 5 added / 6 removed UI Components — 184 kB (baseline 184 kB) • 🟢 -42 BReusable component library chunks
Status: 7 added / 7 removed Data & Services — 9.71 kB (baseline 12.5 kB) • 🟢 -2.83 kBStores, services, APIs, and repositories
Status: 2 added / 3 removed Utilities & Hooks — 3.18 kB (baseline 3.18 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 1 added / 1 removed Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.82 MB (baseline 3.82 MB) • ⚪ 0 BBundles that do not match a named category
Status: 19 added / 19 removed |
047ac83 to
958dd53
Compare
Allows the frontend to use buildtime var instead of relying on runtime check to know it's being used for desktop. Prereq for Comfy-Org/ComfyUI_frontend#7374. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-1479-add-distribution-flag-when-building-frontend-2c86d73d36508104afe8dc0674e7dbe5) by [Unito](https://www.unito.io)
Summary
Dependent on Comfy-Org/desktop#1479
Whether the environment is desktop or not is known at build time and will not be dynamic at runtime, so we can use this pattern instead. The benefits are:
'electronAPI' in window && window.electronAPI !== undefinedEvidence of improved DCR and tree-shaking:
┆Issue is synchronized with this Notion page by Unito