You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/09/03 14:31:43 UTC

[GitHub] [cloudstack] mib1185 opened a new pull request #5406: use local copy of less.min.js

mib1185 opened a new pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406


   ### Description
   
   This PR adds a local copy of https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js and set it to be used localy, instead of always downloading a static file from the web.
   This Fixes: #5277
   
   [less.js is also under Apache-2.0 License](https://github.com/less/less.js/blob/master/LICENSE), those no issue expected to distribute the file directly.
   
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [x] Major
   - [ ] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   
   prior this change:
   ```
   $ grep "less.min.js" ui/dist/index.html 
             <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js"></script>
   $ ls ui/dist/js/less.min.js 
   ls: cannot access 'ui/dist/js/less.min.js': No such file or directory
   ```
   
   with this change:
   ```
   $ grep "less.min.js" ui/dist/index.html 
             <script type="text/javascript" src="js/less.min.js"></script>
   $ ls ui/dist/js/less.min.js 
   ui/dist/js/less.min.js
   ```
   
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md) document -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914269126


   ![Screenshot from 2021-09-07 18-02-55](https://user-images.githubusercontent.com/153340/132345732-532b9c8c-edd0-4220-bfc3-a060195601f6.png)
   UI loads local copy
   
   But not sure why I'm seeing a difference in the added file and the file got from https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js or https://raw.githubusercontent.com/less/less.js/v2.7.2/dist/less.min.js


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-912588082


   UI build: :heavy_check_mark:
   Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/5406 (SL-JID-599)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] mib1185 commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
mib1185 commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-913405573


   @rhtyd for us it is a major issue in UX, since our management environment (_based on Citrix XenApp_) is not allowed to connect to the internet, those on each page reload/open new tab the browser hangs until a timeout occurred while trying to load https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js (_Firefox ~60s, Chrome ~40s_)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
shwstppr commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914154782


   > cc @utchoang @davidjumani @Pearl1594 @shwstppr
   > Do we really need this, or can we get less to bundle on build time? And does this apply for 4.15.2?
   
   @rhtyd could be done using  pre/post build scripts but I'm not sure if that would add any value,
   
   ```
   diff --git a/ui/postbuild.sh b/ui/postbuild.sh
   index ab7734f383..72c25c8a4e 100755
   --- a/ui/postbuild.sh
   +++ b/ui/postbuild.sh
   @@ -19,6 +19,16 @@
    DIR=$(dirname $0)
    configFile="$DIR/public/config.json"
    tmpFile="$DIR/public/config.json.tmp"
   +jsDir="$DIR/public/js"
   +lessJsFile="$jsDir/less.min.js"
   +echo "Post-build: Removing ${lessJsFile}"
   +if [ -f $lessJsFile ]; then
   +   rm $lessJsFile
   +fi
   +if ! rmdir $jsDir 2> /dev/null; then
   +    echo "$jsDir contains the following files:"
   +    ls $jsDir
   +fi
    echo "Post-build: removing all docHelp suffixes in ${configFile}"
    
    node > ${tmpFile} <<EOF
   diff --git a/ui/prebuild.sh b/ui/prebuild.sh
   index 771daa84b2..00cd611906 100755
   --- a/ui/prebuild.sh
   +++ b/ui/prebuild.sh
   @@ -19,6 +19,15 @@
    DIR=$(dirname $0)
    configFile="$DIR/public/config.json"
    tmpFile="$DIR/public/config.json.tmp"
   +jsDir="$DIR/public/js"
   +lessJsFile="$jsDir/less.min.js"
   +lessJsUrl="https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js"
   +echo "Pre-build: Creating ${lessJsFile}"
   +if [ ! -d $jsDir ]; then
   +  mkdir $jsDir
   +fi
   +wget -O $lessJsFile $lessJsUrl
   +
    echo "Pre-build: list all docHelp suffixes in ${configFile}"
    for m in $(grep "docHelp: '" -R ./src | sed "s/^.*: '//g" | sed "s/',//g" | sort | uniq); do
        docHelpMappings+="${m},"
   diff --git a/ui/theme.config.js b/ui/theme.config.js
   index 8a41c49b5c..6bdd891bc7 100644
   --- a/ui/theme.config.js
   +++ b/ui/theme.config.js
   @@ -50,6 +50,7 @@ const options = {
      ],
      indexFileName: 'index.html',
      publicPath: '.',
   +  lessUrl: 'js/less.min.js',
      generateOnce: false
    }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] mib1185 commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
mib1185 commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-912584591


   @blueorangutan ui


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd edited a comment on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd edited a comment on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-913384454


   cc @utchoang @davidjumani @Pearl1594 @shwstppr
   Do we really need this, or can we get less to bundle on build time? And does this apply for 4.15.2? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd closed pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd closed pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] shwstppr commented on a change in pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
shwstppr commented on a change in pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#discussion_r703349003



##########
File path: ui/theme.config.js
##########
@@ -18,7 +18,7 @@
 const path = require('path')
 const AntDesignThemePlugin = require('antd-theme-webpack-plugin')
 
-function resolve (dir) {
+function resolve(dir) {

Review comment:
       Not needed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914272551


   @shwstppr thanks I've used src from the cloudflare URL to be safe. the one from Cloudflare is minimised.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] mib1185 commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
mib1185 commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-915032489


   > But not sure why I'm seeing a difference in the added file and the file got from https://cdnjs.cloudflare.com/ajax/libs/less.js/2.7.2/less.min.js or https://raw.githubusercontent.com/less/less.js/v2.7.2/dist/less.min.js
   
   it figured out, that this was because of the auto-formatting from VS Code


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914279364


   Commit ref - https://github.com/apache/cloudstack/commit/c0ecc34f4c8d8cfb4ae0f619a2b21330a1c145ca


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-914272060


   Merging this manually on 4.15 branch and then on main branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-912585051


   @mib1185 a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #5406: use local copy of less.min.js

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #5406:
URL: https://github.com/apache/cloudstack/pull/5406#issuecomment-913384454


   cc @utchoang @davidjumani @Pearl1594 @shwstppr
   Do we really need this, or can we get less to bundle on build time? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org