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

three.js has functions missing in externs file #292

Open
Odinodin opened this Issue Nov 10, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@Odinodin

Odinodin commented Nov 10, 2015

I think the three.js library has some missing functions in the externs file, but I´ve yet to understand the proper way to encode the functions that are missing in the externs file. Here is what I am experiencing:

I have the following Three.js code:

(let [r (THREE.WebGLRenderer. #js {"canvas" canvas-el
                                     "antialias" true
                                     "alpha" true})]
    (.setClearColor r 0xffffff 0)
    (.setSize r width height)
    r)

This works fine in non-advanced compilation but fails when using :advanced.

This is what is generated with :advanced

{var pp,qp=new THREE.WebGLRenderer({canvas:gp,antialias:!0,alpha:!0});qp.zd(16777215,0);qp.Ad(hp,ip);pp=qp}

This is the error in the browser console:

Uncaught TypeError: qp.zd is not a function

The three.ext.js file contains the following:

"WebGLRenderer": function () {},

The three.js file contains the following:

THREE.WebGLRenderer = function ( parameters ) {
     // Lots of stuff

    this.setClearColor = function ( color, alpha ) { ... }

}

How is the externs file supposed to look like in order to keep the setClearColor function?

@Odinodin

This comment has been minimized.

Show comment
Hide comment
@Odinodin

Odinodin Nov 11, 2015

I figured it out, there are indeed lots of functions and variables missing in the three.js externs file. I'll submit a pull request once I find a way to automatically identify the missing elements.

Odinodin commented Nov 11, 2015

I figured it out, there are indeed lots of functions and variables missing in the three.js externs file. I'll submit a pull request once I find a way to automatically identify the missing elements.

@Deraen

This comment has been minimized.

Show comment
Hide comment
@Deraen

Deraen May 11, 2016

Member

Three.js has was updated recently and the externs re-generated. But looks like for example setClearColor is still missing: 3993894

@harrio Have you had problems with the generated externs?

Member

Deraen commented May 11, 2016

Three.js has was updated recently and the externs re-generated. But looks like for example setClearColor is still missing: 3993894

@harrio Have you had problems with the generated externs?

@harrio

This comment has been minimized.

Show comment
Hide comment
@harrio

harrio May 11, 2016

Contributor

No. So probably didn't use the affected stuff. Three.js seems to be problematic for extern generators: issue Even if I didn't use that generator here. Maybe the missing stuff has to be added manually.

Contributor

harrio commented May 11, 2016

No. So probably didn't use the affected stuff. Three.js seems to be problematic for extern generators: issue Even if I didn't use that generator here. Maybe the missing stuff has to be added manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment