Split JS Minification on Client/Board and ACP
-
Hello guys,
Would be nice to have 2 different concatenated/minified scripts for board and ACP.
Now it's singlenodebb.min.js
.
I propose split responsibilities, so we will havenodebb.min.js
andacp.min.js
@baris @julian @psychobunny what do you think on it?
-
I just looked it up, there is no ACP related code in
nodebb.min.js
, but it is also included on the ACP side for libs likeajaxify
-
@psychobunny Plugins will grow. And adding JS related only for UX in ACP, isn't great
-
oh I see, you're looking to improve the ACP's performance. yeah that makes sense. I think all ACP needs is
app
,ajaxify
,translator
, andtemplates.js
-
Give ability to specify in
plugin.json
, where my js should be concatenated
In my case, 95% of client JS is related to ACP, but It's part ofnodebb.min.js
... -
Gotcha, I totally forgot about the fact that
nodebb.min.js
includes ACP plugin scripts as well. In that case I take my first comment back - even on this community it should cut down maybe 10-20kb worthacp.min.js 路 Issue #3134 路 NodeBB/NodeBB
Right now, ACP just requires all files separately and unminified. Additionally it includes the entire nodebb.min.js file despite the fact that it only requires app, ajaxify, translator, and templates.js Also, allow plugins to define acpS...
GitHub (github.com)
-
Nicolas, I'm assuming you don't want to put your js inline in the template?
For my plugins (I have my own fork of quickstart that I use), I actually make them require.js modules, so they are loaded on-demand: https://github.com/NodeBB/nodebb-plugin-quickstart/blob/julian/static/lib/admin.js
But looking back, this might also minified, so...