-
Notifications
You must be signed in to change notification settings - Fork 358
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
Add a --quiet-upstream flag #672
Comments
Since 1.33.0 I stared to see a lot of deprecated division operation related warnings. Is there a workaround to disable the warnings? The module used via sass-loader. |
a zillion messages because not only the deprecation warning, but also the complete stack |
Prioritizing this because of all the warnings generated by the /-as-division deprecation. |
Renaming this to |
To be clear, though: this option is only available via the Sass CLI and the Dart API. It would be much harder to add to the Node API, because Node's importer model makes it much harder to track what counts as the "main package" and what counts as a "dependency". We'll be able to support in the new JS API (sass/sass#3056) and in the embedded host, but those will take some time. In the meantime, Node users will still see fewer deprecation warnings in the next release due to #1322, which skips warnings that have already been emitted for a given source location. That should help mitigate a substantial amount of the noise. |
No bad, i wish more packages has deprecation warnings like this
thanks |
@nex3, is there a flag for Node/JS API for disabling the deprecation warnings regardless the source type (dependency / main)? It's ok that the saas module is unable to distinguish the source type, developers treat different things as dependencies (it depends on the team, project type, etc), so it's on us/developers, but we need a flag to disable deprecation warnings (not silencing the output completely). |
@nex3, just an idea, but maybe adding an option (array of patterns for example ?) to specify what can be considered as a dependency ? The main issue with the current situation is that we are lost between the deprecation warnings coming from an external library, where we can't do anything but asking the owners to fix their code, and our own deprecation warnings that we can't see with or without #1322 (as there are so many lines anyway). |
@vladimiry There isn't currently. sass/sass#2979 is tracking the ability to add a custom logger, which would be able to specifically ignore deprecation warnings. @fbasso I don't want to add a solution that would just serve as a workaround for a proper importer API; I'd rather just add the proper importer API in the first place. If you want to fix your local package's deprecation warnings, we recommend using the Sass migrator. |
I'm using the CLI and cannot for the life of me figure out how to get the --quiet-deps flag to work. I have it in the list of flags after my sass command and I always get lots of deprecation warnings. What am I doing wrong?
That is my command line exactly as used... |
@katie1348 That looks like it should work. Can you make an example repository that reproduces the error? |
@nex3 I also get a similar issue as @katie1348 when using watch mode with npm scripts, it works fine when I'm doing a regular build, that is not in watch mode my npm scripts are looking like this "scripts": {
"sass-build-task:scss-compile:bootstrap": "sass src/styles/slickgrid-theme-bootstrap.scss dist/styles/css/slickgrid-theme-bootstrap.css --style=compressed --quiet-deps",
"postsass-build-task:scss-compile:bootstrap": "postcss --no-map --use autoprefixer --output dist/styles/css/slickgrid-theme-bootstrap.css dist/styles/css/slickgrid-theme-bootstrap.css --style=compressed",
"sass-build-task:scss-compile:material": "sass src/styles/slickgrid-theme-material.scss dist/styles/css/slickgrid-theme-material.css --style=compressed --quiet-deps",
"postsass-build-task:scss-compile:material": "postcss --no-map --use autoprefixer --output dist/styles/css/slickgrid-theme-material.css dist/styles/css/slickgrid-theme-material.css --style=compressed",
"presass:watch:bootstrap": "cross-env npm run sass-build-task:scss-compile:bootstrap",
"sass:watch:bootstrap": "cross-env npm run sass-build-task:scss-compile:bootstrap -- --watch",
"presass:watch:material": "cross-env npm run sass-build-task:scss-compile:material",
"sass:watch:material": "cross-env npm run sass-build-task:scss-compile:material -- --watch"
} I tried adding the flag like this My project is fairly large, so I'm not sure it would be a good project to test with, but if you really wish to do so then the npm scripts are here and you would have to follow these installation instructions |
I have, I think, made a repository that shows the problem. It might not be the smallest that shows it, but it is fairly small. https://github.com/katie1348/scss/tree/master The file startsass contains my command line. On my system this will output the following: --------------------------- Start of Paste --------------------------------
--------------------------- End of Paste -------------------------------- Sorry for the spam in the comment. If you have any difficulties, I will go my best to help. it is a simple use of font awesome 5.15.3 (not updated and uses the division symbol). And a simple scss file to import it. This is a significantly stripped down version of what I have in production. But, it still shows the error. If I am doing something incorrectly, I will be grateful for your help. |
Great, I can reproduce that. Thanks @katie1348. |
Oh, I see the issue: you're not actually loading fontawesome from the load path, you're loading it using a relative import ( |
Thank you for that, it did resolve the problem and that makes me feel so much better. Your time and patience have and are appreciated. :) |
Could anyone provide guidance on how to use the |
It's not yet part of the JS API. See sass/sass#3065. |
Ok. So for those of us using webpack, there's no workaround to avoid all the deprecation warnings? |
Not yet. I'm sorry. We're hard at work on it. |
@nex3 No worries! It's easy enough to just ignore. 🙂 |
Hi, is there any way to stop warnings when importing a stylesheet inside scss files? Today we are importing some font-awesome files like this: I'm using |
To work around this, I went in to the font awesome files and changed all the / 2 into * 0.5 and did the same trick for the / 4. It took about 3 minutes. It is a pain, but it was my quickest solution. I am using Dart SASS, so this might be of no help. My Font Awesome is v5, if that matters. |
Actually everything is inside my |
One solution, for folks looking for a temporary fix, is to use Not a perfect solution in all cases - but a good solution in many. |
Because |
Most users only have the capacity to fix deprecation warnings in their own code, but they may end up using libraries that have their own deprecation warnings. We should add a
--quiet-upstream
flag (and similar flags for the Dart and JS APIs) to silence deprecation warnings emitted by upstream libraries (that is, libraries loaded through load paths andpackage:
URLs).I think this flag should probably not silence warnings due to
@warn
, since libraries frequently use those to indicate that downstream users are using the library in an invalid or deprecated way.The text was updated successfully, but these errors were encountered: