c-frame / aframe-physics-system

community-maintained fork of n5ro's aframe-physics-system
https://c-frame.github.io/aframe-physics-system/
MIT License
43 stars 11 forks source link

Update three-to-ammo dependency to 1.0.1 #44

Closed Elettrotecnica closed 1 year ago

Elettrotecnica commented 1 year ago

Dear maintainers,

this pull request updates three-to-ammo dependency to latest 1.0.1 version.

This version introduced api-breaking changes where now the function creating the collision shapes does not expect an object3D anymore, but the pre-digested vertices, matrixes and indexes. The purpose of these changes is to be able to run the code in workers.

In order to be able to compile and run the tests on the new version, I had to introduce a new dependency on esmify. Without this extra plugin, compilation on three-to-ammo would complain about:

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' browserify

I am not very happy about introducing esmify, as its project status does not seem the best and I am confident a better solution can be found. I am open to suggestions about a better way to build the distribution files when a library contains "import" and "export" keywords.

On the plus side, the patch we used to apply on three-to-ammo became obsolete.

All the best

Antonio

Elettrotecnica commented 1 year ago

I see there exists already a pull request #22 trying to address moving to a more modern bundling tool.

diarmidmackenzie commented 1 year ago

Thanks for this. Much appreciated.

Happy to use esmify for now. Would like to eventually move to webpack per #22, but this is a nice way to get to three-to-ammo v1.0.1 with less radical changes.