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

feat(refacto): Move adobeFunctions.js to react component + Fix memory leak #8

Merged
merged 2 commits into from
May 7, 2019

Conversation

gnuletik
Copy link
Contributor

Hi @bibixx,

This PR introduces many changes.

  • Delete adobeFunctions.js and move its code to the React Component
  • This allows to fix a memory leak when inserting / deleting the component (with the removeEventListener calls)
  • Replace deprecated react's componentWillUpdate with componentDidUpdate

Let me know if you have any question.
Thanks !

@bibixx
Copy link
Owner

bibixx commented Apr 25, 2019

Hey, thanks for contribution. I don't have much time right now but I'll take a look on it on monday. Cheers!

@bibixx
Copy link
Owner

bibixx commented May 5, 2019

Ok @gnuletik sorry for late response but I honestly didn't have time. I see the problem that it fixes, but could we maybe move all of Adobe functions back to the external file? Maybe create a class that would hold both.

…/event leak + replace deprecated componentWillUpdate
@gnuletik
Copy link
Contributor Author

gnuletik commented May 6, 2019

Hi @bibixx, thanks for having a look!

I personally find it more clear to keep the resizeCanvas, getComposition and initAdobeAn functions inside the component file as we are interacting with the lib from the component anyway (with the this.lib.tickEnabled and this.lib.visible).

Also, keeping the DOM interaction inside the component file makes more sense according to the React's way of doing.

In fact, we could move some functions to a class instanciated for each animation but I don't really see the point here.

@bibixx
Copy link
Owner

bibixx commented May 6, 2019

Ok, I see it. So could you please rebase you PR with current master and make sure eslint doesn't throw any error? Because I have changed a few things recently

@gnuletik
Copy link
Contributor Author

gnuletik commented May 6, 2019

Thanks @bibixx!

I rebased from your last changes and eslint is okay:

react-adobe-animate ❯❯❯ yarn run lint
yarn run v1.15.2
$ eslint src/*
✨  Done in 1.77s.

@bibixx
Copy link
Owner

bibixx commented May 6, 2019

Great. I'll merge it in the evening then.

@bibixx bibixx merged commit 59e6a0f into bibixx:master May 7, 2019
@bibixx
Copy link
Owner

bibixx commented May 7, 2019

@gnuletik Just fyi there were actually a few linting errors. But I have fixed them, and new version of package has just been published

@gnuletik
Copy link
Contributor Author

gnuletik commented May 7, 2019

Oh sorry for the linting errors, I may have missed something in my eslint config.
Thanks for the merge :)

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.

None yet

2 participants