Currently, we don't have access to the original source code written by users when generating WGSL, we only have tinyest, so when we print hints about what the dev could do to fix a bug, we emit them in WGSL and hope it's similar enough to the source:
There are cases though where it falls apart:

The original source where this happens is the following on line 151:
Ideally we would show:
- fn:preInitParticle: 'particles.$[i] = particle;' is invalid, because references cannot be assigned.
----
Try 'particles.$[i] = ParticleData(particle);' to copy the value instead.
----
Possible solution
Just as we transform JS into tinyest, we can transform tinyest back into JS 🚀. We can make sure that outside of Dev mode, it's treeshakeable, and we don't provide hints in production.
Currently, we don't have access to the original source code written by users when generating WGSL, we only have tinyest, so when we print hints about what the dev could do to fix a bug, we emit them in WGSL and hope it's similar enough to the source:
There are cases though where it falls apart:

The original source where this happens is the following on line 151:
Ideally we would show:
Possible solution
Just as we transform JS into tinyest, we can transform tinyest back into JS 🚀. We can make sure that outside of Dev mode, it's treeshakeable, and we don't provide hints in production.