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

libsass is now deprecated... move to dartsass #47

Open
bpossolo opened this issue Nov 1, 2020 · 18 comments
Open

libsass is now deprecated... move to dartsass #47

bpossolo opened this issue Nov 1, 2020 · 18 comments

Comments

@bpossolo
Copy link

bpossolo commented Nov 1, 2020

As of Oct 26, 2020, libsass is now deprecated :(

The official recommendation is to move to dart sass instead.

I'm not sure what this means for the sbt-sassify plugin but it seems like having the Dart Sass binary installed locally may become a pre-requisite in the future.

@irundaia
Copy link
Owner

I’m pretty sure that the dart sass library can be compiled to a native library as well. I will have a look at it.

@danellis
Copy link

danellis commented May 5, 2021

Any progress on this? It would be great to be able to use @use, which only Dart Sass supports.

@irundaia
Copy link
Owner

irundaia commented May 8, 2021

I'll try to see what the impact would be of migrating from libsass to a version of dart-sass compiled to libsass. Unfortunately, that would require having node on the target system. I haven't yet found a way to compile dart code to a shared library.

@irundaia
Copy link
Owner

@bpossolo @danellis,

I've been making good progress with running a natively compiled version of dart-sass. Would you be able to help me test whether this solution works for you as well? (I'm trying to test it on as many platforms as I can.)

@bpossolo
Copy link
Author

@irundaia sure I can help you test it out on my M1 Mac!
I ended up moving to the dart-sass js implementation in the meantime since I was blocked but I'm sure others will benefit from the sbt-sassify update.

@danellis
Copy link

@irundaia Yeah, I can help test (Intel macOS). I'm currently using dart-sass from IntelliJ's file watchers, so I'd be glad to get away from that.

@rwsargent
Copy link

+1, I can test on Ubuntu / Fedora environments. Would love to use sassify and dartsass.

@Lasering
Copy link

@irundaia Dart Sass releases its binaries on github https://github.com/sass/dart-sass/releases/tag/1.49.0. Changing the bundled binaries inside the published jar should solve the problem.

@Lasering
Copy link

Nevermind, I thought you were invoking the cli. Now looking deeper I see your are using JNA to invoke the native methods from libsass, so moving to dart-sass will probably be harder since the native methods will be diferent.

@irundaia
Copy link
Owner

@rwsargent, @Lasering, @danellis, @bpossolo, I've refactored sbt-sassify to include a version of dart-sass. Could you verify if this works with your setup.

To test the integration with dart-sass, take the following steps:

  1. Clone this repo
  2. Checkout the migrate_to_dart branch
  3. run sbt publishLocal in the newly cloned sbt-sassify repository
  4. In your own repository set the sbt-sassify version to "2.0.0-SNAPSHOT"
  5. Run your project as usual

Could you let me know whether this works for your setup?

@Lasering
Copy link

I might be doing something wrong. But for me it seems to not be working. The generated .css contains @use which should have been removed by dart-sass.

@irundaia
Copy link
Owner

Do you have a minimal example?
Also, I might have forgotten to instruct you to use the dart compiler. >.<

Can you set the SassKeys.useDartSass := true?

@Lasering
Copy link

That was the missing part. Now it works.

@rwsargent
Copy link

I'm looking into this, running into an Akka mixed dependency error which I can't seem to resolve.

@irundaia
Copy link
Owner

@rwsargent could you provide a minimal example of your setup that exhibits this behaviour?

@thadamski
Copy link

thadamski commented Jul 28, 2022

@irundaia we've been able to successfully using your outlined steps here, which happens to also fix a docker aarch64 libsass.so issue we were facing with the 1.x build of sbt-sassify.

Are you able to publish version 2.0.0? Even the snapshot build would be great as we're having difficulty including the local snapshot version as a plugin dependency via project/lib directory.

Edit: My colleguea informed me he had to make the following change to get the build working on macOS aarch64

- addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.3")
+ addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.5")

@Lasering
Copy link

Lasering commented Jul 28, 2022

@irundaia When I set cssStyle to Minified the generated css has errors, I'm not sure if they are coming from sbt-sass or from sass it self.

@leedsalex
Copy link

@irundaia Any update on this, can the dart-sass branch be merged in and released?

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

No branches or pull requests

7 participants