Skip to content

Conversation

webfiltered
Copy link
Contributor

@webfiltered webfiltered commented Sep 29, 2025

Summary

Extracts shared formatting and network utilities into dedicated workspace package.

Changes

  • What: Created @comfyorg/shared-frontend-utils package containing formatUtil and networkUtil
  • Breaking: None - utilities remain accessible via path aliases in tsconfig

Split createAnnotatedPath and electronMirrorCheck out and left in frontend, due to their tightly-coupled nature. See discussion on this PR.

Review Focus

Package naming - is @comfyorg/shared-frontend-utils appropriate for these utilities? Please think of something better, then tell me about it.

(Edit: No more two-link views required - "discovered" a neat way to squash merge by using different file names and tsconfig aliases.. then just aliasing to the package files direct - just requires a root level tsconfig. Apparently, this is in the Nx docs. Spoilsports.)

Copy link

github-actions bot commented Sep 29, 2025

🎭 Playwright Test Results

⚠️ Tests passed with flaky tests

⏰ Completed at: 09/29/2025, 12:05:21 PM UTC

📈 Summary

  • Total Tests: 479
  • Passed: 448 ✅
  • Failed: 0
  • Flaky: 2 ⚠️
  • Skipped: 29 ⏭️

📊 Test Reports by Browser

  • chromium: View Report • ✅ 440 / ❌ 0 / ⚠️ 2 / ⏭️ 29
  • chromium-2x: View Report • ✅ 2 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • chromium-0.5x: View Report • ✅ 1 / ❌ 0 / ⚠️ 0 / ⏭️ 0
  • mobile-chrome: View Report • ✅ 5 / ❌ 0 / ⚠️ 0 / ⏭️ 0

🎉 Click on the links above to view detailed test results for each browser configuration.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Sep 29, 2025
Copy link
Contributor

@DrJKL DrJKL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Utils is a little generic, yeah.
It feels like it would be hard to define a bright line inclusion rule for it.

Is there a way to hint to git that the files are a move/copy?

What's up with createAnnotatedPath?

@webfiltered
Copy link
Contributor Author

Utils is a little generic, yeah.

Yeah super not happy with it. Thought of a bunch of really bad alternatives. Didn't want to prefix with frontend-, but may need to. How do you feel about @comfyorg/generic-frontend-pure-functions-and-stuff?

Is there a way to hint to git that the files are a move/copy?

So it displays on the "Files changed" tab (without viewing in ranges)? Not without removing the shims / adding them in a follow-up PR.

I explicitly commit --no-verify the pure git mv though. Links to commit ranges are in PR body~

@webfiltered
Copy link
Contributor Author

What's up with createAnnotatedPath?

It uses the following dependency chain: ResultItem -> split schemas out to package -> i18n -> nope.

Path of least resistance was to leave it behind.

@webfiltered
Copy link
Contributor Author

Test failure: confirmed unrelated.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Sep 29, 2025
tsconfig.json Outdated
Comment on lines 25 to 28
"@/*": ["src/*"],
"@/utils/envUtil": ["src/utils/envUtil.shim.ts"],
"@/utils/formatUtil": ["src/utils/formatUtil.shim.ts"],
"@/utils/networkUtil": ["src/utils/networkUtil.shim.ts"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work?

Suggested change
"@/*": ["src/*"],
"@/utils/envUtil": ["src/utils/envUtil.shim.ts"],
"@/utils/formatUtil": ["src/utils/formatUtil.shim.ts"],
"@/utils/networkUtil": ["src/utils/networkUtil.shim.ts"]
"@/*": ["src/*"],
"@/utils/envUtil": ["packages/shared-frontend-utils/src/envUtil.ts"],
"@/utils/formatUtil": ["packages/shared-frontend-utils/src/formatUtil.ts"],
"@/utils/networkUtil": ["packages/shared-frontend-utils/src/networkUtil.ts"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I refactored down to this after the last commit. But the build failure is unrelated, and more painful.

I need to reduce the scope further; will either close PR or force push something else later.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 29, 2025
@webfiltered webfiltered merged commit ed5d258 into main Sep 30, 2025
22 checks passed
@webfiltered webfiltered deleted the utils-as-package branch September 30, 2025 01:52
christian-byrne pushed a commit that referenced this pull request Oct 6, 2025
## Summary

Extracts shared formatting and network utilities into dedicated
workspace package.

## Changes

- **What**: Created `@comfyorg/shared-frontend-utils` package containing
formatUtil and networkUtil
- **Breaking**: None - utilities remain accessible via path aliases in
`tsconfig`

Split `createAnnotatedPath` and `electronMirrorCheck` out and left in
frontend, due to their tightly-coupled nature. See [discussion on this
PR](#5843 (comment)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants