unplugin / unplugin-turbo-console

🚀 Improve the Developer Experience of console
https://utc.yuy1n.io
MIT License
525 stars 12 forks source link

Optimization of LaunchEditor's console output #30

Closed normal-coder closed 6 months ago

normal-coder commented 7 months ago

Clear and concise description of the problem

The space for Console output is limited.

For example, the address http://localhost:3070#c3JjL3N0b3JlL3VzZUF1dGhTdG9yZS50czozNzoyNQ== output by LaunchEditor corresponds to the relative directory of the project src/store/useAuthStore.ts:37:25 after being decoded from base64.

As the complexity of the project directory increases, the length of the text will also increase, and it will not be elegant to use Console panel output space. Although the above address is already short enough, such URLs will wrap in a small window state, causing waste of Console output space. I hope this issue can be optimized.

Suggested solution

In the LaunchEditor output, it might be possible to solve the problem by maintaining a temporary mapping relationship. By creating a mapping relationship for the files, the addresses of the various types of files are mapped, and only the plugin's own routing address is provided in the Console.

Alternative

  1. Maintain file mapping through plugins to shorten the LaunchEditor debug address, for example, keeping it at a length of 6 digits (or even allowing this length to be customized?)
  2. Allow users to switch between using file path + line number for base64 encoding or having the plugin maintain file mapping to determine the output format of the LauchEditor URL through configuration.

Additional context

No context screenshot required.

Validations

yuyinws commented 7 months ago

Thank you. This is indeed a problem that needs to be optimized. Maintaining a temporary route mapping relationship sounds good, I will try this solution recently.

yuyinws commented 6 months ago

This feature released on v1.8.0 (release)