Skip to content
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

Started work on interactivity api work with an example. #941

Closed
wants to merge 1 commit into from

Conversation

mauteri
Copy link
Contributor

@mauteri mauteri commented Oct 10, 2024

Description of the Change

Closes #

How to test the Change

Changelog Entry

Added - New feature
Changed - Existing functionality
Deprecated - Soon-to-be removed feature
Removed - Feature
Fixed - Bug fix
Security - Vulnerability

Credits

Props @username, @username2, ...

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

Copy link

what-the-diff bot commented Oct 10, 2024

PR Summary

  • Enhanced Event Handling
    Changes were made in three JavaScript files (272.js, 535.js, 980.js), replacing globalThis with self for better performance.

  • Package Updates
    The version numbers of several packages in index.asset.php files were updated to reflect the most recent versions.

  • Introduction of New Block
    A new block named "Test" was developed, with a corresponding set of associated assets (block.json, index.js, index.css, render.php, and more).

  • Addition of Image Assets
    New image files were introduced, specifically for marker icons and layers.

  • Upgraded Dependencies
    Added a new dependency - @wordpress/interactivity, to package.json and modified build scripts to support experimental module.

  • Commenting Standard Amended
    Improved clarity in documentation by changing the comment syntax in phpcs.ruleset.xml from @todo to @todolist.

  • New Block Definition Added
    Added a block.json for "gatherpress/test" block including its necessary metadata such as title, category and icon.

  • Edit Functionality for Block
    In edit.js, an interface for editing the block was developed showing a simple paragraph with the text "TEST".

  • Editor Styled
    The editor was customised by adding a red dotted border for the block using editor.scss.

  • Registration of New Block
    index.js was added to register the new block type using its metadata and edit function.

  • Server-Side Rendering
    A render.php file was created to handle rendering of the block on the server side, enabling advanced interactivity features like toggling visibility.

  • Client-Side Interactivity
    A view.js file was added to manage interactions within the block, such as toggling paragraph visibility and logging changes.

  • Test File Added
    test.js was introduced to perform simple actions like displaying an alert message when called.

  • Updated Webpack Configuration
    webpack.config.js was refined to accommodate the new module structure and to make sure all entry points are accurately defined.

  • New Files Added
    Placeholder files were created for block variations and styles.

  • Minor Comment Update
    The comment in globals.js was updated from @todo to @todolist to improve understanding.

Copy link

Preview changes with Playground

You can preview the recent changes for PR#941 with the following PHP versions:

PHP Version 8.3

PHP Version 7.4

Download .zip with build changes

Made with 💙 from GatherPress & a little bit of WordPress Playground. Changes will not persist between sessions.

@mauteri mauteri closed this Oct 10, 2024
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.

1 participant