Reasonable to JBOT resource-override chunk from plone.staticresources

I want to validate an assumption about overriding a single JS file chunk from plone.staticresources, based on things I've pieced together from a few different threads here โ€” maybe someone has either done this already, or knows if I'm playing with fire here (e.g. filename instability).

To avoid maintaining a private fork of plone.staticresources:

  1. I want to consider deploying a customization of the pat-tinymce link modal in an add-on as a single resource file override (via zc3.jbot >= 1.1.0 resource override)

  2. with the single resource here (plone.staticresources master branch) being static/bundle-plone/chunks/tinymce_plugins.6f290aa6d2213b2ee16d.min.js having its equivalent chunk asset (different filename, but easy enough to see in via git status after build) to an overrides/resources directory in my policy product with a filename of plone.staticresources.static.bundle-plone.chunks.tinymce_plugins.6f290aa6d2213b2ee16d.min.js (well, this and probably the chunk containing related CSS embedded in JavaScript).

I have already built my changes against mockup and its usual webpack processes, and I'm satisfied with what I have put together, but want a reasonable way to narrowly package just my cutomization/override into my policy package.

Is this reasonable? Are there any other pitfalls I might encounter besides moving target of chunk/resource filename between Plone releases?

I'm also interested in that. As went the fork way and created an internal release of plone.staticresources with our mockup changes, but we would love to know if there are easier days to do this :smiley:

Just an idea:

  1. create a customer.staticresource addon package with webpack.config, JS resources and a GS profile (for later resource registry entry)
  2. add @plone/mockup as dependency in your package.json
  3. copy only the pattern code which you want to customize into your custom package resource folder (src/pat/tinymce for example)
  4. create your own src/patterns.js file with all the default patterns (see mockup/src/patterns.js at master ยท plone/mockup ยท GitHub ... use @plone/mockup/src/pat/autotoc/autotoc for default pattern import) but change the path of your locally customized pattern
  5. build the whole stack
  6. now unregister the plone bundle and register your customer bundle in RR

with this, you could also easily update mockup version if there is a new release while keeping your customizations in place...

2 Likes

@petschki we have tried this way and it works.