Skip to content
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

Bugfix/#602 - Add support for React 19 #665

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

iwan-uschka
Copy link

This PR adds support for React 19 by fixing TS issues regarding useRef (see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#useref-requires-argument).

To be able to use React 19 throughout the project i had to update some other dependencies as well.

To be able to use the TypeScript version of this project in VS Code i removed all typescript dependencies from all package.json and added one single typescript dependency to the root package.json. I hope this is ok.

Before this change, they were two versions of typescript: 5.4.3 and 5.3.3. Now we have only one version of typescript: 5.4.3. To avoid running into warnings like

usehooks-ts:lint: =============
usehooks-ts:lint: 
usehooks-ts:lint: WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
usehooks-ts:lint: 
usehooks-ts:lint: You may find that it works just fine, or you may not.
usehooks-ts:lint: 
usehooks-ts:lint: SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.4.0
usehooks-ts:lint: 
usehooks-ts:lint: YOUR TYPESCRIPT VERSION: 5.4.3
usehooks-ts:lint: 
usehooks-ts:lint: Please only submit bug reports when using the officially supported version.
usehooks-ts:lint: 
usehooks-ts:lint: =============

when calling pnpm lint i had to update @typescript-eslint to 7.18.0. This required some fixes to add to the codebase.

Copy link

changeset-bot bot commented Dec 22, 2024

⚠️ No Changeset found

Latest commit: 761e629

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@iwan-uschka
Copy link
Author

iwan-uschka commented Dec 22, 2024

I am not sure how the CHANGELOG update is handled properly. I assume the PR gets stashed before getting merged so i don't know the merge commit ID to use in the CHANGELOG.

So a few questions:

  • How to handle the CHANGELOG?
  • Was it correct to bump the version numbers?
  • I am not sure if this PR should result in a new version immediately. Who decides this?

@iwan-uschka
Copy link
Author

I tested the implementation also with React 18 in another repository. AFAIK it's not possible to add another app to this monorepo using React 18 next to the current implementation using React 19.

@ondrej-langr
Copy link

I am not sure how the CHANGELOG update is handled properly. I assume the PR gets stashed before getting merged so i don't know the merge commit ID to use in the CHANGELOG.

So a few questions:

  • How to handle the CHANGELOG?
  • Was it correct to bump the version numbers?
  • I am not sure if this PR should result in a new version immediately. Who decides this?

Just read the provided documentation - its just there in provided comment that was made by the bot... Click here to learn what changesets are, and how to add one.

@alexshenker
Copy link

@juliencrn Could this be expedited please?

@iwan-uschka
Copy link
Author

iwan-uschka commented Dec 30, 2024

Thanks @ondrej-langr. For someone who doesn't know changesets at all like myself https://github.com/juliencrn/usehooks-ts/blob/master/.github/CONTRIBUTING.md doesn't provide much information how to handle it properly in this repository. #665 (comment) complained about a missing changeset but it didn't help me out but made me feel uncertain. So i asked :)

According to https://www.npmjs.com/package/@changesets/cli the main purpose of changesets is to

manage the versioning and changelog entries

and

Contributor runs:
npx changeset

and

When the maintainer wants to release packages, they should run
npx changeset version
...
npx changeset publish

. So i reverted the version updates i previously added manually and added a changeset via npx changeset to this PR. I hope this is correct.

@ondrej-langr
Copy link

@iwan-uschka Indeed! Great job! Just a quick sidenote about the changeset message - remove that (#602 by @CHE1RON) part as that is added by changeset package itself ;) (you can look at previous releases and their commits)

Changesets are unique in a way that you dont have to adhere to any maximum characters as far as i know so you can add bigger explanations of your updates. One pull request can have multiple changesets even! (but in that case its better to just make more PRs)

@iwan-uschka
Copy link
Author

Thx again @ondrej-langr.

you can look at previous releases and their commits

I did exactly that but still got confused because you can find commits like b14db5b using that notation i used or 7ba7e3a with no changeset at all.

Anyway, (#602 by @CHE1RON) has been removed. Thanks for the patience :)

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.

3 participants