Skip to content

Commit 4494744

Browse files
committed
Release 4.0.0: upgrade from opn@6 to open@7, require Node 16
Upgrade grunt-contrib-internal from 6 to 8, which updates CI from Node 10,12,14 to Node 14,16,18,20. Fix default connect() hostname to work on Node 18+, where otherwise CI fails as follows: > Running "nodeunit:tests" (nodeunit) task > Testing connect_test.jsFatal error: connect ECONNREFUSED ::1:8000 > Error: connect ECONNREFUSED ::1:8000 > at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) Previously, grunt-contrib-connect was passing empty string or null down to `connect(,hostname)` to leave the default implicitly handled by `connect` and Node's built-in `http.Server` class. Then, later, it was doing a fallback to `0.0.0.0` but this only affected the CLI output text, not the value passed to `connect()`. Node 17+ changed per nodejs/node#40702 to prefer IPv6 loopback when available (`::`) instead of IPv4 loopback (`0.0.0.0`), unless `0.0.0.0` is explicitly passed. This was fixed in Node 20, with `http.get` underlying `net` TCP module implementing "Happy Eyeballs" (same as browsers and curl) which basically means trying both IPv6 and IPv4. nodejs/node#44731 The workaround is to call `dns.setDefaultResultOrder('ipv4first')` which ensures that the first try is over IPv4 instead of IPv6.
1 parent 7658372 commit 4494744

File tree

7 files changed

+8680
-2156
lines changed

7 files changed

+8680
-2156
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Tests
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
- "!dependabot/**"
8+
pull_request:
9+
workflow_dispatch:
410

511
env:
612
FORCE_COLOR: 2
@@ -13,15 +19,17 @@ jobs:
1319
strategy:
1420
fail-fast: false
1521
matrix:
16-
node: [10, 12, 14]
1722
os: [ubuntu-latest, windows-latest]
23+
node: [14, 16, 18, 20]
1824

1925
steps:
2026
- name: Clone repository
21-
uses: actions/checkout@v2
27+
uses: actions/checkout@v3
28+
with:
29+
persist-credentials: false
2230

2331
- name: Set up Node.js
24-
uses: actions/setup-node@v2
32+
uses: actions/setup-node@v3
2533
with:
2634
node-version: ${{ matrix.node }}
2735

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v4.0.0:
2+
date: 2023-07-13
3+
changes:
4+
- Requires node 16+.
5+
- Updated dependencies.
16
v3.0.0:
27
date: 2020-07-16
38
changes:

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# grunt-contrib-connect v3.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-connect/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-connect/actions?workflow=Tests)
1+
# grunt-contrib-connect v4.0.0 [![Build Status](https://github.com/gruntjs/grunt-contrib-connect/workflows/Tests/badge.svg)](https://github.com/gruntjs/grunt-contrib-connect/actions?workflow=Tests)
22

33
> Start a connect web server
44
@@ -380,6 +380,7 @@ grunt.registerTask('jasmine-server', 'start web server for jasmine tests in brow
380380

381381
## Release History
382382

383+
* 2023-07-13   v4.0.0   Requires node 16+. Updated dependencies.
383384
* 2020-07-16   v3.0.0   Requires node 10+. Updated dependencies.
384385
* 2019-09-03   v2.1.0   Update package lock. Allow all configuration options of livereload to be passed through.
385386
* 2018-09-09   v2.0.0   Drop Node.js < 6 support. Update all dependencies and switch to `node-http2`. Add `secureProtocol` in `httpsOptions`. Fix `open.appName`. Allow passing `serve-index` options.
@@ -412,4 +413,4 @@ grunt.registerTask('jasmine-server', 'start web server for jasmine tests in brow
412413

413414
Task submitted by ["Cowboy" Ben Alman](http://benalman.com)
414415

415-
*This file was generated on Thu Jul 16 2020 10:58:04.*
416+
*This is a generated file.*

0 commit comments

Comments
 (0)