-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Switch Sass compilation from node-sass to dart-sass #6033
Conversation
Jest 24 is out but upgrading to it would require us to also update our Webpack tooling to Babel 7, which is quite significant work.
Manage this branch in SquashTest this branch here: https://thibaudcolaschoredart-sass-hsfu4.squash.io |
23cdcb6
to
de7a042
Compare
de7a042
to
5548178
Compare
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.
@thibaudcolas - great stuff! This is so much easier to work with when developing, should be a great help to all those working with styles. Tested a bunch of stuff, reviewed code and cannot see any issues. Will aim to merge in shortly.
- npm ci (in vm)
- npm run lint
- npm run build (in vm & outside vm) + delete static before
- visual validation across app
- check icons render in form, time & url field
* native modules no longer used for sass due to adoption of `dart-sass` * wagtail/wagtail#6033 * wagtail/wagtail@7eeb44a
* native modules no longer used for sass so no rebuild required (adoption of `dart-sass`) * wagtail/wagtail#6033 * wagtail/wagtail@7eeb44a
Merged in via 7eeb44a PRs created as noted to remove node-sass specific build workarounds in docker/vagrant |
* native modules no longer used for sass due to adoption of `dart-sass`, node-sass no longer needing to be mentioned * wagtail/wagtail#6033 * wagtail/wagtail@7eeb44a
* native modules no longer used for sass so no rebuild required (adoption of `dart-sass`) * wagtail/wagtail#6033 * wagtail/wagtail@7eeb44a
Includes the changes from #5401. I had trouble with dependencies shared between node-sass and Jest 22 (jsdom 11.5) – this resolves those problems quite conveniently.
This replaces gulp-sass with a fork using the new Dart implementation of Sass, https://github.com/sass/sass. This implementation is now the canonical implementation for Sass, so is more up to date (e.g.
@use
) – and also much easier to keep up to date on projects, since it’s compiled to JavaScript for the npm package, not needing native modules likenode-sass
does.This should make it much easier for contributors to switch between working on a Vagrant box, Docker, their own computer – node-sass is our only dependency requiring native modules (there’s
fsevents
too but it’s optional). It also makes it easier to upgrade Node versions, since we don’t have to worry about node-sass having prebuilt binaries for the versions we upgrade to.This also makes the Draftail.css compilation warning go away.
As part of the upgrade I had to rewrite two bits of code that were using now-deprecated Sass features. The output CSS for those two features. The output CSS is overall nearly identical – there are a few things that are ordered differently in a way that’s not significant, and a different level of precision for math, not in a way that’s significant.
I tested this with my UI regression test suite from https://github.com/thibaudcolas/wagtail-tooling.
make lint
from the Wagtail root)[x] For Python changes: Have you added tests to cover the new/fixed behaviour?Once this is merged we can remove: https://github.com/wagtail/docker-wagtail-develop/blob/eef59861b590ffabb54fd7c29271a4a39d9de071/Dockerfile.frontend#L9-L10
and might also be able to change: https://github.com/wagtail/vagrant-wagtail-develop/blob/master/Vagrantfile#L35.