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

Updated Chroma to v0.10.0 #18270

Merged
merged 6 commits into from
Jan 20, 2022
Merged

Updated Chroma to v0.10.0 #18270

merged 6 commits into from
Jan 20, 2022

Conversation

MrGussio
Copy link
Contributor

@MrGussio MrGussio commented Jan 14, 2022

Updated Chroma to v0.10.0, and ran the commands go mod vendor and make build.

Fix #18269

@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Jan 14, 2022
@techknowlogick
Copy link
Member

CI fail seems related.

@zeripath
Copy link
Contributor

it appears that chroma has now changed its rendering significantly adding <span class=\"line\"><span class=\"cl\"> before/around lines.

@MrGussio
Copy link
Contributor Author

it appears that chroma has now changed its rendering significantly adding <span class=\"line\"><span class=\"cl\"> before/around lines.

Yes, I noticed. Just did a commit which should fix these issues. Locally I did not have any test errors anymore, now the wait is for the CI to check them as well.

@zeripath
Copy link
Contributor

I think we need to double check what if any effect this has on rendering.

I think the <span class="line"> will be being sanitized to <span> and there's no CSS for the ".cl" in dark or light.less.

Do you know what these spans are supposed to be doing?

@techknowlogick
Copy link
Member

apologies for these conflicts.

@singuliere
Copy link
Contributor

@MrGussio screenshots showing the rendering before and after the upgrade would go a long way to show it looks good. Thanks a lot for this upgrade!

@silverwind
Copy link
Member

Need to rebase and remove the vendor files as we no longer vendor them since 84145e4.

@zeripath
Copy link
Contributor

rebased and updated

@silverwind
Copy link
Member

alecthomas/chroma@d6e61d3 appears to be related to the HTML changes.

I agree we need to be careful here that this does not break any assumptions about Chroma's HTML in our CSS. Possibly also need to update themes in case new classes are introduced.

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

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

And we could wait for a new release of Chroma now.

@MrGussio
Copy link
Contributor Author

@MrGussio screenshots showing the rendering before and after the upgrade would go a long way to show it looks good. Thanks a lot for this upgrade!

Build using the latest version of my fork:
image
image

Build of commit d7c2a29 (before the Chroma update):
image
image

It seems to have no real visual impact. Changes seem to be coming from alecthomas/chroma@d6e61d3 and alecthomas/chroma@5ed5054 as already mentioned above.

Copy link
Contributor

@zeripath zeripath left a comment

Choose a reason for hiding this comment

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

It doesn't look like chroma is releasing an update soon so I think we should just approve - merge and see how things look IRL.

@silverwind
Copy link
Member

I didn't notice any immediate regression from this but I guess the extra wrapping element is unneccary in our rendering too, but I guess it can be improved upon later.

@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 19, 2022
@zeripath zeripath added this to the 1.17.0 milestone Jan 19, 2022
@wxiaoguang
Copy link
Contributor

A little off-topic, just to remind developers: Chroma uses a lot of abbr class names like nx, nt, cl, p.

We also wrote a lot of abbr class names like df, pr, ac, tc, sb, vm, etc. If we continue to use ambiguous abbr names globally, they would conflict and lead to strange bugs in one day.

We should stick to non-ambiguous names in future.

@silverwind
Copy link
Member

Happy to accept a PR that refactors our helper classes to something longer.

@codecov-commenter
Copy link

Codecov Report

Merging #18270 (665f2be) into main (7427b81) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main   #18270      +/-   ##
==========================================
- Coverage   45.94%   45.93%   -0.02%     
==========================================
  Files         832      832              
  Lines       92092    92092              
==========================================
- Hits        42316    42306      -10     
- Misses      43022    43032      +10     
  Partials     6754     6754              
Impacted Files Coverage Δ
modules/highlight/highlight.go 57.79% <0.00%> (-3.67%) ⬇️
modules/queue/queue_bytefifo.go 59.28% <0.00%> (-3.60%) ⬇️
modules/queue/workerpool.go 50.00% <0.00%> (-3.06%) ⬇️
modules/log/event.go 62.50% <0.00%> (+1.85%) ⬆️
modules/charset/charset.go 75.75% <0.00%> (+4.04%) ⬆️

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 7427b81...665f2be. Read the comment docs.

@wxiaoguang wxiaoguang merged commit bbd3078 into go-gitea:main Jan 20, 2022
zjjhot pushed a commit to zjjhot/gitea that referenced this pull request Jan 21, 2022
* giteaoffical/main:
  [skip ci] Updated translations via Crowdin
  Refactor jwt.StandardClaims to RegisteredClaims (go-gitea#18344)
  format with gofumpt (go-gitea#18184)
  Enable deprecation error for v1.17.0 (go-gitea#18341)
  Use correct translation key for errors (go-gitea#18342)
  Refactor Router Logger (go-gitea#17308)
  Updated Chroma to v0.10.0 (go-gitea#18270)
zeripath pushed a commit to techknowlogick/gitea that referenced this pull request Mar 19, 2022
Backport go-gitea#18270

Fix tests for Chroma v0.10.0
6543 added a commit that referenced this pull request Mar 19, 2022
Backport #19120 
Backport #19099 
Backport #18874 
Backport #18420
Backport #19128
Backport #18270 

Bump to build with go1.18

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Jelle Hulter <jellehulter@gmail.com>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update chroma to v0.10.0
8 participants