mathieudutour Wow! Great job! I'm glad Sketch team finally started working on some tools for plugins.
Embedding panel directly into a document
I have a couple of suggestions though.. I'd built a similar tool about three years ago which is boldly called as
Sketch DevTools which isn't supported now:
The initial implementation was also as a stand-alone panel, but then I found out that it's better to inject console panel right into document. It would be really cool to get an option to embed it into document like this:
Such layout is way more logical since all the output coming from a certain document is bound to the document. Also it is just handy to see logs, model and actions in UI one's watching at.
JS vs Native implementation
I have some concerns about the implementation of
skpm only vs broadcasted logs
It's a pity that
sketch-debugger supports log statements coming from
skpm powered plugins only. It would be nice to intercept logs produced by
console.* statements as well as exceptions at runtime from any plugin even if it's not built via
skpm. It can be achived to swizzling certain native methods, e.g these:
Too bad it requires native implementation, but it's doable. Ideally we need some sort of notification supported by sketch natively, that broadcasted by
ECLogManager when plugin command produces log or exception. This way all the outputs from plugins could be easily intercepted and used by a third party tools.
Ability to jump directly to the source code from log statements and exceptions
That was my dream since the first day I started making sketch plugins and it became possible with dev tools, using additional external macOS app:
I wish we had something similar in
sketch-debugger with support of obfuscated code and source maps.
As I already suggested above - it's better to go with a native implementation. It opens up more oportunities for the grow and makes the entire solution more predictible and stable. Also, could you rename it from
devmakes it sound cool!