https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35716

--- Comment #39 from David Cook <[email protected]> ---
(In reply to Paul Derscheid from comment #36)
> So here's how I see this happening.
> 
> We have a shared src directory where we have the js scripts/modules, then we
> configure the bundler (rspack) to output bundles to the destinations where
> those scripts/modules previously lived.
> 
> Easy setup, minification, watching for file changes, perfectly ktd
> compatible with low overhead.
> 
> Thoughts?

I've got a few questions and comments.

1. At the moment, this looks like it would only work for Javascript? There
could be many different file types that need to be shared, although I imagine
rspack could be updated to handle other formats as well?

2. If I understand correctly, it would work for KTD, because rspack would watch
for changes in the source files, and then build new ones at save time? How does
that factor into the test plan?

3. I'd suggest not using "/koha-tmpl/shared", because
"/kohadevbox/koha/koha-tmpl" is the DocumentRoot for KTD/git deployments where
with the Debian deployments it's like /usr/share/koha/opac/htdocs and
/usr/share/koha/intranet/htdocs. I went with "/public" in my patch, so that the
files wouldn't be web-accessible except as we explicitly define. We could add
Apache rules to block access to it, but seems to me it would be easier just to
put it in a different source directory other than a web server accessible one.

4. It looks a bit verbose in terms of on-going maintenance, but not
unmanageably so. 

5. Minimizing for production is pretty cool. 

6. Looking at it again... does it bundle all the listed entries into one file?
That seems very suboptimal, since we wouldn't want to load everything for every
page?

7. I like that the change is all dev-side and wouldn't require any changes to
existing installations.

8. How would you manage "./koha-tmpl/opac-tmpl/lib" and
"./koha-tmpl/intranet-tmpl/lib"? It seems to me that these are some of the
libraries that would benefit the most from being shared across the two
interfaces.

--

Overall, I'm intrigued! I hope the above isn't off-putting. They're just some
thoughts that came to mind while reviewing the patch and thinking about it. 

I'd love for us to come up with a solution for this. Just yesterday I was
copying the exact same Javascript file between both interfaces and feeling a
little sad about it.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to