humanmade / humanmade/rehydrator

Provide higher-level API for defining attributes to fill in patterns

Open
#29 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
5
Forks
1
Avg merge
4d 3h
Merged PRs (30d)
10

Description

I'd like to see this plugin develop a higher-level API for specifying fields to import into. It seems like we should be able to mark fields in the pattern using Gutenberg's "metadata" attribute, and hook into those to set the content/attribute/presence directly.

Some sample pseudo-code generated through Claude looks like this:

```


```

and the migration can collapse to a single call rather than needing a chain of transforms to set each piece of content individually:

```
$content = $template->fill( 'theme/hero', [
'title' => $title,
'image' => $featured_image_id,
'tone' => 'dark',
] )->get_content();
```

This is a very rough idea, and there's a lot of work to be done to flesh it out and decide on a consistant API, but I think this approach can make things smoother.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the plugin's current pattern migration and transform API, then compare it with the proposed Gutenberg metadata approach. Define the metadata shape, supported field types, and how a single fill call maps values into content, attributes, and presence; done means the API is specified and its behavior is covered by appropriate tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend-api-design, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.