rendajs / Renda

A modern rendering engine for the web.
https://rendajs.org
MIT License
10 stars 4 forks source link

Use strings as properties to allow property mangling. #901

Open jespertheend opened 5 months ago

jespertheend commented 5 months ago

Right now when minifying scripts, things such as gltf parsing break because the properties have been mangled. We should use x["foo"] and { "foo": true } syntax to make sure these props don't get mangled.

On top of that we should add a way to write tests that run on minified builds.

jespertheend commented 5 months ago

So far these are all the strings I was able to find that break because of this:

Details // WebGPU renderer structBlock // TypedMessenger sendData args didThrow // Mesh.AttributeType COLOR BITANGENT NORMAL POSITION TANGENT UV1 UV2 // glTF minVersion scenes extensions extras extensionsUsed extensionsRequired accessors asset buffers bufferViews images materials meshes nodes samplers scene scenes textures copyright generator version minVersion children skin matrix mesh rotation scale translation weights pbrMetallicRoughness normalTexture occlusionTexture emissiveTexture emissiveFactor alphaMode alphaCutoff doubleSided baseColorFactor baseColorTexture metallicFactor roughnessFactor metallicRoughnessTexture sampler source magFilter minFilter wrapS wrapT uri mimeType bufferView index texCoord primitives weights attributes indices material mode targets byteLength byteStride target bufferView byteOffset componentType normalized count type min max sparse