-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
Suggestion: Keep gl constants in build/three.js #16066
Comments
I guess this would make the build configuration more complex since the closure compiler uses |
Maybe using a configuration parameter |
If we switched to https://www.npmjs.com/package/google-closure-compiler-js, not only we could ditch Java, but we could also implement what @takahirox suggest right inside |
Interesting. But why is this possible with the JS-version of |
Hmm, because we can call |
Okay I see. I was not aware of such a usage: https://www.npmjs.com/package/google-closure-compiler#javascript-version-1 |
I've been using a constant definition file like this in my engine based on the MDN definitions: https://gist.github.com/TimvanScherpenzeel/1f4218a563789db17955a1926c8a8ee0 On build the constants are inlined by the minifier (Terser). |
I'm not sure if this is still valid (at least in context of the repository) because of the module migration. All example use I see two viable solutions:
|
Yeah we now use |
#15176 😉 |
Thanks. We may need to revisit if |
I'm with both approaches fine, too. Let's see what @mrdoob prefers. |
Yes, I think it's we should try to add a |
After reconsidering this issue I think we are overlooking an important aspect. Most serious apps work with the I've pointed out here why I think adding |
Description of the problem
We convert gl constants to their actual values like
gl.TRIANGLES
to4
when we buildbuild/three.js
andbuild/three.min.js
#15061.But gl constants are more readable. So how about keeping gl constants in
build/three.js
and converting only inbuild/three.min.js
?I think
build/three.js
is often used for debug. If user face an error, one wants to jump to the line causing error inbuild/three.js
by clickingthree.js:linenumber
from their console and/or wants to step over the code with debugger. Readable seems better for that case.Three.js version
Browser
OS
Hardware Requirements (graphics card, VR Device, ...)
The text was updated successfully, but these errors were encountered: