-
Notifications
You must be signed in to change notification settings - Fork 376
refactor: Improve litegraph preprocessing for i18n collection #5297
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
Conversation
…elds in litegraph - Add prebuild script that temporarily removes 'declare' keyword from litegraph TypeScript files - Add restore script to revert files to original state after i18n collection - Update collect-i18n script to use prebuild/restore workflow - Add babel dependencies for TypeScript transformation - Update playwright.i18n.config.ts with global setup/teardown This fix addresses an issue where Playwright's Babel transformation couldn't handle TypeScript 'declare' fields in litegraph classes, causing the i18n collection to fail. Fixes the issue where 'pnpm collect-i18n' would fail with: "TypeScript 'declare' fields must first be transformed by @babel/plugin-transform-typescript"
… adjusting spacing and line breaks
…d Playwright setup - Remove prebuild-litegraph.js and restore-litegraph.js scripts - Add i18nSetup.ts module for litegraph TypeScript 'declare' keyword preprocessing - Create ComfyPageNoUser fixture to avoid user creation conflicts in i18n tests - Update playwright.i18n.config.ts to use integrated setup/teardown - Simplify collect-i18n command to just run Playwright tests - Ensure pnpm collect-i18n works correctly 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🎭 Playwright Test Results✅ Tests completed successfully! ⏰ Completed at: 09/12/2025, 03:39:45 AM UTC 📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
The NoUser fixture doesn't work properly in CI. Tests will handle user creation properly with the standard fixture.
Instead of hardcoding the list of files, dynamically find all TypeScript files in litegraph that contain 'declare' keywords using glob pattern matching.
- Replace synchronous fs operations with async fs.promises - Use Promise.all for parallel file processing - Improves performance when processing multiple files
The display name change from "LoadAudio" -> "Load Audio" was added 4 months ago comfyanonymous/ComfyUI@b4abca8. I wonder why the test only started failing now? |
its Ready for review, current CI Fails:
![]() |
- Fix trailing whitespace - Add missing newlines at end of files
… FullConfig parameter for better integration with Playwright's testing framework
…on to ensure they are included in the build process
…etter clarity and maintainability feat(knip.config.ts): add support for vite and vitest configurations to enhance project structure and testing capabilities
…CSS integration in the project
got tailwindcss unsed error
|
…plugins list to support Tailwind CSS integration in the project
Is it fixed if you rebase? |
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.
Comprehensive PR Review
This review is generated by Claude. It may not always be accurate, as with human reviewers. If you believe that any of the comments are invalid or incorrect, please state why for each. For others, please implement the changes in one way or another.
Review Summary
PR: refactor: Improve litegraph preprocessing for i18n collection (#5297)
Impact: 423 additions, 296 deletions across 7 files
Issue Distribution
- Critical: 0
- High: 0
- Medium: 3
- Low: 3
Category Breakdown
- Architecture: 0 issues
- Security: 0 issues
- Performance: 1 issues
- Code Quality: 5 issues
Key Findings
Architecture & Design
The PR introduces a well-structured approach to litegraph preprocessing by consolidating functionality into dedicated modules. The integration with Playwright's global setup/teardown lifecycle is architecturally sound. The approach of replacing standalone scripts with integrated Playwright setup follows good practices for test infrastructure.
Security Considerations
No security vulnerabilities identified. The file preprocessing operations are contained within the test environment and don't expose any security risks.
Performance Impact
The solution includes a performance consideration noted in comments (70ms for 90+ file reads). While functional, there's room for optimization in the file scanning approach through batching or streaming operations.
Integration Points
The changes properly integrate with the existing Playwright configuration and don't break existing test infrastructure. The knip.config.ts updates ensure build tools are properly recognized.
Positive Observations
- Clean modular design with proper separation of concerns
- Good error handling with informative messages
- Proper use of TypeScript types and modern async/await patterns
- Integration with existing toolchain (Playwright, knip)
- Memory-based backup strategy avoids filesystem pollution
References
Next Steps
- Address medium priority issues for better maintainability
- Consider performance optimizations for file scanning
- Ensure consistent TypeScript import patterns
- Review global state management approach
This is a comprehensive automated review. For architectural decisions requiring human judgment, please request additional manual review.
I've got it because rebased |
Refactored preprocessLitegraph() to read each file only once instead of twice. Previously files were read once to check for 'declare' keywords and again to process them. Now files are read once and processed inline if they contain 'declare' keywords, improving performance.
… import for FullConfig to improve clarity and maintainability
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.
LGTM!
In the final-test PR - Test: Update locales workflow for sno-fix-playwright-babel-test branch by snomiao · Pull Request #5503 · Comfy-Org/ComfyUI_frontend, I've got a new error never seen before, working on it now @christian-byrne
|
…babel branch for temporary Playwright issue fix
close this as not necessary anymore because we solved locale workflow problem here: - fix(collect-i18n-node-defs): refactor to run ComfyNodeDefImpl only in browser context by snomiao · Pull Request #5775 · Comfy-Org/ComfyUI_frontend |
This is approach 2 of fixing .github/workflows/i18n.yaml
see also approach 3 (remove declare): #5304
Summary
Changes
scripts/prebuild-litegraph.js
andscripts/restore-litegraph.js
browser_tests/i18nSetup.ts
for integrated preprocessingbrowser_tests/fixtures/ComfyPageNoUser.ts
to avoid user conflictsplaywright.i18n.config.ts
to use new setup/teardowncollect-i18n
command no longer needs manual prebuild/restoreTest Plan
pnpm collect-i18n
command works correctly🤖 Generated with Claude Code
┆Issue is synchronized with this Notion page by Unito