nodejs / nodejs/userland-migrations

XMLHttpRequest to fetch

Open
#520 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
85
Forks
55
Avg merge
3d 11h
Merged PRs (30d)
9

Description

This isn't really node specific, but XMLHttpRequest has long been all-but-replaced by fetch, and it would be nice to add a migration to allow these legacy codebases to run in modern environments, including Node.js

Before:

const req = new XMLHttpRequest();
req.addEventListener("load", () => console.log(this.responseText));
req.open("GET", "http://www.example.org/example.txt");
req.send();

After:

const req = await fetch("http://example.org");
console.log(req.text());

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by locating the migration entry point for XMLHttpRequest and reviewing how existing API migrations are tested. Use the supplied before-and-after examples to define the expected transformation, then add coverage showing legacy XMLHttpRequest code can run in modern Node.js with fetch.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.