Compiling resource bundles questions


I'm having some confusion about compiling bundles with the new resource registry.

I'm following

I am using ./bin/plone-compile-resources --site-id=Plone --bundle=plomino

Some things I don't understand. It generates a lot of other files I don't want. like src/Products/CMFPlomino/browser/static/js/plominodynamic-compiled.js. Why?
What it's supposed to compile to is src/Products/CMFPlomino/browser/static/js/plomino-compiled.js. It only seems to do that sometimes. I had to reinstall plomino on the "Plone" localhost site just now to get it to compile the plomino-compiled.js.

Now originally @ebrehault was compiling via TTW and copying back to the filesystem. Is that really the best way?
This new way of doing it however seems to create bigger files and also seems to hard code absolute paths of my development environment in them, why is that?
More confusing if I compile using ./bin/plone-compile-resources --site-id=Plone --bundle=plomino --compile-dir=src/Products/CMFPlomino/browser/static/ then I get a static/plomino.min.js file which is smaller and doesn't have the full paths in, but its not in the right place with the right name as defined in

Finally the documentation says that I have update the last compiled date. Why? Can't we use the creation date of the file? It's hard to remember this.
Oh and it seems you also have to remember to reinstall your product because the compilation date needs to go into the configuration registry. Also error prone.

just another proof of how buggy the bundling mechanism is in its current state; and this is happening to someone with way lot more experience than most of us.

do we have to wait until Plone 6 to try to fix this? I don't think so.

@ramon @datakurre @vangheem. It was actually a serious question not a rant. I'd like to update the documentation particularly with design rationale.

I don't know. I've never used that script.

(Before I moved to webpack built themes, I used pure require.js as in

does anyone know if this script is supported? Does everyone just compile it TTW?

Well, I never compile TTW, so always use the script. But AFAICT it works only in latest Plone 5.1.b2 after I fixed a bunch of issues with it. I recommend to use it for addon development and it works fine i.e. in

If your bundle configuration in your registry is set correctly it should compile only what you asked it for.

@jensens So you don't get a lot of extra unneeded files generated?
I'm not using 5.1 however so perhaps that was something that was fixed?

The registry.xml has

  <records prefix="plone.bundles/plomino"
    <value key="resources">
    <value key="merge_with">default</value>
    <value key="enabled">True</value>
    <value key="depends">plone</value>
        <value key="stub_js_modules">
    <value key="compile">True</value>
    <value key="jscompilation">++resource++Products.CMFPlomino/js/plomino-compiled.js</value>
    <value key="csscompilation">++resource++Products.CMFPlomino/css/plomino-compiled.css</value>
    <value key="last_compilation">2017-02-26 10:26:00</value>

and it creates files for each resource and also another for the final bundle.

Also, with plugin development, after I run buildout to install a new version, there is no way to have changed JS without reinstalling the profile on every plone site thats on a zope platform?

@djay - looking at and - this doesn't follow the best practices.

All those concepts - especially the distinction between bundle and bundle resource - are hard to explain. There are many ongoing discussions on how to improve the situation. Independently from your question here I'm preparing a PLIP draft, which I think has the potential to improve and simplify these concepts while even bringing more flexibility.