wanadev / perspective.js

Transforms the perspective of an image and draw it on a canvas
Apache License 2.0
136 stars 27 forks source link

Add ES5 and Typescript support, redo build logic with Rollup #8

Closed chaitan94 closed 3 years ago

chaitan94 commented 3 years ago

These changes make it easier to use this library in modern libraries like React.

There is a breaking change included in this PR. Basically, instead of assuming an order for the input arguments points, we now use a more explicit input (topLeftX, bottomRightY etc). Although this is a very small change and should be easy for any active users to migrate. For this same reason, I have also changed the major version of the library ie. from 1.0.0 to 2.0.0.

It would be great if you are willing to take in these changes and re-publish the package on npm :smile:

chaitan94 commented 3 years ago

@flozz any comments? Would you say this contribution is appropriate/helpful in any way?

flozz commented 3 years ago

Hello,

Sorry I completely missed this PR (so thank you for the mention)... I will review it next Monday, I have no time right now :)

flozz commented 3 years ago

Hello,

The changes you made seems great, but I do not know TypeScript enough to maintains this project once converted to TypeScript.

Maybe the best thing to do is to fork the project, naming it perspective.ts or something like that, and then we can add a link from this project to your fork?

Do you think it is a good solution? Do not hesitate to join our Discord if you want to chat with me about this project :)

chaitan94 commented 3 years ago

Thanks for the response. I originally thought of forking into a separate project too. But I thought it would fracture the community a bit as devs would be needing to discover the correct library which fits them, and also if PRs come independently in both places, it might lead to the projects diverging out.

Nevertheless, I think forking is not really a bad solution really. And since you are also suggesting we go that way, I think I can work with that. I will rename our fork to perspective.ts and try to republish it on npm with the same name. I will let you know once I am done with that, then we can link each other's projects in our READMEs maybe.

chaitan94 commented 3 years ago

I have created the fork, and mentioned perspective.js in the README. :smile:

Github link of the fork: https://github.com/adonmo/perspective.ts

NPM link: https://www.npmjs.com/package/perspectivets

flozz commented 3 years ago

Thank you, I updated wrote the documentation and added a link to your project :)