Splitting Orejime into multiple files could reduce the downloaded weight by a great factor in nominal use cases.
The most gain would be attained by splitting it in two parts:
The core that would contain the pure mechanics: config, storage and DOM manipulation
The UI that would get loaded only if user interactions are needed.
This way, the first time a user would visit a site, the core would load, detect that user consent is needed, and load the UI.
On subsequent visits, the core would load, detect that the user has already made a decision, setup the configured apps and stop right there.
To go one step further, there could be another gain by loading the required translations on the fly, instead of bundling them all with the main package.
Splitting Orejime into multiple files could reduce the downloaded weight by a great factor in nominal use cases. The most gain would be attained by splitting it in two parts:
This way, the first time a user would visit a site, the core would load, detect that user consent is needed, and load the UI. On subsequent visits, the core would load, detect that the user has already made a decision, setup the configured apps and stop right there.
To go one step further, there could be another gain by loading the required translations on the fly, instead of bundling them all with the main package.