thegreystone / jmc-flame-view

View for Mission Control for rendering stack traces as flame graphs. Note that this is now part of JMC 7.1.0, and all further development will take place in the JMC repos.
Other
103 stars 11 forks source link

Bundle the JSon libraries with the plug-in. #7

Open thegreystone opened 6 years ago

thegreystone commented 6 years ago

It would be nice to be able to work with the Flame Graph view, even when there is no direct connection to https://cdnjs.cloudflare.com. That said, it may be an issue getting at the resources as they are in a jar, and need to be referenced from the HTML. One solution would be to just write the JavaScript libraries to a well known location (a well known folder in temp for example). That however may be considered a security risk.

This bug is about figuring out how to best accomplish bundling the JSon libraries with the plug-in. ;)

nbogojevic commented 6 years ago

One way to work around this is to launch local server that listens on random ephemeral port and serves all this content from class path resources. All javascript libraries would be bundled inside (maybe along page.html file). Browser in view would then target the server url instead of using setText.

thegreystone commented 6 years ago

Yep, that is one alternative. It would be interesting to see if such a solution would have different performance characteristics.

nbogojevic commented 6 years ago

Did some test around this approach. Subjective feeling is that actually seems faster to render when content is served via server, there are also some advantages as javascript code can be well cached by browser, but I have to test it little bit more.

The approach also allows to work around #4 - in that one I think the issue is that eclipse uses internet explorer to render web pages on all versions of Windows. By using embeded server, I can open it in external browser (Chrome, Firefox, Edge) and it renders correctly.

thegreystone commented 6 years ago

Oh gods. There should be a bug open on Eclipse for embedding Edge instead of Internet Explorer when available. ;)

thegreystone commented 6 years ago

I opened one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=538991