basset icon indicating copy to clipboard operation
basset copied to clipboard

[WIP] Basset v2 Changes Shortlist

Open tabacitu opened this issue 1 year ago โ€ข 3 comments
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:cache on install, then have the assets (no more DEV_MODE);
    • CONS: none
  • 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:cache on 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:cache on install, then have the assets (no more DEV_MODE);
    • 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:refresh on 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; โš ๏ธ

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')

tabacitu avatar Oct 17 '24 12:10 tabacitu