-
Notifications
You must be signed in to change notification settings - Fork 29
Unable to compile Three.js #58
Comments
Firstly, you seem to be using the npm package version of js_facade_gen which hasn't been published in three years. We aren't quite ready to publish a new version yet since the tool isn't stable enough, but to get the latest support for new TypeScript/Dart features you can clone this repo and run the tool directly with If you clone js_facade_gen into ~/js_facade_gen and three.js into ~/three.js then from ~/js_facade_gen you would have to run this really long command (we should find a way to make it easier) On the latest version, that command generates most files without issues. There are a few small problems with types and exports that I will be working on fixing. You should be able to fix them by hand for now though. |
Cool! I tried the above but it got stuck on export function cloneUniforms( uniforms_src: any ): any;
export function mergeUniforms( uniforms: any[] ): any;
export namespace UniformsUtils {
export {
mergeUniforms as merge,
cloneUniforms as clone,
};
} Yielding the following errors in stdout:
|
Yeah sorry you'll have to skip that file and fix it by hand for now. I'm aware of those issues and will fix them when I get the chance. |
The generator might not write the file if there's an error too early. If that occurs you can try commenting out the places where errors get thrown and letting it run anyways. That way you can have something to begin with that you can manually edit. |
Allright. Currently it looks like most errors originate from relative import paths being ignored. However I think I can fairly easily write a Python script to fix that (its a bit of an ugly workaround but if it can make me use threejs in Dart today... ;D) |
Not that I want to discourage any progress here, but I spent a few hours trying this out and there are a lot of annoying problems left to fully support something like Three.js.
So for now I think the conclusion is, unfortunately, that Three.js interop is too much work. Perhaps another library is easier though :) Just in case anyone ever finds this issue, here is the Python script I wrote to get rid of ~60% of errors: https://gist.github.com/bergwerf/e3f920392147d10fb44212d94ad897ab |
There are some old compilations of Three.js from a definitely typed type definitions, but three now has its own type definitions. I tried to compile these but immediately hit an error:
Aside: It would be quite nice if it is easy to compile Three.js because currently there is no Dart 2.0 library for easy WebGL1 graphics (chronosgl is the only one, but only supports WebGL2).
The text was updated successfully, but these errors were encountered: