Add common file with GLMAT_ARRAY_TYPE, GLMAT_EPSILON and GLMAT_RANDOM#6
Add common file with GLMAT_ARRAY_TYPE, GLMAT_EPSILON and GLMAT_RANDOM#6manuelcabral wants to merge 2 commits intostackgl:masterfrom
Conversation
|
Thanks for the PR! One of the difficulties with this is that it exposes these globals to the end-user, which could lead to some problems across many modules. For example, module A might rely on GLMAT_ARRAY_TYPE to be an Not sure what the best approach is for this, maybe @hughsk and @mikolalysenko have some ideas. |
|
Thank you for the reply and the very useful module! I'm not sure I understand the difficulty. Isn't this also an issue when using the original gl-matrix? |
|
The problem becomes more pronounced in modular programming, where you have dozens of dependents on a module, and then dozens more transitive and unlisted dependents. These modules all need to work together; e.g.
If either A or B changed the internal state of This was never really a problem with the original vision of gl-matrix since most consumers of it are not working with a dependency depth greater than 1. |
|
I understand now. What if common.js exported functions which just return the values, not allowing them to be changed? |
No description provided.