hyperbrew / bolt-uxp

A lightning-fast boilerplate for building Adobe UXP Plugins in React, Svelte or Vue built on Vite + TypeScript + Sass
MIT License
35 stars 5 forks source link

Clear console before reload #21

Open Klustre opened 1 month ago

Klustre commented 1 month ago

Currently the UXP debug console history is kept after hot reloading, but I find myself clearing it manually after each reload to get a clean slate. Any logged objects lose their reference, so I don't think there's any reason to keep the history.

jardicc commented 1 month ago

This would be a tool DevTool or UXP responsibility and this checkbox should work.

image

jardicc commented 1 month ago

Lol... the checkbox is actually doing something. image

It prevents console.clear() if enabled.

Klustre commented 1 month ago

Can confirm that works. In that case it would be nice if Bolt clears the console and users can toggle 'Preserve log' to keep it.

jardicc commented 1 month ago

I would rather see change done by UXP team.

gregbenz commented 1 month ago

I have a console.clear() early in my code (after loading shims), and it works great. If you need to see something, you can enable that option in the debugger to preserve logs (ignore clear commands). Or just cmd-K or L to clear.