-
Notifications
You must be signed in to change notification settings - Fork 51
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
Version 5 re-preparation #491
base: master
Are you sure you want to change the base?
Conversation
…g and linting fixes
"react": ">= 18.2.0", | ||
"react-dom": ">= 18.2.0" | ||
"p5": ">= 1.11.3", | ||
"react": ">= 19.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will complain (albeit not critically) if the consumer doesn't have react >= 19.x
.
Is that intended? Ideally, the library should probably support the earliest possible version of React.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the 5th version should be available for users on both React 18 and 19 to provide a lighter wrapper. This is the primary difference from version 4. Otherwise, it won't be accessible until the app is updated to React 19, which could be a blocker due to breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe but if we use 18 and 19 we could cause issues for the people on 19 since theres some deprecations in that version and also we use the react compiler in the vite setup now also. I don't know if we can reasonably guarantee full support for users of both 18 and 19, at least not 100% compatability can be guaranteed, thin or not. Does that make sense what I am trying to say?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense, but maybe we can add improvements that reduce package size to version 4 as well. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jamesrweb Taking into account that these changes work in both version 18 and 19 of React, maybe we can leave the requirements for React peer dependencies as >= 18.2.0
. WDYT?
config/typescript/tsconfig.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest you include "exclude": ["../../dist"]
somewhere in this config.
Otherwise, vscode TS plugin complains because technically the dist
folder is included by the "include": ["../../"]
config setting. This is probably not critical, but will also cause typescript to build from the dist
folder and may introduce unintended side effects.
Better yet, why not create another issue/PR to move this config and others to the root instead of keeping them in their own subdirectories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, on second thought it's better if you just change the include
property to point to `["../../src", "../../demo"]. Otherwise, you're basically including the entire root directory into the Typescript config which makes little sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that makes sense. I'll update the TS config and test it out 👌🏻
For the "root" topic, I'm not a fan of having config files in the root to be honest, I find it distracting to have a load of files right in the root which is why we initially agreed to move them to the config directory.
If we could cut down on the tooling though, I'd be open to it, for example: replacing eslint and prettier with standardjs or something but that has its own tradeoffs that we didn't explore yet.
I added some seeds for discussion, but ideally I'd like to see the react-19 fix out as soon as possible :) |
While working a little more on things today, I have noticed a weird issue with ![]() For the second issue in that file, the As for the v18.x.x and v19.x.x of |
@jamesrweb Sounds good, I'll try to test this branch on React 18 and 19 over the weekend and leave feedback after that. Thanks for your efforts! |
Yeah, not sure what's going on there. I tried changing the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the vite-plugin-dts
issue (which can also be solved separately), this looks good to me.
I still think the library should support react>=18
if possible just to allow flexibility, assuming this causes no conflicts.
@jamesrweb @Qanpi I tried testing a branch with fixes inside a React app, but manually building the package inside node modules doesn't work? Have any of you tried this in your own applications? See the error below:
|
How did you get this? Locally when I build everything is fine. Did you install all dependencies before running the build? What's your typescript version (if global)? Never seen this on the local build, local demo run or local project test... 😅 @yevdyko I'm very confused how you achieved this... 🤣 |
@jamesrweb Sure, this is what I've done:
"dependencies": {
"@p5-wrapper/react": "github:P5-wrapper/react#v5.x.x-fixes",
...
}
The package itself compiled without problems, as you said, but not as part of the React application. In my case it's a React app based on JS, so the version of Typescript is the same as the one specified in the package. |
I added #494 which fixes the type resolution issue @jamesrweb brought up above in relation to As for what @yevdyko mentioned later, I was able to get VSCode to highlight me the error when browsing The strange part is that the build breaks in your case @yevdyko. In my case, the build still passes even though VSCode complains with a red underline. In general, this should not be a problem because |
Actually, removing I included this in a separate commit in #494. Could you try this out following the steps you mentioned @yevdyko? |
@jamesrweb I tested the changes to @Qanpi On the side note, I think your assumption why in my case the build was crashing and yours was not is close to reality, because my React app is built with Thank you @Qanpi for the contribution and @jamesrweb for making it happen. Great job! 🥇 I think it's ready to go 🎸 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕺
Fixes #488
Proposed Changes
Additional Notes (optional)
Work in progress but reviews and suggestions are, as always, welcome.
The demo app works perfectly with React 19 as-is. I don't know where the issue in #488 is coming from and I need proper direction to resolve and concrete and provable known issues that this library might be introducing but I am nearly 100% sure that we are not the root cause and it's something upstream either way. We don't do anything against the rules-of-react, otherwise we would have react compiler issues. Plus with the demo app and some of my own local projects that I tested with working fine locally with react 18 and 19, I am not sure what else we could do, please suggest areas for improvement for v5.x.x!
Lastly, I would like to simplify our implementation @yevdyko, such as a more checks and verifications in the automated deployment pipeline to avoid deployment issues, reductions in dependencies, less configurations, etc, where possible. Open to suggestions and other PRs on this also. Either way, I will leave this PR as it is until you get chance to review and test properly on your side and await your feedback / suggestions / contributions first @yevdyko.