Skip to content

Refactor code#59

Merged
ajitbohra merged 23 commits intomainfrom
refactor/code
Jul 26, 2025
Merged

Refactor code#59
ajitbohra merged 23 commits intomainfrom
refactor/code

Conversation

@Verma-Punit
Copy link
Contributor

@Verma-Punit Verma-Punit commented Jul 16, 2025

Summary

Refactored code for better structure and maintainability.

Changes

  • Version bump to 1.0.0
  • Removed .prettierrc.js and added "prettier": "@wordpress/prettier-config" in package.json
  • Removed phpcs.xml.dist as PHP usage is minimal (only enqueuing)
  • Renamed web components
    • blablablocks-markertatva-marker
    • blablablocks-infotiptatva-infotip
    • (for easier future reuse as npm packages)
  • Fixed issue where marker element remained in the DOM even after removing text
  • Updated the marker icon
  • Removed format.json now directly importing ./marker and ./infotip in index.js
  • Split marker and infotip logic into separate files for better maintainability
  • Fixed issue where infotip element remained in the DOM after text removing text
  • Hide text label from the infotip’s Text tab
  • Added constants.js for shared configuration values
  • Created utils.js for helper functions

Related Issue

Closes #41 #54

@Verma-Punit Verma-Punit requested a review from ajitbohra July 16, 2025 15:14
@Verma-Punit Verma-Punit self-assigned this Jul 16, 2025
@github-actions
Copy link

github-actions bot commented Jul 16, 2025

Preview via Cloudflare R2 Storage

⚡️WordPress Playground Preview
🚀 Build zip file Download

I will update this comment with the latest preview links as you push more changes to this PR.

Note

The preview sites are created using WordPress Playground. You can add content, edit settings, and test the pull request as you would on a real site, but please note that changes are not saved between sessions.

Copy link
Member

@ajitbohra ajitbohra left a comment

Choose a reason for hiding this comment

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

left some sugestion and feedback

}
}
add_action( 'enqueue_block_assets', 'blablablocks_formats_enqueue_assets' );
add_action('enqueue_block_assets', 'blablablocks_formats_enqueue_assets');
Copy link
Contributor

Choose a reason for hiding this comment

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

The extra spacing within brackets seems to be removed in the PR. Maybe after removing prettierrc. Can we check this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I understand that we have removed phpcs.xml.dist since we have only one simple PHP file. However, I am seeing removal of spaces even in our JS files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nagesh, we can format the code anytime by simply running the command npm run format. Alternatively, we can use npm run lint:js, which will also format the code and display an errors.

@Verma-Punit Verma-Punit marked this pull request as ready for review July 20, 2025 06:11
Copy link
Member

@ajitbohra ajitbohra left a comment

Choose a reason for hiding this comment

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

Looks good to ship 👍

Let's merge this and address PHP/JS code linting and formatting in development separately.

@ajitbohra ajitbohra merged commit f2c1b99 into main Jul 26, 2025
2 checks passed
@ajitbohra ajitbohra deleted the refactor/code branch July 26, 2025 11:43
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.

Marker Format: Refactor - move Edit code to separate file

3 participants