Closed solkaz closed 7 years ago
I think this might remove too many languages. I think we should also support more of the common languages, specifically:
swift
javascript
cpp
objectivec
haskell
bash
xml
ruby
Open to adding new languages, but we don't have users that are requesting those languages. Plus, it's easy to add a language; this was done to cut out the bloat.
Did you really try this on all the browsers ?
@Hopding is right. People may want to write annotations with inlined code from a language we don't support, perhaps as a point of comparison. If bundle size is really a problem, we should find another way to reduce it.
@thebho just on Chrome and Safari
Then why did you check them all?
If we want to add more languages, then sure, we can do that later, and it's an easy process that's evident in the code. Right now, however, we don't have any users for Codesplain. We ourselves don't, and probably won't, use the annotation feature for other languages. That's why I don't feel a need to include more languages; if you really, really want a language, you're welcome to make a PR.
@thebho because I imagined that this should work across all browsers. It's not a UI change. I have unchecked the ones that I haven't tested, though.
Just add the browsers you have actually tested the changes on. I'm not expecting every PR to have full coverage, but when there are layout or state changes, we should have a record of the browsers that have been tested
Would like to see support for most of the top 30 http://spectrum.ieee.org/computing/software/top-10-programming-languages/
@dane-johnson
if you really, really want a language, you're welcome to make a PR.
Description
This PR refactors our imports from
highlight.js
, eschewing the default instance (which is around 520 kb when imported) and instead using a hand-rolled solution that supports only the Java and Python languages and is 12 kb.Motivation and Context
To decrease our bundle sizes, the benefits of which should be obvious.
Checklist:
Browsers
Screenshots (if appropriate):
Before:
Highlight.js
bundled size: (520kb)Total bundle size: (~1.5mb)
After:
Highlight.js
bundled size: (~12kb)Total bundle size: (~1mb)