? Pending

User tests: Successful: Unsuccessful:

avatar dgt41
dgt41
30 Oct 2017

Pull Request for Issue # .

Summary of Changes

Two years ago (or so) I did this Grunt file with the aim to lift some of the day to day tasks for maintainers and also provide an easy way for contributors to compile scss files and minify js and css.
As the project (J4) moved on we added a lot more functionality and the file reached about 800 lines of code, which is kinda awkward for a task runner file.
Also we already encounter (a few times) that plugins will fall out of sync with the latest releases of the underlaying scripts (postfix, uglify, etc).
Therefore I propose a a better (for the long term) solution: plain node js code, no Grunt, no Gulp, no Webpack or Rollup. The tasks are pretty straight forward and we're not doing any packaging so webpack and rollup are totally out of the picture.
Also we are now using the package.json as the only point of truth (used to be another yaml file)

Available Commands

  • Compile css
node build --compilecss
  • Prepare the installation language.js
node build --installer
  • Compile/compress js
node build --compilejs
  • Update all vendor dependencies
node build --update

Expected result

Same functionality as Grunt (some command)

Documentation Changes Required

For documentation just run

node build --help

or just

node build

Enjoy!

Preview

screen shot 2017-10-30 at 13 19 11

avatar dgt41 dgt41 - open - 30 Oct 2017
avatar dgt41 dgt41 - change - 30 Oct 2017
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 30 Oct 2017
Category JavaScript Repository Administration Templates (admin) Installation
avatar dgt41
dgt41 - comment - 30 Oct 2017

I forgot to mention that:
compilecss and compilejs options produce ALWAYS the same output, compared to the mess we had in grunt!

avatar dgt41 dgt41 - change - 30 Oct 2017
The description was changed
avatar dgt41 dgt41 - edited - 30 Oct 2017
avatar C-Lodder
C-Lodder - comment - 30 Oct 2017

You appear to be loading the wrong jQuery UI package from NPM.

Should be this: https://www.npmjs.com/package/jquery-ui
not this: https://www.npmjs.com/package/jquery-ui-dist

avatar C-Lodder
C-Lodder - comment - 30 Oct 2017

Also, can we kill the uncompressed CSS files please? We're not using them at all.

avatar mbabker
mbabker - comment - 30 Oct 2017

Also, can we kill the uncompressed CSS files please? We're not using them at all.

Unless you're going to kill support for the core templates and core media loading uncompressed files in debug mode they should stay.

avatar C-Lodder
C-Lodder - comment - 30 Oct 2017

@mbabker - Atum doesn't have any uncompressed CSS files and works perfectly fine in debug mode: https://github.com/joomla/joomla-cms/tree/4.0-dev/administrator/templates/atum/css

avatar mbabker
mbabker - comment - 30 Oct 2017

I know it all works fine in debug mode. JHtml only uses uncompressed if it can take a .min.foo filename, convert it to .foo, and find a file that exists. So if uncompressed media doesn't exist then the compressed file still gets loaded.

This might be OK for the template media, but it should still be possible to get the core media in uncompressed format. Which means either we keep them in repo & ship them or people have to go through extra steps to compile them.

avatar dgt41 dgt41 - change - 30 Oct 2017
Labels Added: ?
avatar Fedik
Fedik - comment - 2 Nov 2017

@dgt41 it is still WIP?

I got error:
screen 2017-11-02 17 55 32 970x275

avatar Fedik
Fedik - comment - 2 Nov 2017

@dgt41 ignore me, all works fine

avatar Fedik
Fedik - comment - 3 Nov 2017

@dgt41 one note:

       "srcjs": "dist",
       "srccss": "dist",
        "filesjs": [
          "cropper.js",
          "cropper.min.js",
          "cropper.js.map"
        ],

I found it confusing, because you have "srcjs": "dist", and dist usually contain distributive files, not source ?

And question.
Is there no way to get the module path, and scan for available files, automatically?
something like :

var pathToModule = require.resolve('moduleBlabLa');
var files = scanforJsCss(pathToModule);
avatar dgt41
dgt41 - comment - 3 Nov 2017

@Fedik that's an interesting idea, I have to explore that

avatar C-Lodder
C-Lodder - comment - 17 Nov 2017

Could we get the conflicts on this fixed please and then merge?

Any improvements can be made at a later date

avatar dgt41
dgt41 - comment - 31 Dec 2017

Grrrr
screen shot 2017-12-31 at 11 24 01

avatar joomla-cms-bot joomla-cms-bot - change - 31 Dec 2017
Category JavaScript Repository Administration Templates (admin) Installation JavaScript Repository Administration Templates (admin)
avatar C-Lodder
C-Lodder - comment - 31 Dec 2017

Just recompile and remove the grunt-settings.yaml

avatar joomla-cms-bot joomla-cms-bot - change - 31 Dec 2017
Category JavaScript Repository Administration Templates (admin) JavaScript Repository Administration Templates (admin) Libraries
avatar dgt41
dgt41 - comment - 31 Dec 2017

@wilsonge important please merge this!!

avatar C-Lodder
C-Lodder - comment - 2 Jan 2018

@wilsonge please merge. This is a choice made by the JS team and will also assist the Ciaran and myself who are the primary people making use of the feature.

avatar dgt41
dgt41 - comment - 4 Jan 2018

@wilsonge any decision here, before you merge more things and make this harder to get it again in sync?

avatar wilsonge
wilsonge - comment - 16 Jan 2018

Fix the conflicts and I'll merge it. I'm very uneasy about this to be honest. I still think gulp might be better for us. But let's just get it in so it's not blocking you guys

36208ba 17 Jan 2018 avatar dgt41 init
aaf7854 17 Jan 2018 avatar dgt41 fixes
884c01f 17 Jan 2018 avatar dgt41 sync
141ac62 17 Jan 2018 avatar dgt41 sync
avatar dgt41
dgt41 - comment - 17 Jan 2018

This is in-sync again. Ping @wilsonge

avatar wilsonge
wilsonge - comment - 17 Jan 2018

You need to fix travis please

cf49472 17 Jan 2018 avatar dgt41 tests
avatar dgt41
dgt41 - comment - 17 Jan 2018

Travis is happy again

avatar wilsonge wilsonge - change - 17 Jan 2018
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-01-17 21:20:57
Closed_By wilsonge
avatar wilsonge wilsonge - close - 17 Jan 2018
avatar wilsonge wilsonge - merge - 17 Jan 2018
avatar dgt41
dgt41 - comment - 17 Jan 2018

Thank you!

avatar infograf768
infograf768 - comment - 19 Jan 2018

@dgt41
I'm afraid this has broken, among other stuff, the radio field on Firefox.
See #19403

avatar C-Lodder
C-Lodder - comment - 19 Jan 2018

We are in the process pf fixing things

Add a Comment

Login with GitHub to post a comment