Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move highlight.js to npm/webpack #10011

Merged
merged 2 commits into from Jan 28, 2020
Merged

move highlight.js to npm/webpack #10011

merged 2 commits into from Jan 28, 2020

Conversation

silverwind
Copy link
Member

  • introduced window.config to help with js-based lazy-loading
  • adjusted webpack chunk naming to avoid 'vendors~name.js' that webpack defaults to for vendor chunks.
  • added theme class to html and prefixed all selectors. this is neccesary so that the theme styles win over the lazy-loaded ones.

webpack.config.js Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 26, 2020
@silverwind
Copy link
Member Author

silverwind commented Jan 26, 2020

There are regressions in the dark theme rendering, will figure something out (likely making its hljs selectors !important).

Edit: Fixed those by adding the parent selector to only those .hljs styles. I'm sure there are cleaner approaches to themeing, but this should do for now.

@silverwind
Copy link
Member Author

Rebased and did a few improvments. Good to go from my side.

@codecov-io
Copy link

codecov-io commented Jan 27, 2020

Codecov Report

Merging #10011 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10011      +/-   ##
==========================================
- Coverage   42.27%   42.26%   -0.01%     
==========================================
  Files         611      611              
  Lines       80407    80407              
==========================================
- Hits        33989    33987       -2     
- Misses      42239    42241       +2     
  Partials     4179     4179
Impacted Files Coverage Δ
routers/api/v1/admin/repo.go 0% <0%> (ø) ⬆️
models/repo.go 49.66% <0%> (-0.14%) ⬇️
services/pull/patch.go 67.92% <0%> (ø) ⬆️

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 4f4d2cf...4e6c21c. Read the comment docs.

web_src/less/themes/arc-green.less Outdated Show resolved Hide resolved
@GiteaBot GiteaBot 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 Jan 27, 2020
@zeripath zeripath added topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile topic/ui Change the appearance of the Gitea UI labels Jan 28, 2020
@zeripath zeripath added this to the 1.12.0 milestone Jan 28, 2020
@GiteaBot GiteaBot 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 Jan 28, 2020
- introduced window.config to help with js-based lazy-loading
- adjusted webpack chunk naming to avoid 'vendors~name.js' that webpack
  defaults to for vendor chunks.
- added theme class to html and prefixed all selectors. this is
  neccesary so that the theme styles win over the lazy-loaded ones.
@silverwind
Copy link
Member Author

highlight.js/styles/github.css moved to main CSS bundle, this resolves the loading order issue with the dark theme so it works without modification while increasing the main CSS bundle by around 1kB.

@lafriks lafriks merged commit b9690d7 into go-gitea:master Jan 28, 2020
@silverwind silverwind deleted the hljs-npm branch January 28, 2020 22:10
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 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 topic/ui Change the appearance of the Gitea UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants