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

Help migrate Node Sass tools to be implementation-agnostic #267

Open
nex3 opened this Issue Mar 23, 2018 · 9 comments

Comments

Projects
None yet
4 participants
@nex3
Copy link
Contributor

nex3 commented Mar 23, 2018

There are a number of Node.js tools out there today that use Node Sass, either directly or as a plugin for a broader build system. In order to make it easier for JS users to use Node Sass, we should help those tools migrate to something that supports Dart Sass as well.

Given a tool that depends on Node Sass and imports it directly, this probably means:

  • Removing the Node Sass dependency.

  • Changing the API to take the Sass implementation as a parameter. How this work may depend on the specific library involved, but one simple example would be:

    var sass = require('gulp-sass')(require('sass'));
  • This will probably be a breaking change to the package, so include a major version bump.

These seem to be the most widely-used integration packages:

(If anyone has any more packages, let us know!)

@nex3 nex3 added the infrastructure label Mar 23, 2018

@nex3 nex3 added this to the Usability Equivalence milestone Mar 23, 2018

@nex3 nex3 added the JavaScript label Mar 23, 2018

@TheBosZ

This comment has been minimized.

Copy link

TheBosZ commented Jul 2, 2018

Rollup has a plugin: https://github.com/differui/rollup-plugin-sass

It supports sending a runtime: differui/rollup-plugin-sass#54

I submitted that PR specifically so I could use dart-sass rather than node-sass (node-sass takes about a billion years to compile and isn't any faster on my system).

@nex3

This comment has been minimized.

Copy link
Contributor Author

nex3 commented Jul 3, 2018

@TheBosZ Thanks for the link! Note though that as long as rollup-plugin-sass depends on node-sass, you'll still have to deal with the compile times on install.

@TheBosZ

This comment has been minimized.

Copy link

TheBosZ commented Jul 3, 2018

You're welcome!

I know about the dependency problem. I'm going to try to slowly convince people to move over to dart-sass.

I wish there was a way to define a peer dependency with an "OR".

@xzyfer

This comment has been minimized.

Copy link

xzyfer commented Jul 3, 2018

A note on compiles, you should never have to compile node-sass locally. We literally spend days doing the compilations for every release so you don't have to. Check the release notes for the installed node-sass for the tabled of supported Node versions and operating environments, and update to an appropriate version.

@TheBosZ

This comment has been minimized.

Copy link

TheBosZ commented Jul 3, 2018

@xzyfer It's great that you try to provide multiple versions, but I've often had node-gyp spin up a build step that's annoying.

It also often happens that I'll update node and it'll throw a warning about needing to be recompiled rather than just doing it itself.

Having a "pure javascript" way of doing sass is very desirable from a usability standpoint while node-sass is great for power users.

This also gets around crap like: sass/node-sass#1944

@robsonsobral

This comment has been minimized.

Copy link

robsonsobral commented Jul 3, 2018

@TheBosZ , when that happens, remove the ./node_modules and the lock files and install again.

@TheBosZ

This comment has been minimized.

Copy link

TheBosZ commented Jul 3, 2018

@robsonsobral That's not any easier than doing the npm rebuild node-sass --force dance. Especially when node_modules takes around 2 minutes to fully delete on Windows 7.

@xzyfer

This comment has been minimized.

Copy link

xzyfer commented Jul 3, 2018

@TheBosZ

This comment has been minimized.

Copy link

TheBosZ commented Jul 5, 2018

As an update, rollup-plugin-sass has switched! https://github.com/differui/rollup-plugin-sass/blob/master/CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.