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

Create Project package - scaffold necessary ingredients to work with an existing block #59759

Open
flexseth opened this issue Mar 11, 2024 · 1 comment
Labels
[Tool] Create Block /packages/create-block [Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement.

Comments

@flexseth
Copy link
Contributor

What problem does this address?

wp-scripts is a fantastic package with a lot of benefits, but can be a bit daunting for new developers to use because of the complexities involved. The underlying mechanisms aren't necessary if you understand the way WordPress works.

This feature request represents a way to make it easier for block developers to work with existing blocks - whether they are Core or community blocks.

Sample use cases

  • When, why, and how to create a "Block Library"
  • Using the data package to pull info from an existing block
  • Adding a "glue" functionality to a block, such as an API

Real world use case: Glue functionality: Let's say you have a weather block, but you want the weather block to send you SMS alerts when it may be raining in your locale. But that functionality doesn't exist with the way the block is written right now.

What is your proposed solution?

The create-block-plugin package scaffolds files to interact with a block.

In the sample use case, the glue functionality looks at the block data for today and integrates with a SMS platform to send you a text message.

There are two types of block plugins

  • Functionality (features/business logic)
  • Design (display/presentation)
@flexseth flexseth added the [Type] Enhancement A suggestion for improvement. label Mar 11, 2024
@jordesign jordesign added the [Tool] WP Scripts /packages/scripts label Mar 12, 2024
@flexseth
Copy link
Contributor Author

flexseth commented Mar 12, 2024

@jordesign Thank you for taking an initial look at this!

Here are some more sample use cases. These would work across multiple block contexts, providing functionality that block developers may want to easily build without needing to scaffold an actual block.

Essentially, this is a shortcut to using Block Hooks.

Paragraph to excerpt

Add block settings to convert this block to the excerpt of this post or page.

Scan for tags or categories

Allow the use of #category or ##tag to automatically add categories or tags to a post

Screenshot

Take a screenshot of how this block will display on the front-end

Block Issue Reporter

Using the block's issues URL, take the user to the page to report a problem with this block

Auto-import image

When pasting an image link from an external source, attempt to download and import the image locally, while citing the original source and providing a backlink to the source document

@gziolo gziolo added the [Tool] Create Block /packages/create-block label Jul 27, 2024
@gziolo gziolo changed the title Create Block Plugin package - scaffold necessary ingredients to work with an existing block Create Project package - scaffold necessary ingredients to work with an existing block Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Tool] Create Block /packages/create-block [Tool] WP Scripts /packages/scripts [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants