-
Notifications
You must be signed in to change notification settings - Fork 381
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
Update to major version 5 #802
Conversation
Also moves node-sass to devDependencies and peerDependencies. This helps prevent dupes and conflicts in packages using gulp-sass
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. |
Co-authored-by: Michael Mifsud <xzyfer@gmail.com>
Can the previously proposed updates the |
Additionally, given we're bumping the major and updating the gulp dependencies, are you to confirm whether these proposed 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 |
When I used gulp heavily the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @xzyfer! I've made a couple changes, and identified an open concern I'd like your input on. I also updated the PR description to better surface the changes in this PR. There's a tasklist now – please feel free to tell me if I missed something. I hope to come back tomorrow to update the docs.
Two open questions:
- Should we update the test suite to provide better confidence about Dart Sass? See Update to major version 5 #802 (comment)
Should we update other dependencies in this repo that were not broken by node-sass or node 12, just to provide better stability?Edit: I went ahead and updated all our dependencies to the latest supported by node 12
index.js
Outdated
if (!compiler || !compiler.render) { | ||
const message = new PluginError( | ||
PLUGIN_NAME, | ||
'\n' + | ||
'gulp-sass 5 does not have a default Sass compiler; please set one yourself.\n' + | ||
'Both the `sass` and `node-sass` packages are permitted.\n' + | ||
|
||
'For example, in your gulpfile:\n\n' + | ||
' var sass = require(\'gulp-sass\')(require(\'sass\'));\n', | ||
{ showProperties: false }, | ||
).toString(); | ||
process.stderr.write(`${message}\n`); | ||
process.exit(1); | ||
} | ||
gulpSass.compiler = compiler; | ||
return gulpSass; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 Please let me know if I should implement this API some other way!
Edit: This is outdated because a8de2a0 resulted in some formatting changes, but the implementation is the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic work! I'll try to cut a release in the next couple days once the dust settles from today's gulp-sass and node-sass minor releases.
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
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 ? |
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
<#802 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAENSWB7GN62JFOURM64FCDTUZOKLANCNFSM46WECMZQ>
.
|
I don't know about dart-sass and node-sass, but using |
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 #802 (comment)). 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
Tasks
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 Should gulp-sass recommend node-fibers package now that it's obsolete? #771). Best practice is to use sync importers for now, and the Dart Sass team is working on a fix.