Skip to content

Conversation

Venryx
Copy link
Contributor

@Venryx Venryx commented Mar 9, 2025

Removed the deprecated propTypes.ts, and some remaining references to its exports, in order to make mobx-react compatible with React 19 (without TypeScript compile errors), since React 19 removes its prop-types exports of React.Requireable and React.Validator. (@mweststrate gave a go-ahead for this here)

Changelog:

  • Removed propTypes.ts, as React 19 no longer provides the types React.Requireable and React.Validator.
  • Updated docs to not mention the mobx-react specific prop-types anymore.
  • Removed the propTypes.test.ts file. (not applicable anymore, since the mobx-react specific prop-types no longer exist)
  • Removed the "component with observable propTypes" test, since it's no longer applicable. (and it was referencing typescript types that are no longer importable, so using test.skip is not sufficient)

Code change checklist

  • Added/updated unit tests
  • Updated /docs. For new functionality, at least API.md should be updated
  • Verified that there is no significant performance drop (yarn mobx test:performance)

Venryx added 2 commits March 9, 2025 12:50
…t.Requireable and React.Validator. This should resolve the remaining typescript conflicts that mobx-react had with React 19.

* Removed the "component with observable propTypes" test, since it's no longer applicable. (and it was referencing typescript types that are no longer importable, so using `test.skip` is not sufficient)
Copy link

changeset-bot bot commented Mar 9, 2025

🦋 Changeset detected

Latest commit: f5c0fe7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mobx-react Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Venryx Venryx mentioned this pull request Mar 9, 2025
2 tasks
@Venryx
Copy link
Contributor Author

Venryx commented Mar 9, 2025

I added a basic changelog entry for the PR: (to satisfy changeset-bot)

Removed the deprecated PropTypes export, as React 19 no longer provides the types React.Requireable and React.Validator, and this was causing TypeScript errors with @types/[email protected].

I marked it as a major change (assuming even deprecated APIs are considered part of the semver-tracked api-surface), but I can change it to minor if needed.

Copy link
Member

@mweststrate mweststrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this PR! Doing this as major sounds both as slightly overkill and conceptually correct. Doing it as minor will always trip some project up though, so let's do a major :)

Would you mind updating peerDependencies in package.json, and the compatibility table in the README accordingly? Otherwise looking great, thanks!

…ersion 10 adds (completed) support for React 19.
@Venryx
Copy link
Contributor Author

Venryx commented Aug 5, 2025

I've added the second change requested (compatibility table update in readme). [although, I'm not 100% sure it matches what you wanted/expected]

I'm also trying to add the first change requested (adding of react 19 as a peer dependency). But git appears to have a hook that warns me to run "yarn install" prior to pushing. When I do so, it seems to result in a massive set of changes to the lock file, which would not be feasible for maintainers to visually review. So I imagine this step would have to be performed by an existing trusted maintainer (to ensure the lock file is authentic).

Note: It's possible I'm running a different version of yarn? Running "yarn install" resulted in an unexpectedly large set of file changes. (to .yarnrc.yml, yarn.lock, install-state.gz, mobx/package.json, mobx-react/package.json, and mobx-react-lite/package.json)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants