Skip to content

Conversation

@Fabilin
Copy link
Member

@Fabilin Fabilin commented Feb 22, 2024

This PR's main purpose is to add a highly flexible renderer configuration to the tock-react-kit, to allow advanced clientside processing of image and text fragments without reimplementing the entire interface.

The new features are documented in the README: https://github.com/Fabilin/tock-react-kit/blob/159-158-custom-renderers/README.md#configure-custom-renderers

In order to allow arbitrary image rendering while preserving styling capabilities, this PR starts using the emotion CSS prop for easier style composition. This requires some changes to the build settings, so I took the opportunity to upgrade our tooling. Notably, this PR switches to the new React 17 JSX transform, which improves performance and removes the need for a React import in every file. I also updated Typescript, and switched Storybook's compiler from Babel to SWC.

I also added a new useMessageMetadata hook, which provides access to the surrounding message's metadata for custom renderers. This allows the renderer to use message-specific extra data sent by the backend.

Closes #158
Closes #159

@Fabilin Fabilin added this to the 24.3.0 milestone Feb 23, 2024
@Fabilin Fabilin added the enhancement New feature or request label Feb 23, 2024
@Fabilin Fabilin merged commit 1487322 into theopenconversationkit:master Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: allow customizing image display Feature: allow preprocessing text before displaying it

1 participant