Closed Aziz-JH closed 11 months ago
The js code should be excluded from phpcs.
@discordier how can I exclude it from phpcs? If we are not longer using phpcs for js files, we can use eslint and CSSLint, for code quality. I can integrated it to the build procese. It should be possible to add the cssLint and eslint settings to phpcs (see: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-path-to-csslint).
If you are already using webpack, you should also use native javascript. It is e.g. iterated over elements with the function .each()
. This can be replaced by .forEach()
. To have a fallback for browsers there is also nodelist-foreach-polyfill
.
A dditionally I noticed that no versioned files are created.
I myself use webpack in my bundles. How to handle the versioning you can also see with them. You have to install composer contao-community-alliance/contao-polyfill-bundle
. This will prepare for Contao <= 4.4 the symfony asset this in Contao 4.5 added.
https://github.com/ContaoBlackForest/contao-member-send-password
@Aziz-JH pls check Travis and change your code
I make some changes:
Some information about the new frontend development and my thought:
If someone develop on the js and css files, the developer should use npm run start
, this starts the file watcher in the background and creats a sourceMap. But before the developer commit he must make a npm run build
for creating the minified files without sourceMap.
@baumannsven Thank you for bringing the symfony asset up. I like it a lot, but my biggest fear is, someone commit multiple hashed js/css files in the project and we have a mess. But we should try it. First of all for this feature, we need contao-community-alliance/contao-polyfill-bundle
for the Contao 4.4 support. I try to integrate something there :)
Sidenote, you mentioned you added a pre-commit hook and removed it again. Yet I fail to see them in the commit view here on github. Am I blind or are they hidden away when reading the commit diffs online?
@Aziz-JH Show you in this package https://github.com/ContaoBlackForest/contao-member-send-password. Their is an cleaner, that the build directory delete all files. So you have no multiple files with the same name.
new features:
pre-commit for a automatic build with husky(I think we dont need rebuild the js and css files for every commit)