Skip to content
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

chore!: Normalize repository, dropping node <10.13 support #34

Merged
merged 9 commits into from
Aug 25, 2022

Conversation

sttk
Copy link
Contributor

@sttk sttk commented May 29, 2022

This PR updates this project:

  • Updates dependency versions
  • Updates GitHub Actions files
  • Adds, changes and deletes some project files
  • Drops arr-filter, array-map, array-each, array-initial, and array-last from dependencies.
    • arr-flatten is left because Array#flat is introduced in Node.js v11.

NOTE: Be careful that this package depends on async-done, async-settle and now-and-later that will be bumped up.

@sttk sttk force-pushed the chore-normalize-repository branch from 2dca685 to e958d97 Compare May 29, 2022 05:03
package.json Outdated Show resolved Hide resolved
@phated phated added this to In progress in v5 Jun 27, 2022
.eslintrc Outdated Show resolved Hide resolved
lib/helpers.js Outdated
@@ -2,10 +2,8 @@

var assert = require('assert');

var filter = require('arr-filter');
var map = require('arr-map');
// bach supports nodejs>=v10.13, but Array#flat is introduced in v11.
var flatten = require('arr-flatten');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should arr-flatten be replaced by Array.prototype.slice.apply?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arr-flatten expands array elements recursively.

@sttk
Copy link
Contributor Author

sttk commented Jul 3, 2022

@phated I've dropped arr-flatten and implements alternate code.

lib/flatten.js Outdated
Comment on lines 3 to 14
function flatten(arr, ret) {
ret = ret || [];
for (var i = 0, n = arr.length; i < n; i++) {
var el = arr[i];
if (Array.isArray(el)) {
flatten(el, ret);
} else {
ret.push(el)
}
}
return ret;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I originally designed bach, I only wanted to support this syntax:

bach.series([a, b, c], options)

I don't really care if we recursively flatten, and this will be a breaking release, so I think we can use Array.prototype.slice.apply

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phated OK. I'll modify it to use Array.prototype.slice.apply.

@sttk sttk force-pushed the chore-normalize-repository branch from 77b41fe to 04f75ea Compare July 10, 2022 08:45
@sttk
Copy link
Contributor Author

sttk commented Jul 10, 2022

@phated I've modified what you pointed out.

lib/helpers.js Outdated Show resolved Hide resolved
lib/helpers.js Outdated Show resolved Hide resolved
lib/helpers.js Outdated Show resolved Hide resolved
lib/helpers.js Outdated Show resolved Hide resolved
lib/series.js Show resolved Hide resolved
test/onSettled.js Outdated Show resolved Hide resolved
@@ -53,28 +56,29 @@ function buildOnSettled(done) {
}

function verifyArguments(args) {
args = flatten(args);
var lastIdx = args.length - 1;
args = Array.prototype.slice.apply(args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to add a semantic commit message for this potentially breaking change

Copy link
Member

@phated phated left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sttk 🙇 This looks great. I'm going to merge and then reword some things like extensions since they are now called options in now-and-later

@phated phated merged commit 1c631cb into gulpjs:master Aug 25, 2022
@github-actions github-actions bot mentioned this pull request Aug 25, 2022
@phated phated moved this from In progress to Done in v5 Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v5
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants