Description
This codemod should remove HTTP/2 priority-related options and methods since priority signaling has been deprecated. It's useful to migrate code that uses deprecated HTTP/2 priority features.
It should remove HTTP/2 priority-related options and methods. It should handle priority parameters in HTTP/2 stream creation. It should remove weight and dependency settings in HTTP/2 streams. It should handle both CommonJS and ESM imports.
Examples
Case 1
Before:
const http2 = require("node:http2");
const session = http2.connect("https://example.com", {
priority: {
weight: 16,
parent: 0,
exclusive: false
}
});
After:
const http2 = require("node:http2");
const session = http2.connect("https://example.com");
Case 2
Before:
const http2 = require("node:http2");
const stream = session.request({
":path": "/api/data",
priority: { weight: 32 }
});
After:
const http2 = require("node:http2");
const stream = session.request({
":path": "/api/data"
});
Case 3
Before:
const http2 = require("node:http2");
stream.priority({
exclusive: true,
parent: 0,
weight: 128
});
After:
const http2 = require("node:http2");
// Priority signaling removed - no replacement needed
Case 4
Before:
import http2 from "node:http2";
const client = http2.connect("https://example.com");
client.settings({ enablePush: false, priority: true });
After:
import http2 from "node:http2";
const client = http2.connect("https://example.com");
client.settings({ enablePush: false });
REFS
Description
This codemod should remove HTTP/2 priority-related options and methods since priority signaling has been deprecated. It's useful to migrate code that uses deprecated HTTP/2 priority features.
It should remove HTTP/2 priority-related options and methods. It should handle priority parameters in HTTP/2 stream creation. It should remove weight and dependency settings in HTTP/2 streams. It should handle both CommonJS and ESM imports.
Examples
Case 1
Before:
After:
Case 2
Before:
After:
Case 3
Before:
After:
Case 4
Before:
After:
REFS