Skip to content

uppercase react lazy components and remove their react lazy tests#273

Open
dimaMachina wants to merge 1 commit intomainfrom
uppercase-react-lazy-components
Open

uppercase react lazy components and remove their react lazy tests#273
dimaMachina wants to merge 1 commit intomainfrom
uppercase-react-lazy-components

Conversation

@dimaMachina
Copy link
Copy Markdown
Contributor

No description provided.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 22, 2026

⚠️ No Changeset found

Latest commit: 9e6e4a1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Choose a reason for hiding this comment

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

PR Review Summary

(2) Total Issues | Risk: Medium

🟠⚠️ Major (1) 🟠⚠️

🟠 1) GraphPanel.tsx:293 / SourceEditor.tsx:103 SCREAMING_CASE naming breaks established codebase conventions

Issue: This PR introduces GRAPH_PANEL_REACT_LAZY_ONLY and SOURCE_EDITOR_REACT_LAZY_ONLY — SCREAMING_CASE function components that are entirely novel in this codebase.

Why: All ~75 React components in packages/app/src/components/ and packages/app/src/editor/ use PascalCase (e.g., GraphPanel, SourceEditor, DocumentBoundary, EditorActivityPool). SCREAMING_CASE in this codebase is reserved for constants (e.g., ACTIVITY_MOUNT_LIMIT, MAX_POOL, SYNC_TIMEOUT_MS) — never for React components or functions. The _REACT_LAZY_ONLY suffix convention also has no precedent anywhere in the codebase.

Fix: Consider alternatives that don't break naming conventions:

  1. Keep PascalCase with JSDoc: Add /** @internal Only for React.lazy - do not import directly */
  2. Separate file pattern: Move to GraphPanel.lazy.tsx that re-exports
  3. Suffix pattern: Use GraphPanelLazy / SourceEditorLazy

Refs:

Inline Comments:

  • 🟠 Major: GraphPanel.tsx:293 SCREAMING_CASE naming convention

🟡 Minor (1) 🟡

🟡 1) EditorActivityPool.test.ts:10-11 Stale documentation reference after test deletion

Issue: The file EditorActivityPool.test.ts at lines 10-11 states: "The bundle-split contract itself is pinned in EditorActivityPool.lazy.test.ts." This reference becomes stale after deleting the test file.

Why: Documentation drift creates confusion for future maintainers who see a reference to a non-existent file.

Fix: Update EditorActivityPool.test.ts lines 10-11 to remove or replace the reference to the deleted test file.

Refs:

Inline Comments:

  • 🟡 Minor: EditorActivityPool.lazy.test.ts:1 Stale documentation reference

💭 Consider (1) 💭

💭 1) scope Test coverage trade-off is acceptable but should be documented

Issue: The deleted tests verified that React.lazy correctly defers module loading — a code-splitting boundary contract.

Why: While these tests were primarily verifying bundler behavior (that dynamic imports create separate chunks) rather than application logic, they provided automated verification. The SCREAMING_CASE naming is a developer-facing signal but has no enforcement mechanism. However, React.lazy + dynamic import() is a standard, well-tested pattern that bundlers handle correctly by design, and E2E tests would catch actual load failures.

Fix: No action required if team accepts this trade-off. If stricter verification is desired later, consider bundle-size smoke tests or an E2E test asserting Suspense fallback renders.


🚫 REQUEST CHANGES

Summary: The core code-splitting simplification is fine, but the SCREAMING_CASE naming convention for React components breaks established codebase patterns (all ~75 other components use PascalCase). Please either revert to PascalCase with JSDoc annotations, or use a different pattern that maintains convention consistency. Also, the stale documentation reference in EditorActivityPool.test.ts should be cleaned up.

Discarded (0)

No findings were discarded.

Reviewers (3)
Reviewer Returned Main Findings Consider While You're Here Inline Comments Pending Recs Discarded
pr-review-standards 2 1 0 0 1 0 0
pr-review-consistency 2 1 0 0 1 0 0
pr-review-tests 2 0 1 0 1 0 0
Total 6 2 1 0 3 0 0

}

export function GraphPanel({ activeDocName }: { activeDocName: string }) {
export function GRAPH_PANEL_REACT_LAZY_ONLY({ activeDocName }: { activeDocName: string }) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 MAJOR: SCREAMING_CASE naming breaks codebase conventions

Issue: GRAPH_PANEL_REACT_LAZY_ONLY uses SCREAMING_CASE for a React component, which is unprecedented in this codebase.

Why: All ~75 React components in packages/app/src/components/ and packages/app/src/editor/ use PascalCase (e.g., GraphPanel, DocumentBoundary, EditorActivityPool). SCREAMING_CASE is reserved for constants like ACTIVITY_MOUNT_LIMIT, MAX_POOL, SYNC_TIMEOUT_MS — never for React components.

Fix: Consider alternatives that don't break naming conventions:

  1. Keep PascalCase and add JSDoc: /** @internal Only for React.lazy - do not import directly */
  2. Move to a separate file pattern like GraphPanel.lazy.tsx
  3. Use a _Lazy suffix: GraphPanelLazy

Refs:

@@ -1,23 +0,0 @@
import { describe, expect, mock, test } from 'bun:test';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Minor: Deleting this test leaves a stale documentation reference

Issue: The file EditorActivityPool.test.ts at lines 10-11 states: "The bundle-split contract itself is pinned in EditorActivityPool.lazy.test.ts." This reference will become stale after this deletion.

Why: Documentation drift creates confusion for future maintainers who see a reference to a non-existent file.

Fix: Update EditorActivityPool.test.ts lines 10-11 to remove or replace the reference to the deleted test file.

Refs:

@github-actions github-actions Bot deleted a comment from inkeep-internal-ci Bot Apr 22, 2026
@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity.
It will be closed in 7 days if no further activity occurs.

If this PR is still relevant:

  • Rebase it on the latest main branch
  • Add a comment explaining its current status
  • Request a review if it's ready

Thank you for your contributions!

@github-actions github-actions Bot added the stale label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant