Comments (7)
Perhaps we should only add them when building ES5 targets, but not when building ESM?
from engine.
Perhaps we should only add them when building ES5 targets, but not when building ESM?
We also don't include a polyfill for Object.entries()
which is partially responsible for #6011. So including it as part of the build would catch whenever we introduced a new language feature an polyfill for it
from engine.
For now though, you're probably right @mvaligursky, we can just add a conditional flag that omits from the ES6 build
from engine.
Wouldn't it be easier to change the engine compile process to translate output ESM build to UMD and have that step add the polyfills?
from engine.
core-js does this. However some initial tests show it's quite aggressive. For example including new Float32Array()
adds polyfills for all methods, even those methods are never called. I imagine this is by design (maybe some of the polyfills depend on each other), but as our build UMD target is pretty old, core-js is adding around 160Kb of code, just for TypedArray.
Auto-polyfilling definitely seems like the right way to go, but it needs some more investigation and optimisation. Either way, as #6011 shows, we don't have a polyfill for Object.entries
, which is used in a few places, so the current UMD build has not worked with those code paths on pre Chrome 54 era browsers.
from engine.
Considering we're hoping to deprecate the IMD build in no too distant future, we might just add that single polyfill missing at the moment and call it a day for now.
from engine.
I think that's fine for now, we just exclude these in the ES6 build
from engine.
Related Issues (20)
- Invalid base value of anim target
- Handle device lost on WebGPU
- Standalone engine extras import failed HOT 1
- Changing opacity of transparent material forces shader recompilation HOT 6
- WebXR direct hand input HOT 2
- Docs: update normals in mesh example
- Anim Blend Tree takes incorrect name HOT 1
- Some WebXR examples throw error when refreshed HOT 2
- Add support for the XR emulator HOT 2
- Mesh collider no longer scales in real time HOT 1
- Weighted Blended Order Independent Transparency HOT 1
- Anim Blend Tree accessor override
- Anim Blend Tree 1D weights issue
- Debug bundled ESM engine build fails to build with Vite HOT 2
- Source map shows incorrect scope HOT 5
- Copy-Paste folder HOT 1
- Examples - build step takes progressively longer each time
- Camera non-default viewport size ignores camera clear color HOT 1
- Compute shader enhancements
- Engine requires Node 18.0 to build
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 engine.