NPM Resource Changed ? Pending

User tests: Successful: Unsuccessful:

avatar C-Lodder
C-Lodder
1 Mar 2020

Pull Request for Issue # .

Summary of Changes

NPM scripts support arguments, so can can simply use --development and --production for the Media Manager tasks, so there's no need for the cross-env dependency

Testing Instructions

  1. Run npm run build:com_media and ensure you get a minified JS file
  2. Run npm run dev:com_media and ensure you an uncompressed JS file

Expected result

Same as before

avatar C-Lodder C-Lodder - open - 1 Mar 2020
avatar C-Lodder C-Lodder - change - 1 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Mar 2020
Category NPM Change JavaScript
avatar C-Lodder C-Lodder - change - 1 Mar 2020
The description was changed
avatar C-Lodder C-Lodder - edited - 1 Mar 2020
avatar C-Lodder C-Lodder - change - 1 Mar 2020
The description was changed
avatar C-Lodder C-Lodder - edited - 1 Mar 2020
avatar astridx
astridx - comment - 1 Mar 2020

I tested on Ubunut 18.04

  1. I applied this path and first I run npm ci.
  2. The files /media/com_media/js/mediamanager.min.js, /media/com_media/js/mediamanager.min.js.map and /media/com_media/css/mediamanager.min.css have been create. They have the same size like on branch 4.0-dev.
  3. I deleted the files from 2 and run npm run build:com_media and npm run dev:com_media like asked in the test description. After that I made sure, that the files again have been created.
avatar astridx
astridx - comment - 1 Mar 2020

I have tested this item successfully on 1fdc072


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28168.

avatar astridx astridx - test_item - 1 Mar 2020 - Tested successfully
avatar astridx
astridx - comment - 1 Mar 2020

#28150 can be closed, if we merge this PR.

avatar brianteeman
brianteeman - comment - 2 Mar 2020

Before this PR everything is generated correctly

after removing those files

npm run build:com_media correctly builds the minified files correctly

after removing those files
npm run dev:com_media does not build correctly.

The css file is created unminified but the file name is min.css
The JS file is very odd see attached

mediamanager.min.js.zip

avatar brianteeman
brianteeman - comment - 2 Mar 2020

I have tested this item ? unsuccessfully on 1fdc072

tested on windows


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28168.

avatar brianteeman brianteeman - test_item - 2 Mar 2020 - Tested unsuccessfully
avatar C-Lodder C-Lodder - change - 2 Mar 2020
Labels Added: NPM Resource Changed ?
avatar C-Lodder
C-Lodder - comment - 2 Mar 2020

@brianteeman fixed the JS file. Not sure if this fixes the CSS file too. Will test tomorrow if you don't get there first

avatar brianteeman
brianteeman - comment - 2 Mar 2020

no change on either the js or css


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28168.

avatar C-Lodder
C-Lodder - comment - 3 Mar 2020

@brianteeman I've reverted back to the original. When running npm run dev:com_media on 4.0-dev and this branch, the JS files match.

The output is an eval source map

avatar C-Lodder
C-Lodder - comment - 3 Mar 2020

@brianteeman Tested the CSS too. Honestly can't replicate your findings. Both CSS and JS are exactly the same as before

.min.css extension is used for both dev and production builds. Only difference if the CSS code is minified for dev

avatar astridx
astridx - comment - 3 Mar 2020

I just tested that again.
Now the large file (2.1MB) joomla-cms4/media/com_media/js/mediamanager.min.js is also created for me when I enter npm run dev:com_media.

avatar brianteeman
brianteeman - comment - 3 Mar 2020

.min.css extension is used for both dev and production builds. Only difference if the CSS code is minified for dev

Why use the .min.css if its not minified - makes no sense

avatar C-Lodder
C-Lodder - comment - 3 Mar 2020

That's how it was before. This PR doesn't alter any file extensions

avatar brianteeman
brianteeman - comment - 4 Mar 2020

ok so maybe thats a different issue then. Usually we have both minified and non-minified files generated and then if debug mode is on the non minified file is used (which iirc is done based on the filename)

avatar C-Lodder
C-Lodder - comment - 24 Mar 2020

Closing in favour of updating the depencency: a4416f9

avatar C-Lodder C-Lodder - change - 24 Mar 2020
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2020-03-24 16:41:12
Closed_By C-Lodder
avatar C-Lodder C-Lodder - close - 24 Mar 2020

Add a Comment

Login with GitHub to post a comment