Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Conversation

@DeeDeeG
Copy link
Contributor

@DeeDeeG DeeDeeG commented Feb 23, 2022

Requirements for Contributing a Bug Fix (from template, click to expand...)

Identify the Bug

The "Bump dependencies" job of the Nightly CI pipeline has been broken since #23506 landed.

See my comment here: #23506 (comment) for details.

Description of the Change

In the script/ dir, downgrade node-fetch from 3.x to ^2.6.7.

Alternate Designs

Could properly import node-fetch 3.x as an ESM module.

I personally don't see why to go through that trouble when the 2.x branch is what we were using before, still supported, still works, even recommended for CommonJS projects such as Atom's build and CI scripts. See: https://github.com/node-fetch/node-fetch/blob/v3.2.0/docs/v3-UPGRADE-GUIDE.md#converted-to-es-module

(Link documents ESM import instructions/considerations for node-fetch v3, as part of a general node-fetch v2 to v3 migration guide.)

Possible Drawbacks

I guess the 2.x branch of node-fetch could theoretically go out of support at some point, at which time we might wish to have done a proper migration to v3 already to overcome the breaking changes and have smoother upgrade to v3/v4/...? Unclear if this will ever be necessary. Just speculating so I have something to write under this heading.

Verification Process

Read some docs and interpreted error messages from Atom's CI, did some detective work... See #23506 (comment) again for details/background that led me to this solution.

Also, this makes the "Bump dependencies" job in Nightly CI pass at my fork: https://dev.azure.com/DeeDeeG/b/_build/results?buildId=1232&view=logs&j=6f0e81e9-e86f-5543-732c-a45afe53d8f1

Release Notes

N/A

This version has all the known security patches in v3.x,
and is meanwhile the recommended version to use from CommonJS
(NodeJS-style) modules, as opposed to ESM.

Atom's build and CI scripts are all CommonJS as far as I know,
so we should basically stay on node-fetch v2.x.

This fixes the currently broken "Bump dependencies" job in Nightly CI.

Effectively reverts ad1318e,
AKA atom#23506,
albeit with a more up-to-date patch version of node-fetch v2.x.
@darangi darangi merged commit 6596e0f into atom:master Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants