emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.46k stars 4.21k forks source link

improve unknown helper in error stack #20213

Open patricklx opened 1 year ago

patricklx commented 1 year ago

like result of a `unknown` helper. Where unknown is probably a internal helper like each,let, outlet etc...

It would be nice to actually see the names of those.

chriskrycho commented 1 year ago

It is indeed an annoying message. However, I believe that in any case where we do actually know the name of the helper, we use it! Accordingly, I'm going to close this as non-actionable without further input, but I'm happy to revisit that if you can identify a concrete thing we can do to fix it, and a PR would be welcome if you do find that!

patricklx commented 1 year ago

What about each/let/outlet. Those are helpers and I'm sure that this error was inside those

patricklx commented 1 year ago

I see that the debug label is created here: https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/reference/lib/reference.ts#L113 If I search for createComputeRef in glimmer-vm repo and ember.js repo I can find multiple invocations where no debug label is passed. this is probably for the each helpers: https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/reference/lib/iterable.ts#L158 outlet: https://github.com/emberjs/ember.js/blob/master/packages/%40ember/-internals/glimmer/lib/syntax/outlet.ts#L54

I could not find the let helper

patricklx commented 1 year ago

@chriskrycho

patricklx commented 1 year ago

I tried to fix the result of unknown helper for the each helper here https://github.com/glimmerjs/glimmer-vm/blob/master/packages/%40glimmer/runtime/lib/vm/append.ts#L415. But I wasnt able to find the reference to the item name. e.g. {{#each this.items as |item_name|}}....

chriskrycho commented 1 year ago

Interesting; I'm surprised these aren’t being handled, as I thought that was covered in a previous refactoring pass.