fenomas / noa

Experimental voxel game engine.
MIT License
611 stars 87 forks source link

Migration to Typescript & ES6 Classes #134

Closed SamKirkland closed 3 years ago

SamKirkland commented 3 years ago

This library rocks. ❤️ I've been using voxel.js for a while now but it seems to be abandonware at this point. Noa is absolutely amazing and has a lot of potential.

In my opinion the only thing holding this project back is lack of documentation & examples. I hope to contribute in this area over the next few months.

Step 1: Migrate & add jsdocs to main lib files [This PR] Step 2: Add dat-gui Step 3: Migrate & add jsdocs to component files Step 4: Establish some build tooling like a code formatter, tests, and using github actions to deploy noa-examples on each commit Step 5+: Add to existing markdown docs to live playground examples using codesandbox.io

I've spent the last few weeks converting the main library code over to ES6 classes and typescript. You will see a night and day difference in IntelliSense. I've been using this typescript version for the past few weeks and the development experience is amazing.

I've updated a large number of jsdoc comments and documented some undocumented features/options along the way. Also fixed a few dozen bugs that came up when type checking was enabled. A large number of any types are still being used, these can be iterated on in the future. Some of these are because implicit typing is lacking due to dependent libraries not having types (integrating work like Miguel's would be helpful here).

Here are some of the changes in this PR:

Please let me know of any feedback.

Closes #85

Darkflame72 commented 3 years ago

Is there an ETA on when this will be merged with the dev branch? I have been converting a project that uses this to typescript and this would be super useful.

fenomas commented 3 years ago

Hi, sorry for the delay on this. Have a lot going on currently, and I have not yet done all the work that would be needed for me to try out this work. I'll merge it into its own branch instead, so that people can build against if if they like, and so that I can eventually test it side-by-side with the develop branch.

(always nervous about editing PRs, hopefully this works as expected..)