f.haeder.net

Hacking friendica code with trailing/leading white-spaces

When editing #Friendica code, I use a local commit hook, finding leading and trailing white-spaces. The hook itself is GIT's default pre-commit hook plus a few extra lines:

# Find bad scripts
./util/typo.php

# PHPUnit
if [ -x ./vendor/bin/phpunit ]
then
./vendor/bin/phpunit || exit 255
fi


So, please don't wonder when I touch "the whole file". Then I have just changed DOS -> Uni* line-break (CRLF to LF) as it was being detected as trailing white-space characters.
#Friendica code friendica white-space
js/country.js is indented with space and tabs, I fix that to tabs now. Plus I have fixed some JS warnings due to missing semicolon.
I would also recommend to start with #cache-busting which means, adding version numbers to JS/CSS files (and URLs).
Browsers (even #Firefox #Quantum) tend not to download CSS/JS when they have downloaded it already. This forces your users to press CTRL+F5 (under Firefox at least). The fix is to include a version number in the URL and always increment it when you change something.

Examples: /js/main.js?v=1.0.0 or /css/default.css?v=1.0.0

Static files normally ignore parameters so this is safe to do so. When you change that file, just increment the last patch number until you want it (I prefer to increment from 1.0.9 to 1.1.0 but that is up to the community (you should come up with a versioning convention). #cache-busting
Na, #quantum should be the correct hashtag. #bug
Later posts Earlier posts