-
Notifications
You must be signed in to change notification settings - Fork 51
refactor: Change component name from ReactP5Wrapper to P5Canvas #525
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
Conversation
|
Coverage report for commit: c34bc64 Summary - Lines: 100.00% | Methods: 100.00% | Branches: 91.30%
π€ comment via lucassabreu/comment-coverage-clover |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
jamesrweb
left a comment
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.
You will also need to update all of the examples in the .github/README.md and also check the CI and CD workflows, just in case.
Otherwise looks good to me π
|
@jamesrweb Thanks for the quick review! Iβll update the README examples in a separate PR since we need to keep the old version for now, otherwise it could be confusing. I also checked the workflows and no changes needed. BTW, do we want to move the |
I don't mind but I'd make the change in this PR and then I'll just deploy the new version, easy, so just update the README in this PR and then I can just deploy it after we merge this one. |
|
@jamesrweb Just updated the README. Iβll move the |
|
What do you want to do with the |
|
@jamesrweb Move it to the config directory, right? |
|
You don't have to but if you want to, feel free to make a PR for it, yeah. |
|
Would you prefer to keep it in the root directory? I believe it was in the config directory before the refactoring some time ago. |
|
Yeah because there were two configs in the config directory that the one in the root linked to but I rewrote them into one and refactored the other two out. I'm open to both options. |
|
Yeah, letβs keep it as it is. Iβll go ahead and finally extract the common workflows into the newly created repository, as we discussed. |
|
What are we still missing to make a final release of version 5? |
|
Workflow migrations (the ones you'll do). AND End to end tests to cover |
|
Sounds good! Let's focus on that π€ |
@jamesrweb As we discussed, here is a proposal for renaming the component. What do you think?
PR Type
Description
This PR refactors the
ReactP5Wrappercomponent by renaming it toP5Canvasand updating all corresponding references throughout the codebase.The new name clearly communicates that the component renders a p5.js canvas, rather than serving as a generic wrapper. It also aligns with common React naming conventions for components that directly represent rendered elements.
The original name
ReactP5Wrapperwas somewhat ambiguous, implying a higher-order component or general wrapper rather than a canvas-rendering component.By renaming it to P5Canvas:
Overall, this refactor helps future contributors quickly grasp the componentβs purpose and reduces potential confusion.
Proposed Changes
ReactP5WrappertoP5CanvasReactP5WrapperGuardtoP5CanvasGuardReactP5WrapperWithSketchtoP5CanvasWithSketchP5WrapperPropstoP5CanvasPropsP5WrapperPropsWithSketchtoP5CanvasPropsWithSketchP5WrapperClassNametoCanvasContainerClassNamewrappertocanvas-containerWrapperReftoCanvasContainerRefCanvasInstanceReftoP5CanvasInstanceRefuserProvidedPropstosketchPropsremoveCanvasInstancetoremoveP5CanvasInstanceupdateCanvasInstancetoupdateP5CanvasInstancecreateCanvasInstancetocreateP5CanvasInstanceWrappertoCanvasContainerHow Has This Been Tested?
Tested the demo application locally and checked all sketches still run as expected. Also ran the test suite and all existing tests pass without changes.
Screenshots
Breaking Changes
Migration Notes
This PR introduces a component and type rename, which is a breaking change.
ReactP5Wrapper->P5CanvasBefore:
After:
2.1.
P5WrapperProps->P5CanvasPropsBefore:
After:
2.2.
P5WrapperClassName->CanvasContainerClassNameBefore:
After:
No additional changes were made β only the component and type names have been updated.
Checklist