basset
basset copied to clipboard
[WIP] Basset v2 Changes Shortlist
trafficstars
TODO:
- A. ๐ด Remove the need for symlink by saving the files in the public folder (
public/bassets), GIT IGNORED:- PROS:
- Easier to install: No need to create a symlink.
- Easier to develop: You run
php artisan basset:cacheon install, then have the assets (no more DEV_MODE);
- CONS: none
- PROS:
- B. ๐ด๐ก File map/manifesto to easily track file versions across multiple files
- C. ๐ก In airgapped servers, we have no support for files with variables (eg. multiple languages: select2/en/select2.js, select2/pt/select2.js) - basically add support for
@basset('http://example.com/select2.'.$lang.'.js', ['lang' => ['en', 'ro', 'pt', 'it']]) - D. ๐กโ๏ธ Deprecate zips, load the files directly from
http://raw.github.com/someone/somerepo/tag/1.2.3/asset.js - E. ๐ด eliminate DEV_MODE - the different behaviour in local/staging/production is causing more trouble than it's worth
--
ALSO TO DO:
- F. ๐ด Remember assets in git (do NOT gitignore
public/bassets):- PROS:
- Faster deployments: No need to run
php artisan basset:cacheon deploy; - Safer deployments: If CDN is down during deployment, no problem;
- Easier to install: No need to create a symlink.
- Easier to develop: You run
php artisan basset:cacheon install, then have the assets (no more DEV_MODE);
- Faster deployments: No need to run
- CONS:
- Big git repo size: All the CSS and JS assets will be commited to repo, whether you use them or not; โ
- Dirty commits: Every time you run
php artisan basset:refreshon local, you override the changed CSS and JS files => dirty diffs; โ ๏ธ - Dirty repo in staging/prod: If an asset has NOT been internalized in local, it will be internalized in staging/prod and dirty that repo; possibly preventing the next deployment; โ ๏ธ
- PROS:
DON'T DO:
- G. โซ Do not "cache" @bassetBlocks, they are already on the page, no need to put them on a file to get an additional file
--
LET'S NOT TALK ABOUT IT:
- ๐ก Create a way to don't push not used assets (eg: if you don't use select2, don't push it).
- ๐ต no easy way to update assets used (no
php artisan basset:update) - ๐ต no easy way to get notified when an asset has security issues
- ๐ต checksums (aka. integrity checks)
Examples:
@basset('http://example.com/select2.js')
{
"select2.js" : "http://example.com/select2.js"
}
@basset('select2.js')