Skip to content

Instantly share code, notes, and snippets.

@krisselden
Created May 1, 2020 23:41
Show Gist options
  • Save krisselden/040987f48d9326c06c3c83f5071cb73e to your computer and use it in GitHub Desktop.
Save krisselden/040987f48d9326c06c3c83f5071cb73e to your computer and use it in GitHub Desktop.

Pass in an invocables array of c => c() that is source mapped to mustache/Component/s-exp locations during template compile.

Now anytime the VM executes something that invokes user land code that might fail it can do it with the slotted invocable wrapper in both Append mode or Update mode and with the sourcemap this will place the hbs file on the stack and allow you to set a breakpoint in the mustache, Component or subexpression.

Also, possibly make bindings thunks so they can be debugged when the VM reads them, so if they were an unexpected value you'd be able to see.

template({invocables: [c=>c(),c=>c(),...], bindings: [() => MyComponent, ...], block: ..., meta: ... })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment