Deprecation Warning: The legacy JS API is deprecated and will be removed in Dart Sass 2.0.0
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
https://sass-lang.com/documentation/breaking-changes/legacy-js-api/
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)
At least provide a passthrough option to silence it out, Please.
At least provide a passthrough option to silence it out, Please.
PLEASE.
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.
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!
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.
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 are you going to create a PR soon?
@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.
(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? 👀
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. 🙇♂️)
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
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.
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.
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 , 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 OK, thank you!
Now, let's anticipate whoever will step forward to review the PR. 👍
@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.
@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.
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
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?
@skovy , can you create a new release, please?
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. 😢
Any news here?
I personally feel that forking the project might be the way to go.
Any volunteer? @crgwbr , you wrote that you are interested take over the maintenance of this project?
@krzysztof-cislo Yeah, I think I'm going to fork it. Will post here again once there's progress on that front.
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.
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.