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

Examples: Modularize usage of cannon.js. #19686

Merged
merged 2 commits into from
Jun 18, 2020
Merged

Examples: Modularize usage of cannon.js. #19686

merged 2 commits into from
Jun 18, 2020

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jun 18, 2020

More ES6 module usage.

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

Nice!

@mrdoob mrdoob added this to the r118 milestone Jun 18, 2020
@mrdoob mrdoob merged commit 5f7c3c6 into mrdoob:dev Jun 18, 2020
@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

Did you ported it to modules yourself?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jun 18, 2020

Yep. The last commit of the official repository is more than four years old. Not sure it's still maintained...

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

Would it be easy to do a PR with the update to the cannon.js repo?

@arpu
Copy link

arpu commented Jun 18, 2020

there is this Typescript rewrite from cannon and maintained https://github.com/react-spring/cannon-es

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

They should rename it to cannon.ts.

@donmccurdy
Copy link
Collaborator

I didn't realize they ported it to TS! Nicely it works as a drop-in replacement for cannon.js even in plain-JS projects, thanks @arpu for the patch in A-Frame Physics System (n5ro/aframe-physics-system#147).

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jun 18, 2020

@mrdoob Do you want to use the following file?

https://github.com/react-spring/cannon-es/blob/master/dist/cannon-es.js

I've checked it locally and it seems to work.

@mrdoob
Copy link
Owner

mrdoob commented Jun 18, 2020

Hmm, no... I was hoping we could help @schteppe making the library transition to ES modules.

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jun 19, 2020

It seems the build of cannon.js uses Browserify. Is it actually possible with this tool to output an ES6 *.module.js file?

@mrdoob
Copy link
Owner

mrdoob commented Jun 22, 2020

Seems like cannon-es is getting some traction. Should we use that instead? (Sorry for the wasted hours 😔)

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jun 22, 2020

No problem. New PR: #19709

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

4 participants