-
Notifications
You must be signed in to change notification settings - Fork 725
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
Replace webpack with rollup #345
Conversation
This reduced the size of minified umd bundle from 56kB to 52kB. Configurations was combined into multiconfig to simplify maintainment. Terser is prefered over uglify as more stable package.
I think we are ready for release. |
Looks good, I'll merge it after giving @andrevenancio some time to look at it. |
Looks pretty good to me. Should we just update the README.md with the different import options we now have? I assume we still need to specify something along the lines of import { vec2 } from 'gl-matrix/ejs' ? Or we dont @TrySound ? |
Users may just import without and suffixes. import { vec2 } from 'gl-matrix'; Advanced users may look at structure here and import what they need. import * as vec2 from 'gl-matrix/vec2'; To be honest I'm not ready to work on docs because of lack of time. However this may be achieved after release. New imports may be described in release notes. |
Ok, I'm merging it then. |
Just wanted to point out a minor observation: That's definitely a breaking change. |
Hm.. I guess I skipped this part. But anyways polluting window is not good practice. |
Yeah, I'm quite fine with it. I only noticed it when answering someone's question about gl-matrix, because when testing something, I usually just run it in the browser console. I suppose I could just run this to work around this minor inconvenience. window.mat2 = glMatrix.mat2;
window.mat2d = glMatrix.mat2d;
window.mat3 = glMatrix.mat3;
window.mat4 = glMatrix.mat4;
window.quat = glMatrix.quat;
window.quat2 = glMatrix.quat2;
window.vec2 = glMatrix.vec2;
window.vec3 = glMatrix.vec3;
window.vec4 = glMatrix.vec4; |
Or like this const { mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 } = glMatrix; |
Yeah for es5 code I think adding to a glMatrix variable on the window makes sense and its quite a common practise. we avoid window pollution and I think most people are used to it. I suppose we might need to improve documentation with a basic example and I'm happy to pick up that myself at some point soon and do a PR. Looks great @TrySound thanks. Do you also have access to the glmatrix website @stefnotch? Is it worth adding a paragraph mentioning all the module options for more advanced users? |
@stefnotch Could you also publish this prerelease on npm? You may use |
Yes, I do. (It's just GitHub pages) |
@TrySound Regarding publishing it to npm:
Do I have to publish every single sub-package or...? |
I mentioned in #343 |
Oh, thank you. I'm sorry for not properly reading it the first time. |
Great! Thank you |
This reduced the size of minified umd bundle from 56kB to 52kB.
Configurations was combined into multiconfig to simplify maintainment.
Terser is prefered over uglify as more stable package.