reposilite icon indicating copy to clipboard operation
reposilite copied to clipboard

GH-1003 Reimplement code snippets in UI

Open WithoutAName25 opened this issue 1 year ago • 3 comments

Fix #1003

WithoutAName25 avatar Sep 21 '22 08:09 WithoutAName25

Hmm I see one thing that is kinda problematic. Bundle size is x2 bigger than it was before:

? 987 modules transformed.
rendering chunks...
build/frontend/reposilite-frontend/index.html                  1.70 KiB
build/frontend/reposilite-frontend/assets/index.395dd189.css   51.59 KiB / gzip: 9.33 KiB
build/frontend/reposilite-frontend/assets/index.512c4994.js    629.31 KiB / gzip: 216.66 KiB

After:

> Task :reposilite-frontend:buildFrontend
? 1186 modules transformed.
rendering chunks...
build/frontend/reposilite-frontend/index.html                  1.70 KiB
build/frontend/reposilite-frontend/assets/index.310f997f.css   54.10 KiB / gzip: 9.68 KiB
build/frontend/reposilite-frontend/assets/index.df79b065.js    1632.45 KiB / gzip: 505.17 KiB

Resource-wise we should probably just get rid of any highlight library 🤔

dzikoysk avatar Sep 21 '22 16:09 dzikoysk

Maybe it would be a better option to don't use an editor library at all. It should be relatively easy to implement the code snippets manually. The highlighting could be "hardcoded" because the highlighted text doesn't change.

WithoutAName25 avatar Sep 22 '22 08:09 WithoutAName25

Yeah, we've used highlighting library, because in the earlier version of 3.x we had configuration editor in Settings tab, but since we've replaced it with forms, it's no longer needed.

dzikoysk avatar Sep 22 '22 12:09 dzikoysk

Main visual changes:

  • no line numbers
  • vertical scrolling instead of line wrapping

WithoutAName25 avatar Oct 03 '22 17:10 WithoutAName25

Looks fine, thanks!

dzikoysk avatar Oct 07 '22 12:10 dzikoysk