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

Swap node-sass for sassc, mention in docs #690

Merged
merged 1 commit into from Feb 3, 2021

Conversation

ix5
Copy link
Collaborator

@ix5 ix5 commented Jan 19, 2021

People should not be forced to install nodejs & npm just to contribute to docs.
sassc produces virtually identical output to node-sass; with precision set to "5", the output is identical.

node-sass wastes a lot of space and pulls in a total of 195 (mostly untrusted!) packages.

$ du -hs --apparent-size ~/.npm/node-sass/ ~/.cache/node_modules/
3,3M	/home/user/.npm/node-sass/
15M	/home/user/.cache/node_modules/

sassc is a couple of kilobytes, including ~3MB for libsass.

sassc is also faster by a lot, which makes live-reloading much less annoying:

hyperfine 'sassc --precision 5 docs/_static/css/site.scss docs/_static/css/site.css'
Benchmark #1: sassc --precision 5 docs/_static/css/site.scss docs/_static/css/site.css
  Time (mean ± σ):      15.8 ms ±   2.4 ms    [User: 12.7 ms, System: 3.2 ms]
  Range (min … max):    14.8 ms …  35.6 ms    72 runs
hyperfine 'node-sass docs/_static/css/site.scss docs/_static/css/site.css'
Benchmark #1: node-sass docs/_static/css/site.scss docs/_static/css/site.css
  Time (mean ± σ):     200.4 ms ±   4.3 ms    [User: 181.6 ms, System: 49.6 ms]
  Range (min … max):   195.0 ms … 213.1 ms    13 runs

sassc is available for:
Arch Linux
Ubuntu
Debian
Fedora
OpenSuse

Another benefit is that CI runs are very quick, since they no longer have to fetch all the nodejs-related packages and build node-gyp.

People should not be forced to install nodejs & npm just to
contribute to docs.
sassc produces virtually identical output to node-sass; with
`precision` set to "5", the output is identical.

node-sass wastes a lot of space and pulls in a total of 195
(mostly untrusted!) packages.
```
$ du -hs --apparent-size ~/.npm/node-sass/ ~/.cache/node_modules/
3,3M	/home/user/.npm/node-sass/
15M	/home/user/.cache/node_modules/
```
sassc is a couple of kilobytes, including ~3MB for libsass.

sassc is also faster by a lot, which makes live-reloading
much less annoying:

hyperfine 'sassc --precision 5 docs/_static/css/site.scss docs/_static/css/site.css'
Benchmark #1: sassc --precision 5 docs/_static/css/site.scss docs/_static/css/site.css
  Time (mean ± σ):      15.8 ms ±   2.4 ms    [User: 12.7 ms, System: 3.2 ms]
  Range (min … max):    14.8 ms …  35.6 ms    72 runs

hyperfine 'node-sass docs/_static/css/site.scss docs/_static/css/site.css'
Benchmark #1: node-sass docs/_static/css/site.scss docs/_static/css/site.css
  Time (mean ± σ):     200.4 ms ±   4.3 ms    [User: 181.6 ms, System: 49.6 ms]
  Range (min … max):   195.0 ms … 213.1 ms    13 runs

sassc is available for:
Arch Linux https://archlinux.org/packages/community/x86_64/sassc/
Ubuntu https://packages.ubuntu.com/bionic/pysassc
Debian https://packages.debian.org/stable/sassc
Fedora https://src.fedoraproject.org/rpms/sassc
OpenSuse https://software.opensuse.org/package/sassc

Another benefit is that CI runs are very quick, since they
no longer have to fetch all the nodejs-related packages and
build node-gyp.
@jelmer jelmer merged commit 9c2307c into posativ:master Feb 3, 2021
@ix5 ix5 deleted the sassc-and-docs branch February 3, 2021 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants