Skip to content

Conversation

@ompharate
Copy link
Member

The Problem

When calling [registerUtility], you could pass any random function as the [method] parameter, regardless of what that utility type was supposed to expect.

The Fix

  • created a type-safe utility registration system that enforces correct method signatures based on the utility type

  • For utility types that don't exist in [UtilityTypeSignatures], the conditional type falls through to the else branch, which allows any function signature

  • You can extend [UtilityTypeSignatures] via declaration merging

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.

  • I verified there aren't other open pull requests for the same change.

  • I followed the guidelines in Contributing to Volto.

  • I successfully ran code linting checks on my changes locally.

  • I successfully ran unit tests on my changes locally.

  • I successfully ran acceptance tests on my changes locally.

  • If needed, I added new tests for my changes.

  • If needed, I added documentation for my changes, either in the Storybook or narrative documentation.

  • I included a change log entry in my commits.


Closes #7651


@boring-cyborg
Copy link

boring-cyborg bot commented Nov 23, 2025

Caution

The Volto Team has suspended its review of new pull requests from first-time contributors until the release of Plone 7, which is preliminarily scheduled for the second quarter of 2026.
Read details.

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, read
Plone's Code of Conduct,
Contributing to Plone,
First-time contributors, and
Contributing to Volto,
as this will greatly help the review process.

Welcome to the Plone community! 🎉

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.

Enforce typing according type on utilities

1 participant