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

Add library to NPM #4

Closed
homerjam opened this issue Dec 12, 2020 · 10 comments
Closed

Add library to NPM #4

homerjam opened this issue Dec 12, 2020 · 10 comments

Comments

@homerjam
Copy link

No description provided.

@Pixofield
Copy link
Owner

KeyshapeJS isn't intended to be a generic JavaScript animation library, so adding it to NPM may not be a good idea.

@wwwonka
Copy link

wwwonka commented Jul 14, 2021

~Fair point.
Although, considering the importance keyshape.js has as a dependency in some projects , it feels rather inglorious to treat it as an old-school script and be brought back to check for updates manually instead.

Would you consider instead making the repo installable as a package with npm i Pixofield/keyshapejs#master? This would make things a lot more convenient and proper for setting up projects while still not publishing it on npm.

Just a suggestion.

@wwwonka
Copy link

wwwonka commented Oct 12, 2021

Any taughts on this suggestion?

@Pixofield
Copy link
Owner

I can consider adding KeyshapeJS to NPM when the next version is released.

@wwwonka
Copy link

wwwonka commented Jan 5, 2022

Hi! Congratulations on the new release and features! The icon looks way better in my opinion as well..!

So...
With this new release, can we hope for a cherry on top, AKA a KeyshapeJS npm package !?

@Pixofield
Copy link
Owner

I can try to publish KeyshapeJS to NPM, but I'm not sure how you want to use it.

Should the package have the same files as the repository has? How do you plan to use them?

@wwwonka
Copy link

wwwonka commented Jan 7, 2022

It is just way more convenient to have a library as a npm dependency.

It allows to keep a better eye on how much each external dependencies weights.
It also allows to keep the code up to date automatically.
It allows to defer loading with better control.
~ etc.

I don't think the current structure of the lib would allow tree-shaking but that could be a way of improving things in the future.

Why exactly do you have a reluctance to publish keyshapejs on npm, if you don't mind me asking?

@Pixofield
Copy link
Owner

I can publish it on NPM. I'm trying to understand how the library will be used so that I can test it.

Do you plan to use it in a React app? Do you plan to import it into JavaScript?

@wwwonka
Copy link

wwwonka commented Jan 13, 2022

On my side I plan to use it as animport statement, yes.

@Pixofield
Copy link
Owner

KeyshapeJS has been published on NPM: https://www.npmjs.com/package/keyshapejs

It can be imported and used like this:

import * as KeyshapeJS from 'keyshapejs';

var timeline = KeyshapeJS.animate(...);

It works with SVG inlined in HTML, but the library can't be used with SVG files loaded with <object>. It means that the library can't really be used to animate files exported from the Keyshape app without manually modifying the SVG so that it can be inlined in HTML.

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

No branches or pull requests

3 participants