dlmanning / gulp-sass

SASS plugin for gulp
MIT License
1.56k stars 381 forks source link

`render()` and `renderSync()` are deprecated for the `sass` package #867

Open Rezyan opened 1 year ago

Rezyan commented 1 year ago

Hi,

After having created a performance issue for the sass package, I learned that the render() and renderSync() methods were deprecated and suffered from performance issues:

We can also notice it in the comments of the code:

renderSync

render

Ideally, we should suggest a way to use compile() and compileAsync() methods for the following lines:

https://github.com/dlmanning/gulp-sass/blob/c04bb67043fdbcb930152232ee9ba4caff0b2599/index.js#L145

https://github.com/dlmanning/gulp-sass/blob/c04bb67043fdbcb930152232ee9ba4caff0b2599/index.js#L158

Example from sass:

const sass = require('sass');

const result = sass.compile(scssFilename);

// OR

// Note that `compileAsync()` is substantially slower than `compile()`.
const result = await sass.compileAsync(scssFilename);
nex3 commented 1 month ago

Heads up: we (the Sass team) are going to start emitting deprecation warnings for uses of the legacy API pretty soon.