tomjs / vite-plugin-vscode

用 vue/react 来开发 vscode extension webview ,支持 esm 和 cjs。Use vue/react to develop vscode extension webview, supporting esm and cjs.
MIT License
40 stars 6 forks source link

weird delay in dev mode #5

Closed subframe7536 closed 4 months ago

subframe7536 commented 5 months ago

Thanks for your great works!

It seems that the plugin patch the acquireVsCodeApi function in dev mode. It cause weird delay on startup and I have to rerun the function in setImmediate(setTimeout()). And the prod mode have nothing wrong.

My code is here

tomgao365 commented 5 months ago

@subframe7536 Thank you very much for using this library. I'm ashamed that I wanted to use it to develop extensions, but I didn't start for some reason. Sorry, I don't have a good solution for now. Development mode uses @tomjs/tomjs/vscode-extension-webview to implement it, which is actually an iframe. The client's acquireVsCodeApi is simulated and uses window.postMessage to communicate with the parent. Could you provide some better ideas? Thanks!

tomgao365 commented 5 months ago

@subframe7536 Try v2.5.0 to see if it solves your problem

subframe7536 commented 5 months ago

OK, I will check it out this weekend

subframe7536 commented 4 months ago

Same...🤔

tomgao365 commented 4 months ago

😂 Alas, I have no solution for now. My experimental project uses this, and it is fine during the development stage. https://github.com/tomjs/vscode-snippets-manager

subframe7536 commented 4 months ago

I just release the first version of my extension, and this issue just cause little DX problem. So I plan to close it. Thanks again for your great works!