Not even taking into account you will have to recreate them all if a new version of BDAV3 is published.
I hear you and thanks, perhaps let me clarify for us to engage some more. My angle and thought process was for the Package Manager, not just for me but for every developer who will use BVAD3 and it will be specific to Tree-Shaking.
Unsolvable Problem 1: We have a fat js and css files for VueJS + Vuetify.
Tree-shaking on this is impossible. The nice thing for VueJS on the other hand is one can execute code like this.
// src/plugins/vuetify.js
import Vue from 'vue'
import Vuetify, {
VCard,
VRating,
VToolbar,
} from 'vuetify/lib'
import { Ripple } from 'vuetify/lib/directives'
Vue.use(Vuetify, {
components: {
VCard,
VRating,
VToolbar,
},
directives: {
Ripple,
},
})
const opts = {}
export default new Vuetify(opts)
Which ensures that only the components needed for the project are used, e.g. VCard, VRating, VToolBar above and the rest are discarded.
If I understand BANano correctly, tree-shaking is done with RemoveDeadCode transpiler options etc, however what I am not sure of is the depth of that process.
So I thought, what if, when anyone is developing, they can tree-shake their b4xlib themselves by...
1. For example, BVAD3 has 100+ components, and for your project you only use 10 components. With the package manager, one is able to choose the 10 components they need, this builds a b4x based on the bas files one chose, leading to the Custom Views of your choice. In one of Aerics comments he was indicating that one could minimize the custom view list with "most used components". Now as one creates their own "most used components" they have full control on what their BVAD3 custom view list is like. They built it themselves with the package manager.
2. One can save these packages as "templates" which can be re-used and re-compiled based on the developers preferences.
3. Depending on the choices of components made, the dependencies on the resource files are trimmed to fit that budgeted code to be used.
4. This has links to the JS and CSS files. Thing is one can also use online cached resources for this. When building their own b4xlib, developers can choose whether they want to use online resources / assets based resources. At times people are not able or don't want to access the internet and just want to develop without the hustle, this helps for deployment at a later stage, as choosing online resources will change the code to link to that on BANano.Header.Add???
Whilst just setting .UseServiceWorker brings the offline caching of JS/CSS/Images etc, these work on https only isnt it?
5. To address the developers looking for the "plug and play" approach, then following your advise on your post above makes perfect sense. A friend has been indicating the need to make BVAD3 lighter before and just reminded me again after seeing these posts.
I appreciate your feedback. ?