Skip to content

Conversation

@naman-contentstack
Copy link
Contributor

No description provided.

@naman-contentstack naman-contentstack self-assigned this Jun 26, 2025
@naman-contentstack naman-contentstack requested a review from a team as a code owner June 26, 2025 09:14
@aman19K aman19K requested a review from Copilot June 26, 2025 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves modular block generation by detecting and reusing existing block interfaces instead of creating duplicates.

  • Adds an early check to return a previously generated interface when its structure key is already cached.
  • Updates the cachedModularBlocks mapping to store the block structure key (blockInterfacesKey) rather than the interface name.
Comments suppressed due to low confidence (2)

src/generateTS/factory.ts:297

  • [nitpick] The set name uniqueBlockInterfaces is ambiguous; consider renaming it to something like seenBlockInterfaceKeys or cachedBlockKeys to clarify its purpose.
    if (uniqueBlockInterfaces.has(blockInterfacesKey)) {

src/generateTS/factory.ts:300

  • There aren’t tests covering the duplicate-detection path; add unit tests to verify that a second block with the same structure returns the existing interface name.
        cachedModularBlocks

@naman-contentstack naman-contentstack merged commit 3deea42 into development Jun 27, 2025
9 checks passed
@naman-contentstack naman-contentstack deleted the fix/DX-2775 branch June 27, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants