Skip to content

Conversation

@SuperPaintman
Copy link

@SuperPaintman SuperPaintman commented Feb 21, 2018

Good afternoon!

I changed the build system a little:

  • Removed third-party modules' files and moved them to the Node modules (vivus and dom-to-image)
  • Replaced tsc build script with Webpack (I did it for better webview support)

Also I fixed few bugs (mistakes):

  • innerText -> textContent
  • classList -> className - because you assigned string to the classList

@octref
Copy link
Owner

octref commented Feb 21, 2018

If it's possible to not have the build system I'd like to avoid it and all the dependencies. I like it much better that I can write and reload the JS on the fly instead of having build/watch systems. What do you mean by better webview support?

The other two fixes are good -- thanks!

@SuperPaintman
Copy link
Author

SuperPaintman commented Feb 21, 2018

like it much better that I can write and reload the JS on the fly

You can do it with Webpack too: webpack --watch. And TS is already a sorta build system :)

What do you mean by better webview support?

It bundles all "browser" dependencies, auto injects script into HTML template, adds support for other "Web" features like a import no-TS/JS files (CSS for example).

Copy link

@ahmadawais ahmadawais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it but for some reason, the debugger doesn't work and the VSCode Extension Host doesn't launch.

@octref
Copy link
Owner

octref commented Feb 21, 2018

You can do it with Webpack too: webpack --watch. And TS is already a sorta build system :)

I'm using TS for building the code running as extension, not the webview code.
Also with webpack the sourcemap might cause problem for debugging the webview code.

t bundles all "browser" dependencies, auto injects script into HTML template, adds support for other "Web" features like a import no-TS/JS files (CSS for example).

Which I don't need. We are not building a whole app here.
Would you mind opening another PR for just the innerText and classList changes?

@ahmadawais
Copy link

@octref Can you share where can I find API ref for webview in VSCode?

@SuperPaintman
Copy link
Author

@octref see #37

@octref
Copy link
Owner

octref commented Feb 21, 2018

@ahmadawais Sadly only https://github.com/Microsoft/vscode-extension-samples/tree/master/previewhtml-sample and https://code.visualstudio.com/docs/extensionAPI/vscode-api-commands#_working-with-the-html-preview.

Currently @mjbvz is working on a new version of the API and he'll also add a dedicated doc page for developing webview extensions in our website.

@ahmadawais
Copy link

@octref thanks for that. I was not able to find much on it and these two links is what I ended up with on my own. Looking forward @mjbvz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants