Skip to content

feat: Better resolution error hints in dev #2367

@iwoplaza

Description

@iwoplaza

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:
Image

The original source where this happens is the following on line 151:

Image

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.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions