Refuse to build/start erlangpl when UI is not built
arkgil opened this issue · comments
As reported by @sashaafm in #30, and other people on other communication channels, building and starting erlangpl
without building UI first throws rather cryptic error.
The most reliable solution would be to refuse to compile (make
) or bootstrap
when we can't find prebuilt UI files. We could, for example, check if we can find apps/epl/priv/htdocs/index.html
file when bootstraping.
No there is not. I have no idea what his code supposed to do.
I suppose it could be safely removed then. @michalslaski what do you think about it?
In the old UI it was used to display which node is being observed. The new UI retrieves this info over WebSocket. It can be safely removed.
We will need a way to inject plugins' JS and CSS at some point, but we can discuss that once the new plugin system is ready.
@michalslaski I have that nasty ejs (it's default templating language for HtmlWebpackPlugin we're using) template for injecting plugins` JS and CSS into UI build and to test how it works in general. We will have to make something similar from Erlang.
<!-- injects plugins' JS and CSS -->
<% var plugins = htmlWebpackPlugin.options.plugins %>
<% for(var i = 0; i < plugins.length; i++) {%>
<% var n = plugins[i].name %>
<% var scripts = plugins[i].scripts %>
<% var styles = plugins[i].styles %>
<% for(var j = 0; j < scripts.length; j++) {%>
<script type="text/javascript"
src="/<%= n + "/" + scripts[j].name %>"></script>
<% } %>
<% for(var k = 0; k < styles.length; k++) { %>
<link
rel="stylesheet"
href="/<%= n + "/" + styles[k].name %>">
<% } %>
<% } %>
Closing this, since there is not much more we can do to "force" people to build UI :)