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

React 19 support #310

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

React 19 support #310

wants to merge 15 commits into from

Conversation

imjordanxd
Copy link

@imjordanxd imjordanxd commented Dec 14, 2024

Overview

This PR adds support for React 19. I believe everything is covered. Any more testing / peer reviews would be appreciated 🙏

"react": "^19.0.0",
"react-dom": "^19.0.0",
"sinon": "^2.1.0",
"typescript": "^5.7.2"
Copy link
Author

Choose a reason for hiding this comment

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

added TS to use the new JSX transform

@@ -36,10 +36,10 @@
"prop-types": "^15.5.8"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
"react": "^0.14.10 || ^15.7.0 || ^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
Copy link
Author

Choose a reason for hiding this comment

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

new JSX transform requires these React versions

@@ -1,24 +1,24 @@
{
"name": "react-infinite-scroller",
"version": "1.2.6",
"version": "2.0.0",
Copy link
Author

Choose a reason for hiding this comment

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

major version bump because of min React peer dep versions

package.json Outdated
"precommit": "lint-staged"
},
"lint-staged": {
"*.{js,jsx}": [
"node_modules/.bin/eslint --fix --max-warnings 0",
"src/*.{js,jsx}": [
Copy link
Author

Choose a reason for hiding this comment

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

idk why dist was being linted

@imjordanxd imjordanxd marked this pull request as ready for review December 14, 2024 08:29
Copy link
Author

Choose a reason for hiding this comment

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

this has been compiled by TS. How can we test this?

tsconfig.json Outdated
Copy link
Author

Choose a reason for hiding this comment

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

in a next major, prop-types should be removed and TS should be preferred.

"prettier": "^3.4.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"ts-jest": "^29.2.5",
Copy link
Author

Choose a reason for hiding this comment

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

ts-jest to auto transform code for us - direct babel dep removed

"typescript": "^5.7.2"
},
"engines": {
"node": "> 18"
Copy link
Author

Choose a reason for hiding this comment

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

in maintenance until April 2025

@@ -281,6 +282,6 @@ export default class InfiniteScroll extends Component {
: childrenArray.push(this.defaultLoader);
}
}
return React.createElement(element, props, childrenArray);
return <Element {...props}>{childrenArray}</Element>;
Copy link
Author

Choose a reason for hiding this comment

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

using JSX syntax

"description": "Infinite scroll component for React in ES6",
"main": "index.js",
"main": "dist/InfiniteScroll.js",
"jsnext:main": "src/InfiniteScroll.js",
Copy link
Author

Choose a reason for hiding this comment

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

idk what jsnext:main is for

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.

1 participant