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

Upgrade node-sass to 4.9.0 #268

Merged
merged 1 commit into from
May 28, 2018
Merged

Conversation

Nateowami
Copy link
Contributor

@Nateowami Nateowami commented May 25, 2018

Currently we are using [email protected] on our fork of node-sass.

Node-sass is a wrapper around libsass, which is written in C. The bindings between Node and libsass have to be recompiled for every API change in Node (which is generally quite frequent). The node-sass installer attempts to download a binary for the current platform, Node version, and node-sass version (i.e. it has to find a binary that matches all three). Lately in xForge it has had to fall back to building the bindings from source. I noticed this because on Uma's machine the build fails. The error message isn't very clear about why, but ideally building from source should not be necessary; it should just download the binaries.

The reason it can't download the binaries is because we are using an older, forked version of node-sass (the latest version is 4.9.0; we're using 4.5.0 on our fork. The node-sass project supplies binaries for 4.5.0 that work with older versions of Node, but they don't support old versions of node-sass on newer versions of Node.

The original reason we forked node-sass was due to infinite recursion when watching CSS files. The issue still exists but is being addressed in the upcoming release of node-sass 5.0, which upgrades to either libsass 3.5 or 3.6. See sass/node-sass#2111 and sass/node-sass#2312. I can explain more of the reason for the fork if anyone is interested, but for this particular issue it's mostly not relevant.

What I've done is update our fork with version 4.9.0, reapplied the fixes I had made for 4.5.0, and updated xForge's package.json to point to the new branch on our fork.

Everything appears to be working properly. npm install now no longer requires compiling libsass from source, produces 11 times less output lines, and runs nearly three times faster (c. 38s rather than 115s).

E2e tests are more or less passing, with a couple failures that look familiar because they've been failing lately. None appear related to updating node-sass.


This change is Reviewable

@irahopkinson
Copy link
Contributor

irahopkinson commented May 28, 2018

:lgtm: All SF and LF E2E passing for me.


Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@irahopkinson irahopkinson merged commit 95bc118 into master May 28, 2018
@irahopkinson irahopkinson deleted the feature/upgrade-node-sass-fork branch May 28, 2018 05:46
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.

2 participants