contao-community-alliance / contao-multicolumnwizard-bundle

Contao 4 Widget - MultiColumnWizard
GNU Lesser General Public License v3.0
12 stars 12 forks source link

[WIP] webpack integration #61

Closed Aziz-JH closed 11 months ago

Aziz-JH commented 4 years ago

new features:

discordier commented 4 years ago

The js code should be excluded from phpcs.

Aziz-JH commented 4 years ago

@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).

baumannsven commented 4 years ago
  1. 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.

  2. 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

zonky2 commented 4 years ago

@Aziz-JH pls check Travis and change your code

Aziz-JH commented 4 years ago

I make some changes:

  1. Removed husky for commit hooks (we don't need to rebuild the js and css files for every commit)
  2. add sourceMap for easier debugging
  3. fix the config paths to the files

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

discordier commented 4 years ago

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?

baumannsven commented 4 years ago

@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.