Skip to content

Conversation

Morlinest
Copy link
Member

Minify css only when building gitea so we can develop, debug and compare changes. JS should be add in the future.

Also needed for changes in building gitea with drone - including docker image with node instead of installing node on drone build.

@codecov-io
Copy link

codecov-io commented Sep 22, 2017

Codecov Report

Merging #2580 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@ Coverage Diff @@ ## master #2580 +/- ## ======================================= Coverage 27.33% 27.33% ======================================= Files 86 86 Lines 17137 17137 ======================================= Hits 4684 4684 Misses 11775 11775 Partials 678 678

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fa6d7c7...48cd7da. Read the comment docs.

@tboerger tboerger added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 22, 2017
@lunny lunny added this to the 1.3.0 milestone Sep 23, 2017
@lunny lunny added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Sep 23, 2017
Copy link
Member

@lunny lunny Sep 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why recovery this css file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put the unminify content on git should be friendly to develpers, so I agree with this change.

Copy link
Member

@lafriks lafriks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

index.css file should be left minimized

Makefile Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rename this build step to minify-stylesheets ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@daviian this step will later be used also to minify js files etc, so can be left as is

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lafriks That's exact reason for that name.

@lafriks
Copy link
Member

lafriks commented Sep 23, 2017

I'm somehow against it. Development should be done in .less files and if you want to experiment you can unminify in browser

@Morlinest
Copy link
Member Author

@lafriks @lunny There are few reason why I think css should be unminified til build process:

  1. To be able to use pre-build step with nodejs (we are using only "go" or only "nodejs" image, "generate css + minify" needs both images)
  2. To be able to develop and test on local env without need to change less and regenerate css all the time
  3. To be able to check existing styles and rules in development/test
  4. To be able to check changes done in less file and the corresponding changes in css
  5. Same workflow will be applied for JS, it is better to be able develop and check changes before minifying it

Another question: If we add JS to "minify", would you like to have 2 different workflows for JS and CSS?

@lafriks
Copy link
Member

lafriks commented Sep 24, 2017

@Morlinest

  1. I'm not against this
  2. You will still need to make changes in less files so I don't see point on making changes first in css as this is duplicate work and you anyway in the end need to regenerate css and there is chance that you can lose some of work
  3. What do you mean here? (You can check rules in browser dev tools also from minimized)
  4. We need to check only less changes in PR, drone ci step will verify that css file is correctly updated
  5. For js there will still source files and that is only thing we need to verify, drone will check minified
@lafriks
Copy link
Member

lafriks commented Sep 24, 2017

As for your question it should be same workflow.

@Morlinest
Copy link
Member Author

@lafriks OK, I agree with you about no need of not minified version of css.

Now look at #2581. Stylesheets test is based on differing before and after generating it from less file. But minify is part of go env, not js env. The only solution I see for this is to use "nodejs minify" instead.

For JS, you want to create *.min.js from *.js and use it inside template? What about development, debug?

@lunny
Copy link
Member

lunny commented Sep 24, 2017

LGTM

@tboerger tboerger added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 24, 2017
@lafriks
Copy link
Member

lafriks commented Sep 24, 2017

Minify can be changed to nodejs version, I see no problem with that.

As for js files there should be single js file built from multiple js files. Both minified and unminified can be built and as we already have mode in app.ini (production/development) that can be used to include either minified or unminified version

@Morlinest
Copy link
Member Author

Morlinest commented Sep 24, 2017

I forgot about modes app.ini. I'll try do some changes.

@Morlinest Morlinest changed the title Use minify as custom build step Compress css with nodejs Sep 24, 2017
@Morlinest
Copy link
Member Author

@lafriks Changed PR to just minify css with nodejs instead in single step.

@lafriks
Copy link
Member

lafriks commented Sep 24, 2017

LGTM

@tboerger tboerger added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 24, 2017
@lafriks lafriks merged commit 086eb62 into go-gitea:master Sep 24, 2017
@Morlinest Morlinest deleted the fix/minify-on-build branch September 24, 2017 19:47
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile

6 participants