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

Add terms to Glossary for block extension examples #1829

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -857,4 +857,32 @@ Vale
[Vale](https://vale.sh/) is an open-source, command-line tool that helps maintain a consistent and on-brand voice in documentation.
Plone Documentation uses it to check spelling, English grammar and syntax, and style guides.

schema enhancer
A schema enhancer uses the `schemaEnhancer` function, which can modify the schema used by the `InlineForm` component.
Any registered extension plugin can provide a `schemaEnhancer` function.
This function receives an object with `formData`, which is the block data; `schema`, which is the original schema to modify; and the injected `intl`, which aids with internationalization.

variation
A variation is a common development pattern that provides alternative views for the same data.
For example, a teaser block can present data as `title + link`, `title + description + link`, or `title + image + link`.

An advanced variation can enhance the block by adding data fields to the block.
For example, a listing block variation can show news items with `title + link`.
Extending this example, a developer can add a boolean field to the block that toggles the display of the link.
Thus an editor can select between `title + link` or just `title`.

HOC
Higher-Order Component
A higher-order component (HOC) is an advanced technique in React for reusing component logic.
HOCs are not part of the React API, per se.
They are a pattern that emerges from React's compositional nature.
Concretely, a higher-order component is a function that takes a component and returns a new component.

```{important}
Higher-order components are not commonly used in modern React code.
```
```{seealso}
https://legacy.reactjs.org/docs/higher-order-components.html
```

stevepiercy marked this conversation as resolved.
Show resolved Hide resolved
```
Loading