Skip to content

Convert to functional style and expose more types for the upcoming version 3 release#101

Merged
jamesrweb merged 1 commit intomasterfrom
refactor/v3
Jun 26, 2021
Merged

Convert to functional style and expose more types for the upcoming version 3 release#101
jamesrweb merged 1 commit intomasterfrom
refactor/v3

Conversation

@jamesrweb
Copy link
Member

@jamesrweb jamesrweb commented Jun 23, 2021

Closes #90.
Closes #87.

This PR will, when completed, implement a new functional react version of the wrapper instead of the old class based component. The docs need updated, some build configurations need changed to work with rollup as we move away from webpack but overall the implementation is nearly complete!

@jamesrweb jamesrweb added enhancement dependencies Pull requests that update a dependency file labels Jun 23, 2021
@jamesrweb jamesrweb requested a review from yevdyko June 23, 2021 17:01
@jamesrweb jamesrweb self-assigned this Jun 23, 2021
@jamesrweb jamesrweb force-pushed the refactor/v3 branch 5 times, most recently from 65a4c4c to 765dec4 Compare June 25, 2021 14:46
@jamesrweb jamesrweb marked this pull request as ready for review June 25, 2021 14:48
@jamesrweb jamesrweb changed the title Version 3 refactoring Convert to functional style and expose more types for the upcoming version 3 release Jun 25, 2021
@jamesrweb jamesrweb enabled auto-merge (squash) June 25, 2021 18:38
Copy link
Contributor

@yevdyko yevdyko left a comment

Choose a reason for hiding this comment

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

Outstanding work!

It would be nice if you could explain in the description the difference between v2 and v3, why you introduced these changes and what problems do they solve?

"p5": "^1.3.1"
},
"peerDependencies": {
"react": "*",
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if you want to define the React version here, based on the fact that you use React hooks in your implementation. For example, 16.8 is the version that supports them.

attributes: TAttributes;
canvas: p5;
wrapper?: HTMLElement;
export interface P5WrapperProps {
Copy link
Contributor

Choose a reason for hiding this comment

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

After changing the component name to ReactP5Wrapper should it also be applied here? ReactP5WrapperProps?

const wrapper = createRef<HTMLDivElement>();
const [instance, setInstance] = useState<P5Instance>();

useEffect(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

🍬

@jamesrweb jamesrweb merged commit 9bedea6 into master Jun 26, 2021
@jamesrweb jamesrweb deleted the refactor/v3 branch June 26, 2021 10:11
@yevdyko
Copy link
Contributor

yevdyko commented Jun 26, 2021

Auto-merge was not the behaviour I expected 😕

@jamesrweb jamesrweb mentioned this pull request Jun 27, 2021
jamesrweb added a commit that referenced this pull request Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate flickering issue on refactor/v3 branch Add working example to refactor/v3 branch

2 participants