Comments (6)
Is it completely out of the question to use ES rather than commonJS modules?
Using something like https://github.com/rollup/rollup to compile the distributable module will save space as well as improve initialization performance. This is the route Three.js is going (mrdoob/three.js#9310).
cc @Rich-Harris
from regl.
I second the Rollup suggestion — it's wonderful.
from regl.
I put my money where my mouth is, if anyone on this thread is interested --> #364
from regl.
How does rollup would help here? regl
doesn't have any 3rd party dependencies so is there anything that would be skipped during three shaking?
from regl.
As an enthusiastic regl user I'd be more than happy to help out with a conversion to ES modules.
@vorg Tree-shaking is an overstated benefit in many cases – the real benefits come from what has been termed 'scope hoisting'. With ES modules you don't need to wrap each module in a function and put it in a central cache; instead, everything lives in the same scope. You end up with a good deal less code (no per-bundle cost of including a require
implementation, or per-module cost of function wrapper + require statements, etc) which is inherently more minifiable (because more things are variables rather than unmangleable properties of exports
), and the real-world evidence is that parse time is considerably reduced by this approach.
You can get a feel for the sort of code Rollup generates here or using the interactive demo.
from regl.
I'm open to trying some stuff out. We've got benchmarks regarding size reductions so whatever works and makes it smaller I'm game for.
from regl.
Related Issues (20)
- Stable codegen + caching the generated code. HOT 1
- Retrieving shader errors? HOT 3
- Live reloading shaders? HOT 2
- [Q] gl_FragColor is not deprecated in regl?
- [Q] How to prevent drawing of duplicate frames? HOT 2
- [Q]Draw to screen works good but FBO not. HOT 3
- [Q] how to prevent too frequent draws for the sake of safety?
- [Q] regl's animation unexpectedly displaced and scaled when resizing window
- Any possible way to use gl.TEXTURE_3D with webgl2? HOT 1
- Compliance with Trusted Types
- [Feature Request] Asynchronous DrawCommand
- Use KHR_parallel_shader_compile extension
- Where'd y'all go? HOT 4
- `regl` won't build with `gl: 4.0.1` HOT 1
- How Regl customizes the shape of Points? HOT 1
- Video texture example shows black screen HOT 3
- Property 'color' does not exist on type 'Framebuffer2D' HOT 2
- compile function / debug package HOT 1
- online examples/playground broken (regl.party) HOT 3
- Is this project abandoned? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from regl.