Code Monkey home page Code Monkey logo

Comments (6)

Tyriar avatar Tyriar commented on June 28, 2024

@mjbvz might know

from platformio-vscode-ide.

ivankravets avatar ivankravets commented on June 28, 2024

@mjbvz do you have any ideas?

from platformio-vscode-ide.

mjbvz avatar mjbvz commented on June 28, 2024

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.

ivankravets avatar ivankravets commented on June 28, 2024

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.

ivankravets avatar ivankravets commented on June 28, 2024

Depends on microsoft/vscode#28263

from platformio-vscode-ide.

ivankravets avatar ivankravets commented on June 28, 2024

@mjbvz thank you so much for this API! 😊

from platformio-vscode-ide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.