Skip to content

feat: template decorator#5510

Merged
OEvgeny merged 3 commits intomainfrom
feat/template-decorator
Jul 10, 2025
Merged

feat: template decorator#5510
OEvgeny merged 3 commits intomainfrom
feat/template-decorator

Conversation

@OEvgeny
Copy link
Copy Markdown
Collaborator

@OEvgeny OEvgeny commented Jul 8, 2025

Fixes #

Changelog Entry

Breaking changes

  • The following middleware should be created using their respective factory function:
    • activityBorderDecoratorMiddleware, related to PR #5504, #5510

Description

This adds a new template for decorator middlewares which allows passing component instead of enhancer.

The middleware stack is executed once and then is used to produce stable render tree. The request is passed via context and props are used to configure downstream decorators.

Design

Meet templateDecorator function which now operates a bit differently to usual middleware stack:

  • utilizes single chain or responsibility for all decorators
  • produces stable component tree (up to consumers)
  • allows only for unconditional middleware execution
  • request is not available during enhancer execution
  • request is not mutable
  • the request prop is shared via context and passed to each of components wrapped into createMiddleware() along with the Next component

Specific Changes

  • added templateDecorator
  • migrated ActivityBorderDecoratorMiddleware to templateDecorator
  • refactored for usage of single context: wrap Proxy instances with RCoR providers
  • updated tests

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@OEvgeny OEvgeny marked this pull request as ready for review July 9, 2025 16:34
@OEvgeny OEvgeny merged commit c1bd6b1 into main Jul 10, 2025
28 checks passed
@OEvgeny OEvgeny deleted the feat/template-decorator branch July 10, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants