Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Update published rebound.js on npm #33

Closed
kristoferjoseph opened this issue Jul 23, 2014 · 8 comments
Closed

Update published rebound.js on npm #33

kristoferjoseph opened this issue Jul 23, 2014 · 8 comments

Comments

@kristoferjoseph
Copy link

The version of rebound.js on npm has an outdated version of createSpring:

 createSpring: function() {
      var spring = new Spring(this);
      this.registerSpring(spring);
      return spring;
    },

Instead of what is in the docs

createSpring: function(tension, friction) {
      var spring = new Spring(this);
      this.registerSpring(spring);
      if (typeof tension === 'undefined' || typeof friction === 'undefined') {
        spring.setSpringConfig(SpringConfig.DEFAULT_ORIGAMI_SPRING_CONFIG);
      } else {
        var springConfig = SpringConfig.fromOrigamiTensionAndFriction(tension, friction);
        spring.setSpringConfig(springConfig);
      }
      return spring;
    },

When following the example in the docs it throws an error since this._springConfig is never defined in the old version. *Great addition btw

I would love to see rebound.js become it's own project with it's own repo etc. I have some performance improvements to add :)

@willbailey
Copy link
Contributor

Thanks! I published 0.0.3 with the current version. I've also been thinking about putting this into its own repo. I do like the idea of keeping the APIs for the Java version and the JavaScript version pretty close, but getting more iteration on the JS version might lead to some ideas for improvement in the Java version also.

@kristoferjoseph
Copy link
Author

Keeping the APIs in step makes sense. Not sure having the js in it's own repo would hinder that much. I am starting to build up some helper functions around rebound.js now and it would be ideal to only pull down the few files via npm instead of the whole shebang. ;)
Thanks for the update.

@willbailey
Copy link
Contributor

Yep I'm going to create a separate repo for this. Looking forward to seeing your ideas.

@kristoferjoseph
Copy link
Author

🤘

On Friday, July 25, 2014, Will Bailey notifications@github.com wrote:

Yep I'm going to create a separate repo for this. Looking forward to
seeing your ideas.


Reply to this email directly or view it on GitHub
#33 (comment).

Kristofer

@willbailey
Copy link
Contributor

This is available now.
https://github.com/facebook/rebound-js

What do you think about making this available on bower? I was going to do that previously but bower doesn't like projects that aren't at the root of a git repo. This should be much easier to setup now.

@kristoferjoseph
Copy link
Author

Awesome!
I don't use bower so I have no opinions about whether you should or not 😄

@willbailey
Copy link
Contributor

Do you have a preferred way of pulling this into a web project and packaging it with commonjs? I've been working on Android more lately, so I'm not up to speed on what the latest and greatest workflows look like.

@kristoferjoseph
Copy link
Author

I use npm with Browserify
Tried them all and this has the least amount of rigmarole of any of the approaches.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants