opencomponents / oc-client-browser

The OpenComponents Browser client
MIT License
6 stars 8 forks source link

Remove unused features from l.js #99

Closed ricardo-devis-agullo closed 1 year ago

ricardo-devis-agullo commented 1 year ago

l.js has this feature

<script src="l.js?checkLoaded"> // <- adding checkLoaded to the url will dumbly check already inserted script/link tags
    ljs
        .addAliases({
            jQuery:'http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js#jqueryId' // <- script tag will have attribute id=jqueryId
            ,ui:[
                'jQuery'
                ,'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js'
                ,'myUITheme.css'
            ]
        })
        .load('ui',function(){
            /* work with both jquery and jquery-ui here */
        })
    ;
</script>

Where you can check for l.js already, add aliases and have content already inside the script. But we don't load l.js from a script tag, since we embed it on oc-client-browser, so all these features will not be used. This PRs removes those functionalities so the bundle can go from 9.4Kb to 9.0kb.