Comments (6)
@mjbvz might know
from platformio-vscode-ide.
@mjbvz do you have any ideas?
from platformio-vscode-ide.
Yes, we destroy the html preview whenever the user switches away from it. This is by design.
The proper approach is write the html preview so that it can save its state and then recreate itself from this state. I believe the state needs to be saved by the extension code itself. Setting cookies in the webview doesn't work and I don't think local storage will either, but I'd have to check this.
For an example of this, take a look at the markdown extension: https://github.com/Microsoft/vscode/blob/master/extensions/markdown/media/main.js It doesn't really persist any state but it does set the initial view position using vscode-markdown-preview-data
and it sends data back to vscode using window.parent.postMessage
from platformio-vscode-ide.
The problem here that our HTML Preview is a complex Web application which depends on the backend server. We need 1-2 secs to establish a connection.
2-nd problem, we don't render HTML content on-the-fly as Markdown does. Yes, in your case you can control these things. We have a pre-built Web application based on Rect components. That is a very expensive operation for us to "refresh" application.
Finally, if we have active session between Web-previewed APP and our backend (for example, physical USB Serial Monitor), we can't keep this session when a user switches between tabs.
In any case, thanks a lot for the info.
from platformio-vscode-ide.
Depends on microsoft/vscode#28263
from platformio-vscode-ide.
@mjbvz thank you so much for this API! 😊
from platformio-vscode-ide.
Related Issues (20)
- Unable to resolve configuration with compilerPath HOT 1
- Platformio problems with installation and timing out
- Start PIO Home Server
- Can't automatically flash STM32 board using DAP-Link or CMSIS-DAP via platformio in VSCode
- Start PIO Home Server
- After some nondeterministic time compile fails
- Start PIO Home Server
- Start PIO Home Server
- Start PIO Home Server
- Start PIO Home Server
- Start PIO Home Server
- Start PIO Home Server
- Unable to create stm32 project sparkfun_micromod_f405
- Error build
- Can not find working Python 3.6+ Interpreter. Please install the latest Python 3 and restart VSCode
- esp32 init error
- Start PIO Home Server
- Invalid upload target on RPI when using more than one Nucleo STM32WB55RG boards
- Start PIO Home Server
- "This extension has been disabled because it depends on an extension that is disabled." HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from platformio-vscode-ide.