typed-scss-modules icon indicating copy to clipboard operation
typed-scss-modules copied to clipboard

Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0

Open doberkofler opened this issue 1 year ago • 36 comments

Your issue may already be reported! Please search on the issue tracker before creating one.

Expected Behavior

After upgrading to sass 1.79.1, i see the following warning: Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0.

Your Environment

  • Version used: 8.0.1
  • Operating System and versions: macOS 15.0

doberkofler avatar Sep 18 '24 07:09 doberkofler

https://sass-lang.com/documentation/breaking-changes/legacy-js-api/

doberkofler avatar Sep 20 '24 12:09 doberkofler

It seems like the deprecation notice is coming from the consumption of LegacySyncImporter and LegacySyncImporterThis in two instances in the source code: in importer.ts and in importer.test.ts.

Perhaps a migration isn't as painful as it seems? (famous last words)

terrymun avatar Sep 22 '24 11:09 terrymun

At least provide a passthrough option to silence it out, Please.

am0wa avatar Oct 31 '24 10:10 am0wa

At least provide a passthrough option to silence it out, Please.

PLEASE.

cryptofelon avatar Dec 09 '24 23:12 cryptofelon

I created a patch that uses the new apis instead: https://gist.github.com/vilindberg/f620f5453c74aa856762dcc8ce0a6435

This worked well and solved the issue for us. Hopefully it works for some of you as well.

vilindberg avatar Dec 12 '24 10:12 vilindberg

this is an open source project, changes can be opened as pull requests! i don't use this project, nor get paid to maintain it so there will be lag to reviewing and merging. if in a pinch forking and patching are also options!

skovy avatar Dec 21 '24 15:12 skovy

this is an open source project, changes can be opened as pull requests! i don't use this project, nor get paid to maintain it so there will be lag to reviewing and merging. if in a pinch forking and patching are also options!

@skovy If you're interested moving this project to a new maintainer, my team at the @thelabnyc might be interested. We do use this tool on quite a few projects, so we'd have a basis to justify the investment. Feel free to email me to discuss more: cweber at thelab dot co.

crgwbr avatar Dec 23 '24 15:12 crgwbr

Although I'm not sure how difficult to do it so much for now, as a trial, could I start making a PR applying the patch suggested by @vilindberg not into dist directory but into lib directory?

msmx-mnakagawa avatar Jan 29 '25 10:01 msmx-mnakagawa

@msmx-mnakagawa are you going to create a PR soon?

krzysztof-cislo avatar Apr 10 '25 10:04 krzysztof-cislo

@krzysztof-cislo

are you going to create a PR soon?

Thank you for seeking confirmation. I hadn't noticed some 👍 reactions which might indicate agreement with my post. 🥲

Therefore, I'll start trying to work on creating a PR from now. By the end of the day on 4/14 (Mon) JST, at the latest, I'll comment with either a notification of the PR creation or an update if I find it difficult to do so.

msmx-mnakagawa avatar Apr 11 '25 09:04 msmx-mnakagawa

(cc: @krzysztof-cislo @shamsartem)

I've tried creating a PR #239 to address this issue. 🙌

While it is still draft as it may require additional consideration, it should at least be able to provide verification of whether the PR operates in each specific environment.

If possible, could someone take a look at the PR? 👀

msmx-mnakagawa avatar Apr 14 '25 06:04 msmx-mnakagawa

Hi, @skovy. Kindly pinging you to inform that I've made PRs related to Node Sass.

If it's convenient, would you mind helping to review #240 to #239? (If not, my apologies for the disturbance. 🙇‍♂️)

msmx-mnakagawa avatar Apr 16 '25 07:04 msmx-mnakagawa

While it is still draft as it may require additional consideration, it should at least be able to provide verification of whether the PR operates in each specific environment.

I can test both PR versions locally, @msmx-mnakagawa . Can you provide me built npm packages? It could be easier than checkout your forks and build manually.

krzysztof-cislo avatar Apr 16 '25 12:04 krzysztof-cislo

@krzysztof-cislo

Can you provide me built npm packages?

Sure! 🙆‍♂

I've created releases for both PRs from my repository.

We can install them as packages by the following commands. If anything is unclear or problematic during the installation, please let me know.

v0.1.0-drop-node-sass-support (#240)

npm install -D https://github.com/msmx-mnakagawa/typed-scss-modules/releases/download/v0.1.0-drop-node-sass-support/typed-scss-modules-0.1.0-drop-node-sass-support.tgz

v0.2.1-migrate-dart-sass-to-resolve-deprecation-warning (#239)

npm install -D https://github.com/msmx-mnakagawa/typed-scss-modules/releases/download/v0.2.1-migrate-dart-sass-to-resolve-deprecation-warning/typed-scss-modules-0.2.1-migrate-dart-sass-to-resolve-deprecation-warning.tgz
Old Version for #239

v0.2.0-migrate-dart-sass-to-resolve-deprecation-warning (#239)

We can confirm the package of this PR as well. However, note that we seemingly need to install node-sass additionally for this package.

npm install -D https://github.com/msmx-mnakagawa/typed-scss-modules/releases/download/v0.2.0-migrate-dart-sass-to-resolve-deprecation-warning/typed-scss-modules-0.2.0-migrate-dart-sass-to-resolve-deprecation-warning.tgz
npm install -D node-sass // temporarily needed, which is going to be fixed

IMO, this may be due to the change for some existing logic around getImplementation(), which I'm going to resolve after #240 is merged.

msmx-mnakagawa avatar Apr 17 '25 02:04 msmx-mnakagawa

Thanks @msmx-mnakagawa !

I have checked both PR versions.

The version v0.1.0-drop-node-sass-support is working fine. I mean that I have regenerated all types and nothing has changed comparing to types generated from the latest official version. I still can see deprecation warning about legacy-js-api in the console.

The versions v0.2.0-migrate-dart-sass-to-resolve-deprecation-warning is also working fine as above (results are identical). Also, I can't see any warning in the console. Just a small note, to install node-sass we have to use Node 18.x or lower as it doesn't support 20.x or 22.x.

My environment is Windows 11 with WSL 2.

krzysztof-cislo avatar Apr 17 '25 06:04 krzysztof-cislo

Thank you for your quick confirmation, @krzysztof-cislo!

Regarding the additional installation of Node Sass, I've created a fixed version. Could you try the following command at your convenience, if possible?

npm install -D https://github.com/msmx-mnakagawa/typed-scss-modules/releases/download/v0.2.1-migrate-dart-sass-to-resolve-deprecation-warning/typed-scss-modules-0.2.1-migrate-dart-sass-to-resolve-deprecation-warning.tgz

With this version, you won't need to install node-sass additionally, unless you specify node-sass as your implementation.

msmx-mnakagawa avatar Apr 20 '25 23:04 msmx-mnakagawa

@msmx-mnakagawa , I have checked typed-scss-modules-0.2.1-migrate-dart-sass-to-resolve-deprecation-warning version. I confirm that I didn't have to install node-sass (for sass implementation). Also, types were still generated correctly.

krzysztof-cislo avatar Apr 22 '25 12:04 krzysztof-cislo

@krzysztof-cislo OK, thank you!

Now, let's anticipate whoever will step forward to review the PR. 👍

msmx-mnakagawa avatar Apr 23 '25 02:04 msmx-mnakagawa

@skovy If you are currently unable to review or maintain this repository, would you be okay with me publishing a fixed version that addresses some Node Sass? I'd do this as a separate npm package from my forked repository, if I can.

I've read your previous post https://github.com/skovy/typed-scss-modules/issues/232#issuecomment-2558155392, but I'd like to confirm just to be sure.

msmx-mnakagawa avatar Apr 24 '25 09:04 msmx-mnakagawa

@skovy If you are currently unable to review or maintain this repository, would you be okay with me publishing a fixed version that addresses some Node Sass? I'd do this as a separate npm package from my forked repository, if I can.

I've read your previous post #232 (comment), but I'd like to confirm just to be sure.

@skovy , can you tell us if there is any chance for you to review @msmx-mnakagawa changes? A lot of effort has been put into these changes so it would be nice to merge them.

krzysztof-cislo avatar Apr 28 '25 07:04 krzysztof-cislo

PR's from @msmx-mnakagawa can be published under @next tag and so this PR's can be tested in the wild. In case of issues someone come here to fill new bug

inoyakaigor avatar Apr 30 '25 14:04 inoyakaigor

PR's from @msmx-mnakagawa can be published under @next tag and so this PR's can be tested in the wild. In case of issues someone come here to fill new bug

Good idea @inoyakaigor !

@skovy can you do it, please?

krzysztof-cislo avatar May 05 '25 08:05 krzysztof-cislo

@skovy , can you create a new release, please?

krzysztof-cislo avatar May 09 '25 08:05 krzysztof-cislo

this is an open source project, changes can be opened as pull requests! i don't use this project, nor get paid to maintain it so there will be lag to reviewing and merging. if in a pinch forking and patching are also options!

@skovy , nobody expects you to review, merge or create release within hours or event days, @msmx-mnakagawa created a PR a month ago and put lot of effort to analyze, modify and test everything.

If you don't have time for this project simply pass it to someone who could at least react in reasonable time. @crgwbr volunteered to be a maintainer. If you don't want to let anyone continue your project, just update the readme file that this project is no longer maintained. I am sure that someone (maybe even @crgwbr ) will simply fork it under different name and continue it.

Right now we are in a situation where developers want to contribute to the project but it's for nothing. 😢

krzysztof-cislo avatar May 14 '25 13:05 krzysztof-cislo

Any news here?

Daniel3711997 avatar May 27 '25 08:05 Daniel3711997

I personally feel that forking the project might be the way to go.

doberkofler avatar May 27 '25 08:05 doberkofler

Any volunteer? @crgwbr , you wrote that you are interested take over the maintenance of this project?

krzysztof-cislo avatar May 27 '25 09:05 krzysztof-cislo

@krzysztof-cislo Yeah, I think I'm going to fork it. Will post here again once there's progress on that front.

crgwbr avatar May 27 '25 20:05 crgwbr

Ok, initial version of the fork is up here: https://www.npmjs.com/package/@thelabnyc/typed-scss-modules/v/8.2.0-a2.

Main repo is here: https://gitlab.com/thelabnyc/typed-scss-modules, but is also mirrored to https://github.com/thelabnyc/typed-scss-modules.

crgwbr avatar May 28 '25 21:05 crgwbr

Thank you for the quick action, @crgwbr! ✨

As far as I can tell from the merge commit in the fork, it already includes #240. So, building on that, I'll go ahead and try creating a new PR for the fork that addresses #239 and resolves this issue.

Please bear with me.

msmx-mnakagawa avatar May 28 '25 23:05 msmx-mnakagawa