-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
fix #5826; swap node-sass for dart-sass #5841
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the work. 5-10% slowness is probably fine to mean that we aren't depending on a native module anymore.
I'll take some time next week to take this for a spin.
@@ -108,6 +108,7 @@ | |||
"conventional-changelog-cli": "^2.0.11", | |||
"conventional-changelog-videojs": "^3.0.0", | |||
"cross-env": "^5.2.0", | |||
"dart-sass": "^1.17.2", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between dart-sass
and sass
? Seems like documentation mostly talks about sass
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be the exact same code, but double-listed in npm under different project names. Note the version, 'last publish', GitHub stats, etc:
https://www.npmjs.com/package/sass
https://www.npmjs.com/package/dart-sass
I chose dart-sass
to be more clear about the origin. Both seemed to work the same when I was doing some wiring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the docs for dart-sass specify the sass
package, I think we should go with that.
Any luck in your findings @gkatsev ? |
I haven't had much time to look at it further. Also, given that all the documentation says to use the |
I did some testing with this today: Over 20 runs of From a quick visual test on safari/chrome/firefox everything looks the same, but we probably want to test a lot of specifics since the diff has a lot of non-whitespace changes. Here is a diff between the two that I did (where node-sass generated css, is being changed to dart-sass css) |
Thanks @brandonocasey! Looking a bit more carefully, some of the non-whitespace changes are just a change in the ordering of the selectors, for example: .vjs-icon-play, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder {} was changed to: .vjs-icon-play, .video-js .vjs-play-control .vjs-icon-placeholder, .video-js .vjs-big-play-button .vjs-icon-placeholder:before {} The difference is that before, @brandonocasey would you be able to run something like this replace on the output: |
yeah let me see what I can do, I will re-post the diff after fixing some whitespace issues. |
A bit better: #5903 |
Yeah, looks like it's mostly switching around the selectors or putting them on one line. We'll want to double check that it's true for all the changes, though. But seems like this can be made in a minor update for sure. |
OK, I checked all the changes, and found three differences that I made comments on in that pull request. Seems like rounding is a bit different. |
Hiding whitespace changes makes that other PR a lot more manageable. |
Also, we probably would want to turn off sourcemaps. |
So, what's I think there are a couple of things left here:
|
@tomByrer would you be able to finish the tasks outlines in my last comment? |
I've created a new PR ( #6055 ) which dones the above tasks. |
Description
Per #5826, node-sass is difficult to install sometimes. Dart-sass is the new 'standard'.
Specific Changes proposed
To get dart-sass to work, I had to fix the path to node_modules for
@import
(which is backward compatible with node-sass) & remove the --watch folder.Testing
Works in Win10 & OSX Sierra, both using VSCode-git-bash & npm. Direct
npm run build:css
&npm start
works, as does tests in Firefox & Safari. Compiling seems to be ~5-10% slower than node-sass, but we're only talking milliseconds.I haven't tested editing an scss file & see if the
--watch
works (I assume runs only for the main entry &@import
ed files).Thoughts
I have some reservations. Dart-sass is clearly a 1-woman show. Perhaps the spec changes (as few a there are now) is handled by a team, she writes 99% of the code. Amazing work, but I question long-term maintenance. Documentation has not been updated, with references to ruby-sass which is about to mothballed in weeks.
While LibSass may never be 100% reference, it became the de-facto standard. Node-sass has some minor behavior differences.
So, up to you guys if you want to make the switch; there are pros & cons.
Requirements Checklist