<div dir="ltr"><div><div>Hi,<br><br></div>The only thing I don't really like is that we need fuel-web code to build plugin. But we have can do nothing with it, as typical UI plugin by design is tightly coupled with the core. If plugin want to reuse core libraries, utils, controls then it has to declare them as dependencies and if there would be a build error if these files weren't found by r.js.<br><br></div><div>I created the <a href="https://review.openstack.org/#/c/141761/1">first version of spec</a> where described my vision of build process. You can comment on it there.<br></div><div><br></div>Some responses inline:<br><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-15 14:48 GMT+01:00 Przemyslaw Kaminski <span dir="ltr"><<a href="mailto:pkaminski@mirantis.com" target="_blank">pkaminski@mirantis.com</a>></span>:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<br>
<div>On 12/15/2014 02:26 PM, Anton Zemlyanov
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">The building of the UI plugin has several things I
do not like
<div><br>
<div>1) I need to extract the UI part of the plugin and
copy/symlink it to fuel-web</div>
</div>
</div>
</blockquote>
<br></span>
This is required, the UI part should live somewhere in statics/js.
This directory is served by nginx and symlinking/copying is I think
the best way, far better than adding new directories to nginx
configuration.<span class=""><br>
<br></span></div></blockquote><div><br>I think Anton is talking not about serving, but building the plugin.
Yes, to build the UI part of plugin you need to extract its UI part and
move/symlink it to static/plugins/<plugin_name> before you can run
the build. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class="">
<blockquote type="cite">
<div dir="ltr">
<div>
<div>2) I have to run grunt build on the whole fuel-web</div>
</div>
</div>
</blockquote>
<br></span>
This shouldn't at all be necessary.<span class=""><br>
<br></span></div></blockquote><div>Yes, it is not necessary. Actually you don't have if you add another task or option for grunt build to not build the main project. It can be achieved by removing <a href="https://github.com/stackforge/fuel-web/blob/master/nailgun/Gruntfile.js#L45-L48">these lines</a>. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class="">
<blockquote type="cite">
<div dir="ltr">
<div>3) I have to copy files back to original location to pack
them</div>
</div>
</blockquote>
<br></span>
Shouldn't be necessary.<span class=""><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div>4) I cannot easily switch between development/production
versions (no way to easily change entry point)</div>
</div>
</blockquote>
<br></span>
Development/production versions should only differ by serving
raw/compressed files. The compressed files should be published by
the plugin author.<span class=""><br>
<br></span></div></blockquote><div>On my development machine I use different ports of nginx to serve original and compressed versions of UI. It's configuration is pretty straightforward.<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000"><span class="">
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>The only way to install plugin is `fuel plugins --install`,
no matter development or production, so even development
plugins should be packed to tar.gz</div>
</div>
</blockquote>
<br></span>
The UI part should be working immediately after symlinking somewhere
in the statics/js directory imho (and after API is aware of the new
pugin but).<span class=""><font color="#888888"><br>
<br>
P.</font></span><div><div class="h5"><br>
<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Anton</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Mon, Dec 15, 2014 at 3:30 PM,
Przemyslaw Kaminski <span dir="ltr"><<a href="mailto:pkaminski@mirantis.com" target="_blank">pkaminski@mirantis.com</a>></span>
wrote:
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> First of all,
compiling of statics shouldn't be a required step. No one
does this during development.<br>
For production-ready plugins, the compiled files should
already be included in the GitHub repos and installation
of plugin should just be a matter of downloading it. The
API should then take care of informing the UI what plugins
are installed.<br>
The npm install step is mostly one-time.<br>
The grunt build step for the plugin should basically just
compile the staticfiles of the plugin and not the whole
project. Besides with one file this is not extendable --
for N plugins we would build 2^N files with all possible
combinations of including the plugins? :)<br>
<br>
P.
<div>
<div><br>
<br>
<div>On 12/15/2014 11:35 AM, Anton Zemlyanov wrote:<br>
</div>
</div>
</div>
<blockquote type="cite">
<div>
<div>
<div dir="ltr">My experience with building Fuel
plugins with UI part is following. To build a
ui-less plugin, it takes 3 seconds and those
commands:
<div><br>
</div>
<div>
<div><font face="monospace">git clone <a href="https://github.com/AlgoTrader/test-plugin.git" target="_blank">https://github.com/AlgoTrader/test-plugin.git</a></font></div>
</div>
<div>
<div><font face="monospace">cd ./test-plugin</font></div>
<div><font face="monospace">fpb --build ./</font></div>
</div>
<div><br>
</div>
<div>When UI added, build start to look like this
and takes many minutes:</div>
<div><br>
</div>
<div>
<div><font face="monospace">git clone <a href="https://github.com/AlgoTrader/test-plugin.git" target="_blank">https://github.com/AlgoTrader/test-plugin.git</a></font></div>
<div><font face="monospace">git clone <a href="https://github.com/stackforge/fuel-web.git" target="_blank">https://github.com/stackforge/fuel-web.git</a></font></div>
<div><font face="monospace">cd ./fuel-web</font></div>
<div><font face="monospace">git fetch <a href="https://review.openstack.org/stackforge/fuel-web" target="_blank">https://review.openstack.org/stackforge/fuel-web</a>
refs/changes/00/112600/24 && git
checkout FETCH_HEAD</font></div>
<div><font face="monospace">cd ..</font></div>
<div><font face="monospace">mkdir -p
./fuel-web/nailgun/static/plugins/test-plugin</font></div>
<div><font face="monospace">cp -R
./test-plugin/ui/*
./fuel-web/nailgun/static/plugins/test-plugin</font></div>
<div><font face="monospace">cd
./fuel-web/nailgun</font></div>
<div><font face="monospace">npm install
&& npm update</font></div>
<div><font face="monospace">grunt build
--static-dir=static_compressed</font></div>
<div><font face="monospace">cd ../..</font></div>
<div><font face="monospace">rm -rf
./test-plugin/ui</font></div>
<div><font face="monospace">mkdir
./test-plugin/ui</font></div>
<div><font face="monospace">cp -R
./fuel-web/nailgun/static_compressed/plugins/test-plugin/*
./test-plugin/ui</font></div>
<div><font face="monospace">cd ./test-plugin</font></div>
<div><font face="monospace">fpb --build ./</font></div>
</div>
<div><font face="monospace"><br>
</font></div>
<div>I think we need something not so complex and
fragile<br>
</div>
<div><br>
</div>
<div>Anton</div>
<div><font face="monospace"><br>
</font></div>
<div><font face="monospace"><br>
</font></div>
</div>
<br>
<fieldset></fieldset>
<br>
</div>
</div>
<pre>_______________________________________________
OpenStack-dev mailing list
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</div>
<br>
_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br>
</blockquote>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
OpenStack-dev mailing list
<a href="mailto:OpenStack-dev@lists.openstack.org" target="_blank">OpenStack-dev@lists.openstack.org</a>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a>
</pre>
</blockquote>
<br>
</div></div></div>
<br>_______________________________________________<br>
OpenStack-dev mailing list<br>
<a href="mailto:OpenStack-dev@lists.openstack.org">OpenStack-dev@lists.openstack.org</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr">Vitaly Kramskikh,<br>Software Engineer,<br>Mirantis, Inc.</div></div>
</div></div></div></div></div>