Skip to content

deps!: remove prop-types package #125

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

morellodev
Copy link

Since the project fully leverages TypeScript for type checking, the prop-types package is no longer necessary. Removing it eliminates redundant runtime validation while reducing bundle size. Although this means losing runtime prop validation, TypeScript’s static type checking ensures type safety during development, making this a reasonable trade-off.

@agilgur5 agilgur5 changed the title Remove prop-types package Remove prop-types package Feb 27, 2025

This comment was marked as resolved.

@agilgur5
Copy link
Owner

Although this means losing runtime prop validation, TypeScript’s static type checking ensures type safety during development, making this a reasonable trade-off.

Unfortunately, not all users use TypeScript, so we cannot make the assumption that they have static type safety during development 😕

That being said, since React officially archived prop-types and removed support in React 19, I do think we should remove it eventually as well. It is a breaking change though (removing a feature) and react-signature-canvas is still backward-compatible with React 14, so this would only occur in a future breaking major release.
Per #116 (comment), I was looking at making a breaking change to use the newer JSX transform. Per the v1.1.0-alpha.1 release notes, I was also looking to make a breaking change to drop CJS/UMD support.
The newer JSX transform requires a React bump, but not all the way to 19, so I can't say right now if that would be an appropriate time to drop prop-types. They don't add altogether too much, but they also don't harm and can be automatically stripped during production builds, and this library has never had breaking changes before, so I would probably lean toward leaving them in longer as such.

Summarizing, I don't think now is quite the right time for this change, especially with v1.1.0-alpha.1 having recently released and not being v1.1.0 stable yet. Perhaps later this year, but maybe even later than that.

@agilgur5 agilgur5 added scope: dependencies Pull requests that update a dependency file version: major Upgrade major version when merged labels Feb 27, 2025
@agilgur5 agilgur5 changed the title Remove prop-types package deps!: remove prop-types package Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: dependencies Pull requests that update a dependency file version: major Upgrade major version when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants