Automattic / Automattic/jetpack

Forms: switch namespace from `jetpack/contact-form` to `jetpack/form`

Open
#40,824 1 comment 0 reactions 0 assignees View on GitHub
[Block] Form [Feature] Forms [Feature] Forms Blocks Task
Dominant language
PHP
Stars
1.8k
Forks
898
Avg merge
1d 18h
Merged PRs (30d)
774

Description

Internal reference p1HpG7-l0G-p2

> I’d like to have a nicer namespace and switch from jetpack/contact-form to jetpack/form.

Discussion Jan 2025 (internal ref p1737635493924209-slack-C086RGTJT1D ):

> When we load a post, we get the `html` (`post_content`) and parse it through the core API ( in `@wordpress/blocks`). This is where some other operations take place, like block invalidation etc..
>
> So if a block is called `some name` and we wan't to change it to `another name` (let's say `new name`) we would need to make sure the parsing of the content doesn't invalidate the blocks already in posts with the `some name` name and instead handle it gracefully and update it with our new name. That handling takes place before the final parsing, so by changing the name we don't end up with invalid blocks.
>
> This handling is actually needed in at least another place, which is the `template` [prop of blocks](https://developer.wordpress.org/block-editor/reference-guides/block-api/block-templates/).
>
> So, unless there is another way that I'm not aware of (I don't think so though..), in order to rename 3rd party blocks we would need to have a filter somewhere related to [convertLegacyBlockNameAndAttributes](https://github.com/WordPress/gutenberg/blob/a411f333ae717961749714064b35c373f2f0b6c1/packages/blocks/src/api/parser/convert-legacy-block.js#L11C17-L11C52) to add more blocks to convert.

Contributor guide

Open the contributing guide

Research direction

Start with the @wordpress/blocks parser entry point and read convertLegacyBlockNameAndAttributes, then review the block template prop handling described in the issue. Determine how existing jetpack/contact-form content can be recognized and migrated to jetpack/form without invalidation; done means old posts and templates parse correctly under the new namespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
content, frontend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.