Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:58
    Manxiong26 commented #3103
  • 18:14
    image72 commented #137
  • Jun 11 23:11
    hervegbedji opened #3129
  • Jun 11 11:16
    mamadoumarega commented #3103
  • Jun 11 01:48
    nschonni assigned #3125
  • Jun 10 12:26
    dependabot[bot] labeled #142
  • Jun 10 12:26
    dependabot[bot] opened #142
  • Jun 10 12:26

    dependabot[bot] on npm_and_yarn

    Bump glob-parent from 5.1.0 to … (compare)

  • Jun 10 08:36
    qafoori commented #3103
  • Jun 09 21:28
    okosodovictor commented #3103
  • Jun 09 16:39
    maxburke commented #3106
  • Jun 09 14:21
    nschonni commented #3125
  • Jun 09 14:20
    alvinometric commented #3125
  • Jun 09 05:53
    Brew-Brew commented #2922
  • Jun 08 19:50
    nschonni closed #3128
  • Jun 08 19:50
    nschonni commented #3128
  • Jun 08 19:19
    donkirkby opened #3128
  • Jun 08 17:54
    nschonni pinned #3123
  • Jun 08 17:54
    nschonni unpinned #3077
  • Jun 08 17:54
    nschonni closed #3127
iniatse
@iniatse
anybody?
The Jared Wilcurt
@TheJaredWilcurt
@iniatse from my understanding Node-Sass does not have a working "Watch" feature. You can combine node-sass with a tool like chokidar or you can try the newer Dart-based version of Sass (https://www.npmjs.com/package/sass)
iniatse
@iniatse
the dart-base version has this?
The Jared Wilcurt
@TheJaredWilcurt
it should have it in the CLI options, https://sass-lang.com/documentation/cli/dart-sass#watch
@iniatse
iniatse
@iniatse
@TheJaredWilcurt I'm using now fs.watch with the node-sass node API
works so far
The Jared Wilcurt
@TheJaredWilcurt
cool. long term though node-sass will not be recieving any updates, and is already missing newer features like @use. npm install sass will be maintained and is currently up-to-date.
iniatse
@iniatse
@TheJaredWilcurt I'm anyway already switching to somepthing else. I just need to support some code that I cannot refactor now right away
The Jared Wilcurt
@TheJaredWilcurt
:+1:
Dipl.-Ing. (FH) Johannes Neugschwentner
@joehannes
hello, anyone
got trouble including a package(-file) which is referred to via the package.json-main-entry definition
tried sass load-path='node_modules' as well asincludePaths` .. nothing changes anything
using latest sass 1.32
ooops, sorry, wrong channel, wanna go to dart-sass
oh, there is no dart-sass
The Jared Wilcurt
@TheJaredWilcurt
The Jared Wilcurt
@TheJaredWilcurt
iniatse
@iniatse

Why does sass not optimize duplicate dependencies? Essentially less and sass dont do that, like here: webpack-contrib/less-loader#7

It makes no sense at all to have a scss file imported two times. Every compiler does optimize things, why not sass?<

If you work modular, then the code from the example is perfectly fine.

I read that is is a design decision, but isn't it lets say a not very beneficial one?
There is no advantage, only disadvantages if you have the same scss imported two times
therefore the compiler should optimize it
You'd never ever want that what sass and less is doing here even tough it is by design...
lets give another example:
iniatse
@iniatse

_slider.scss

.slider {
  margin:10px;
}

_fooSlider.scss

@import "./_slider.scss";

_barSlider.scss

@import "./_slider.scss";

stlyes.scss

@import "./_fooSlider.scss";
@import "./_barSlider.scss";
you would end up with 2 times the .slider css
It really makes no sense for the compiler to not optimize that
I guess it is because of possible variable imports?
iniatse
@iniatse
But it still could optimize and still take the variables into account
The Jared Wilcurt
@TheJaredWilcurt
@iniatse This is a side effect of the simplicity of the @import syntax. There is a new @use syntax (not in node-sass) that addresses this. http://sass.logdown.com/posts/7858341-the-module-system-is-launched
Instead of npm install node-sass you do npm install sass. The API is the same, but instead of using a C (SassC) LibSass Node Binding to execute the processing, it uses a Dart-Sass produced native JS file for the processing.
The Jared Wilcurt
@TheJaredWilcurt
Or if you don't want to upgrade tooling right now, as long as you are using GZip or Brotli on your server, any redundency you have will be compressed out of the file transfer. Though they would still be loaded in memory, and depending on project structure it is possible for this to effect the cascade (but removing the duplicates would also effect the cascade)
iniatse
@iniatse
@TheJaredWilcurt I think I will use postcss and the plugin postcss-discard-duplicates. Switching to the sass instead of node-sass is no option simply because it is damn slow
So I create a css file and then input that into postcss with that plugin active
Hopefully that works
The hello world of that works. I have to try more complicated scenarios
The Jared Wilcurt
@TheJaredWilcurt
you may just want to evaluate how your project is set up if you are having this issue also. It may be better to simplify the project so that you have a single file that imports the rest of the files in the proper order. Ultimately the files will all be concatenated into one anyway, and the order of code in CSS matters a great deal. So organizaing your project this way can really simplify things. I personally am a big fan of the ITCSS approach for organizing. You can see an example at the bottom of this page: https://GraphMyCSS.com
iniatse
@iniatse
Yes but you want to work in an understandable manner and just plugging things together isn't sustainable in a big application
Lets say you have 2 dozens of dependencies and they have dependencies which require some scss. You just plug the scss together in you main file? Where do you doc all that stuff? There is no consensus at all on how do do that. Modularity clearly solves that, because a component only depends on itself an not on something to add to the main scss file. Everybody can comprehend that _FooSlider.js just depends on _FooSlider.scss.
Simplicity is key
Plugging everything together in a main.scss file works, but it is an horrible approach IMO. In teams it's is important that you have a clear path and everybody knows how it works.
Modularity and self encapsulation is proven to work
iniatse
@iniatse
These are basically the two approaches that you can take. Put _Slider.scss in you main file and make _FooSlider.scss and _BarSlider.scss etc all work and to that for all kinds of dependencies. Or include _FooSlider.scss and _BarSlider.scss into you main scss file, but then you need to remove duplicates
It dosen't matter how you organize and name your whole scss, these are the two approches.
I mean yes you can also use inheritance from scss I don't like that at all especially how it works in sass/scss
iniatse
@iniatse
Do you think node-sass will ad @use anytime soon?
iniatse
@iniatse
I mean @use simply works. So sass is essentially a superset of node-sass atm or is there anything in node-sass which is not in sass?
The Jared Wilcurt
@TheJaredWilcurt
Node-Sass is being deprecated. It takes a lot of work to port the Dart Code to C and do all of the hundreds of LibSass Node Bindings based on it. But mainly it's just a lot of effort to port to C. Theoretically it was so that ANY programming language could have fast bindings. And there were Java, Ruby, .NET, etc. ones made........ buuuuuuut nobody used them. Literally only the Node-Sass binding was used by anyone. So it was a massive amount of work just to get Sass to run with Node. and since Dart-Sass can just auto-output a native JS file now that is completely up-to-date with the latest Dart code, it just doesn't make sense to keep maintaining the old pipeline.
So I would be VERY surprised if Node-Sass ever gets another update
Personally, I would be all for a crowd funding campaign to at least get a SassC > LibSass > Node-Sass release with @use. But I think people like use (that notice the Sass.js slowness) are a minority