? Pending

User tests: Successful: Unsuccessful:

avatar asika32764
asika32764
16 Feb 2018

This PR attempts to add file watch to compilecss and compilejs that we can get rid of re-compile manually every time after code changed.

Usage

Watch CSS

npm run watch:css

Watch JS

npm run watch:js

Watch both

node build --compilecss --compilejs --watch

Just curious why we don't use Gulp?

avatar asika32764 asika32764 - open - 16 Feb 2018
avatar asika32764 asika32764 - change - 16 Feb 2018
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 16 Feb 2018
Category Repository JavaScript
avatar asika32764 asika32764 - change - 16 Feb 2018
The description was changed
avatar asika32764 asika32764 - edited - 16 Feb 2018
avatar asika32764 asika32764 - change - 16 Feb 2018
Title
Build.js support watch files
[4.0] Build.js support watch files
avatar asika32764 asika32764 - edited - 16 Feb 2018
avatar asika32764 asika32764 - change - 16 Feb 2018
Title
[4.0] Build.js support watch files
[4.0] Build.js support file watch
avatar asika32764 asika32764 - edited - 16 Feb 2018
avatar asika32764 asika32764 - change - 16 Feb 2018
The description was changed
avatar asika32764 asika32764 - edited - 16 Feb 2018
avatar asika32764 asika32764 - change - 16 Feb 2018
The description was changed
avatar asika32764 asika32764 - edited - 16 Feb 2018
avatar wilsonge wilsonge - change - 17 Feb 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-02-17 18:11:11
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 17 Feb 2018
avatar wilsonge wilsonge - merge - 17 Feb 2018
avatar wilsonge
wilsonge - comment - 17 Feb 2018

Seems good to me. Native JS over gulp was a decision made by @dgt41 . He's the person to explain the rational :)

avatar dgt41
dgt41 - comment - 19 Feb 2018

@asika32764 sorry for delayed answer, so here is a hint towards where we are aiming with this: Dev tools

avatar asika32764
asika32764 - comment - 23 Feb 2018

@dgt41 It will be great if we have our own packager to help developers like Laravel Mix did.

However, I have ever worked with Gulp, Webpack and Laravel Mix, and I have some suggestion that if we create our own packager and based on some core library (if not based on vanilla JS), we should choose Gulp rather than webpack.

There are some reasons:

  1. Gulp is a script manager which help use handle multiple standalone files, while the main purpose of webpack is that bundle all files to one file, it is not suitable for Joomla (Since we use php handle dependencies).
  2. Webpack must uses plugins to extract standalone files from main entry file, it is an ugly process and make the config file not human readable. And Gulp did will on this part because of pipe line syntax.
  3. Gulp is more flexiable, there is a case that I want to create sourcemap only for non-minified file, Gulp pipe line is able to do this but webpack contains sourcemap mark on both minified and non-minified files and it is hard to remove it in the process (Webpack logic is buiild all first -> then separate them, see).
  4. Webpack unable to handle symlinks but Gulp does.

I'm not mean webpack is bad. The main benefit of using webpack is based on it's loaders since webpack's task is to auto load all dependencies and bundle them. It is good for pure frontend projects. And Gulp more like a Makefile to help use compile our codes automatically.

Just personal opinion and share some experience after using Mix.


I'm also creating a Gulp wrap for my framework similar to Laravel Mix, see: https://github.com/ventoviro/windwalker-fusion/blob/master/test/gulpfile.js

Add a Comment

Login with GitHub to post a comment