Closed mxmason closed 3 years ago
Thanks for all this effort. The comment about broad version support was with intention of not needing to bump the major to limit the impact on the ecosystem.
I agree the changes to support versions in node-sass forces our hand here, and we had planned to bump the major in order to make node-sass optional anyway.
Can the previously proposed updates the CONTRIBUTING.md
and README.md
also be ported into this PR?
Additionally, given we're bumping the major and updating the gulp dependencies, are you to confirm whether these proposed README.md
make sense to be ported to this PR also?
Apologies I'm not in touch with gulp anymore.
Thanks for looking at my work! I can give the changes to Readme and Contributing a more thoughtful look tomorrow!
I noticed that the initial API for setting the compiler had users passing an argument, as with gulpSass(compiler)
. Should I revert to that, or keep the API where users set a compiler
prop after defining gulpSass
?
When I used gulp heavily the gulpSass(compiler)
was a common pattern so I'd favour that approach unless there's a strong argument against it. I believe that linked commit is fairly close to feature complete, so I'd suggest taking that a starting point for this work.
That's for all the great effort. I'll take a closer look in the next couple days.
Thanks, @xzyfer! I still need to update the docs, and I can do that over the next couple days if you want!
Awesome!
Hey, @xzyfer I've updated the README file to
node-fibers
(we now suggest switching to renderSync)Here's the rendered markdown.
I have not updated the Changelog yet, as I saw that the Changelog consists mostly of your cut releases, and i can't cut those. Let me know if I should do anything else!
Edit: Don't know why I tagged Dylan Manning in this comment at first; apologies!
Amazing work!
Hi,
Thanks for this update. Is it possible to import this as an ES module ?
Like : import sass from 'gulp-sass';
Hey @cyrilverloop,
This release can’t be imported as an esmodule. I’m open to working on a release that supports both commonjs and esmodules (if @xzyfer thinks it’d be useful), but that would take a bit of effort.
Would this also require dart-sass and node-sass adopt esm?
On Sun, 27 Jun 2021, 9:22 am EJ Mason, @.***> wrote:
Hey @cyrilverloop https://github.com/cyrilverloop,
This release can’t be imported as an esmodule. I’m open to working on a release that supports both commonjs and esmodules (if @xzyfer https://github.com/xzyfer thinks it’d be useful), but that would take a bit of effort.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dlmanning/gulp-sass/pull/802#issuecomment-869073122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAENSWB7GN62JFOURM64FCDTUZOKLANCNFSM46WECMZQ .
I don't know about dart-sass and node-sass, but using import
worked in gulp-sass v4.
Can the compiler be defined after the import ?
I might be wrong about ESM support here! I’ll test it when I’m at my desk. But yes, the compiler can be defined after import.
@cyrilverloop not sure you figured it out but this is my implementation after updating to v5
import dartSass from 'sass';
import gulpSass from 'gulp-sass';
const sass = gulpSass( dartSass );
@mae829 thanks for the import. Your solution works for me.
I recommend to put it in the documentation.
Thank you, @mae829! I agree that this should be in the docs and I will make a PR about it soon.
Summary
node-sass
from this module, and requires users to explicitly set a compiler of their choice.Now that we require users to install their own compilers, it is not strictly necessary for us to bump our minimum Node version, but supporting Node versions that have hit EOL could complicate things in the future. It's worth noting that
node-sass
has adopted Node 12 as a minimum requirement.New API
Major version 5 requires users to explicitly set a compiler by passing it to a curried function (per https://github.com/dlmanning/gulp-sass/pull/802#issuecomment-861236154). Both
node-sass
andsass
compilers are permitted.For example, in
gulpfile.js
:If the compiler is not set,
gulp-sass
will throw an error advising the user of this API.Miscellaneous fixes
These issues relate either to the current version of the project bundling
node-sass@4
, or to our dependencies currently being outdated.Issue list
- resolves #801 - resolves #797 - resolves #785 - resolves #782 - resolves #780 - resolves #799 - resolves #798 - resolves #775 - resolves #768Tasks
node-sass
to dev dependencies; update to version 6node-sass
node-sass
/ Node 12 for better future stabilityfibers
is not supported in Node 16 (per #771). Best practice is to use sync importers for now, and the Dart Sass team is working on a fix.