Skip to content

[search-kibana] Remove node-fetch dependency in favor of native fetch#250716

Merged
afharo merged 5 commits intoelastic:mainfrom
afharo:remove-node-fetch/search-kibana
Feb 4, 2026
Merged

[search-kibana] Remove node-fetch dependency in favor of native fetch#250716
afharo merged 5 commits intoelastic:mainfrom
afharo:remove-node-fetch/search-kibana

Conversation

@afharo
Copy link
Copy Markdown
Member

@afharo afharo commented Jan 28, 2026

Summary

This PR removes the node-fetch dependency for files owned by @elastic/search-kibana.

Why

Node.js 18+ includes a native fetch API (built on undici internally), making the node-fetch package unnecessary. This reduces the dependency footprint by removing one runtime dependency and its transitive dependencies.

Changes

  • Updated search_notebooks notebook catalog to use native fetch
  • Updated sample_data_ingest download utility to use native fetch with Readable.fromWeb() for stream conversion
  • Updated all related test files to use jest.spyOn(global, 'fetch')

Warning

These changes were vibe-coded using the AI agent claude-4.5-opus-high. Please review carefully.

Test plan

  • Type check passes
  • ESLint passes
  • Unit tests pass for modified files

## Changes
- Updated search_notebooks notebook catalog to use native fetch
- Updated sample_data_ingest download utility with Readable.fromWeb()
- Updated all related test files

> [!WARNING]
> These changes were vibe-coded using the AI agent `claude-4.5-opus-high`. Please review carefully.
@afharo afharo requested a review from a team as a code owner January 28, 2026 13:12
@afharo afharo added backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Search labels Jan 28, 2026
@afharo afharo enabled auto-merge (squash) January 29, 2026 16:22
@afharo afharo merged commit d337067 into elastic:main Feb 4, 2026
17 checks passed
@afharo afharo deleted the remove-node-fetch/search-kibana branch February 4, 2026 20:00
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

The CI Stats report is too large to be displayed here, check out the CI build annotation for this information.

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Search v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants