Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

this aims to fix some bugs in the current proxy implementation by dropping httpxy and using fetch directly (as nitro does).

much of the implementation is copied from nitro (thank you @pi0 - do you spot any issues here or things we can improve further?):

Copy link
Contributor

github-actions bot commented Sep 24, 2025

Bundle Stats β€” create-nuxt size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
7 2.13 MB 0%

Changeset

No files were changed

View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

No assets were bigger

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 1.09 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/index.mjs 904.13 kB 0%
chunks/satisfies.mjs 116 B 0%
shared/create-nuxt.BZoiezHJ.mjs 1.19 MB 0%

Copy link
Contributor

github-actions bot commented Sep 24, 2025

Bundle Stats β€” nuxi size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
58 3.62 MB β†’ 4.5 MB (+909.88 kB) +24.58%
Changeset (largest 100 files by percent change)
File Ξ” Size
node_modules/undici/lib/web/fetch/index.js πŸ†• +79.91 kB 0 B β†’ 79.91 kB
node_modules/undici/lib/llhttp/llhttp_simd-wasm.js πŸ†• +63.62 kB 0 B β†’ 63.62 kB
node_modules/undici/lib/llhttp/llhttp-wasm.js πŸ†• +63.54 kB 0 B β†’ 63.54 kB
node_modules/undici/lib/web/fetch/util.js πŸ†• +50.68 kB 0 B β†’ 50.68 kB
node_modules/undici/lib/dispatcher/client-h1.js πŸ†• +38.09 kB 0 B β†’ 38.09 kB
node_modules/undici/lib/web/fetch/request.js πŸ†• +34.82 kB 0 B β†’ 34.82 kB
node_modules/undici/lib/web/fetch/data-url.js πŸ†• +22.3 kB 0 B β†’ 22.3 kB
node_modules/undici/lib/web/cache/cache.js πŸ†• +21.46 kB 0 B β†’ 21.46 kB
node_modules/undici/lib/web/fetch/webidl.js πŸ†• +20.84 kB 0 B β†’ 20.84 kB
node_modules/undici/lib/web/fetch/headers.js πŸ†• +20.83 kB 0 B β†’ 20.83 kB
node_modules/undici/lib/core/util.js πŸ†• +19.31 kB 0 B β†’ 19.31 kB
node_modules/undici/lib/web/fetch/response.js πŸ†• +19.2 kB 0 B β†’ 19.2 kB
node_modules/undici/lib/dispatcher/client-h2.js πŸ†• +19.08 kB 0 B β†’ 19.08 kB
node_modules/undici/lib/web/websocket/websocket.js πŸ†• +18.71 kB 0 B β†’ 18.71 kB
node_modules/undici/lib/web/fetch/body.js πŸ†• +17.59 kB 0 B β†’ 17.59 kB
node_modules/undici/lib/dispatcher/client.js πŸ†• +17.22 kB 0 B β†’ 17.22 kB
node_modules/undici/lib/web/fetch/formdata-parser.js πŸ†• +15.45 kB 0 B β†’ 15.45 kB
node_modules/undici/lib/web/eventsource/eventsource.js πŸ†• +14.34 kB 0 B β†’ 14.34 kB
node_modules/undici/lib/web/websocket/connection.js πŸ†• +14.25 kB 0 B β†’ 14.25 kB
node_modules/undici/lib/web/websocket/receiver.js πŸ†• +13.86 kB 0 B β†’ 13.86 kB
node_modules/undici/lib/web/cookies/parse.js πŸ†• +12.5 kB 0 B β†’ 12.5 kB
node_modules/undici/lib/util/timers.js πŸ†• +12 kB 0 B β†’ 12 kB
node_modules/undici/lib/web/eventsource/eventsource-stream.js πŸ†• +11.9 kB 0 B β†’ 11.9 kB
node_modules/undici/lib/web/fileapi/util.js πŸ†• +11.69 kB 0 B β†’ 11.69 kB
node_modules/undici/lib/llhttp/constants.js πŸ†• +11.3 kB 0 B β†’ 11.3 kB
node_modules/undici/lib/mock/mock-utils.js πŸ†• +11.01 kB 0 B β†’ 11.01 kB
node_modules/undici/lib/core/request.js πŸ†• +10.74 kB 0 B β†’ 10.74 kB
node_modules/undici/lib/handler/retry-handler.js πŸ†• +10.11 kB 0 B β†’ 10.11 kB
node_modules/undici/lib/interceptor/dns.js πŸ†• +9.57 kB 0 B β†’ 9.57 kB
node_modules/undici/lib/api/readable.js πŸ†• +9.31 kB 0 B β†’ 9.31 kB
node_modules/undici/lib/web/websocket/util.js πŸ†• +9.27 kB 0 B β†’ 9.27 kB
node_modules/undici/lib/web/fileapi/filereader.js πŸ†• +8.79 kB 0 B β†’ 8.79 kB
node_modules/srvx/dist/adapters/node.mjs πŸ†• +7.96 kB 0 B β†’ 7.96 kB
node_modules/undici/lib/web/fetch/formdata.js πŸ†• +7.84 kB 0 B β†’ 7.84 kB
node_modules/undici/lib/web/cookies/util.js πŸ†• +7.59 kB 0 B β†’ 7.59 kB
node_modules/undici/lib/web/websocket/events.js πŸ†• +7.57 kB 0 B β†’ 7.57 kB
node_modules/undici/lib/core/connect.js πŸ†• +7.49 kB 0 B β†’ 7.49 kB
node_modules/undici/lib/mock/mock-interceptor.js πŸ†• +7.02 kB 0 B β†’ 7.02 kB
node_modules/undici/lib/handler/redirect-handler.js πŸ†• +6.9 kB 0 B β†’ 6.9 kB
node_modules/undici/lib/web/fileapi/encoding.js πŸ†• +6.88 kB 0 B β†’ 6.88 kB
node_modules/undici/lib/core/errors.js πŸ†• +6.69 kB 0 B β†’ 6.69 kB
node_modules/undici/lib/dispatcher/proxy-agent.js πŸ†• +6.14 kB 0 B β†’ 6.14 kB
node_modules/undici/lib/api/api-request.js πŸ†• +5.96 kB 0 B β†’ 5.96 kB
node_modules/undici/lib/core/diagnostics.js πŸ†• +5.91 kB 0 B β†’ 5.91 kB
node_modules/undici/lib/dispatcher/balanced-pool.js πŸ†• +5.76 kB 0 B β†’ 5.76 kB
node_modules/undici/lib/api/api-pipeline.js πŸ†• +5.68 kB 0 B β†’ 5.68 kB
node_modules/undici/lib/api/api-stream.js πŸ†• +5.5 kB 0 B β†’ 5.5 kB
node_modules/undici/index.js πŸ†• +5.21 kB 0 B β†’ 5.21 kB
node_modules/undici/lib/dispatcher/dispatcher-base.js πŸ†• +4.79 kB 0 B β†’ 4.79 kB
node_modules/undici/lib/dispatcher/pool-base.js πŸ†• +4.77 kB 0 B β†’ 4.77 kB
node_modules/undici/lib/dispatcher/env-http-proxy-agent.js πŸ†• +4.73 kB 0 B β†’ 4.73 kB
node_modules/undici/lib/mock/mock-agent.js πŸ†• +4.68 kB 0 B β†’ 4.68 kB
node_modules/undici/lib/web/cookies/index.js πŸ†• +4.43 kB 0 B β†’ 4.43 kB
node_modules/undici/lib/dispatcher/fixed-queue.js πŸ†• +4.37 kB 0 B β†’ 4.37 kB
node_modules/undici/lib/dispatcher/agent.js πŸ†• +4.11 kB 0 B β†’ 4.11 kB
node_modules/undici/lib/web/cache/cachestorage.js πŸ†• +3.87 kB 0 B β†’ 3.87 kB
node_modules/undici/lib/core/tree.js πŸ†• +3.65 kB 0 B β†’ 3.65 kB
node_modules/undici/lib/web/fetch/constants.js πŸ†• +3.6 kB 0 B β†’ 3.6 kB
node_modules/undici/lib/web/fetch/file.js πŸ†• +3.42 kB 0 B β†’ 3.42 kB
node_modules/undici/lib/dispatcher/pool.js πŸ†• +3.11 kB 0 B β†’ 3.11 kB
node_modules/undici/lib/core/constants.js πŸ†• +2.82 kB 0 B β†’ 2.82 kB
node_modules/srvx/dist/_chunks/response-Ca-wGejU.mjs πŸ†• +2.8 kB 0 B β†’ 2.8 kB
node_modules/undici/lib/api/api-upgrade.js πŸ†• +2.74 kB 0 B β†’ 2.74 kB
node_modules/undici/lib/api/api-connect.js πŸ†• +2.72 kB 0 B β†’ 2.72 kB
node_modules/undici/lib/core/symbols.js πŸ†• +2.71 kB 0 B β†’ 2.71 kB
node_modules/undici/lib/interceptor/dump.js πŸ†• +2.64 kB 0 B β†’ 2.64 kB
node_modules/undici/lib/api/util.js πŸ†• +2.53 kB 0 B β†’ 2.53 kB
src/dev/websocket.ts πŸ†• +2.52 kB 0 B β†’ 2.52 kB
node_modules/undici/lib/web/websocket/frame.js πŸ†• +2.47 kB 0 B β†’ 2.47 kB
node_modules/undici/lib/web/websocket/sender.js πŸ†• +2.44 kB 0 B β†’ 2.44 kB
node_modules/undici/lib/web/websocket/permessage-deflate.js πŸ†• +2.2 kB 0 B β†’ 2.2 kB
src/dev/fetch.ts πŸ†• +2.07 kB 0 B β†’ 2.07 kB
node_modules/undici/lib/web/fileapi/progressevent.js πŸ†• +1.85 kB 0 B β†’ 1.85 kB
node_modules/undici/lib/mock/mock-client.js πŸ†• +1.64 kB 0 B β†’ 1.64 kB
node_modules/undici/lib/mock/mock-pool.js πŸ†• +1.61 kB 0 B β†’ 1.61 kB
node_modules/undici/lib/dispatcher/dispatcher.js πŸ†• +1.61 kB 0 B β†’ 1.61 kB
node_modules/cookie-es/dist/index.mjs πŸ†• +1.49 kB 0 B β†’ 1.49 kB
node_modules/undici/lib/mock/pending-interceptors-formatter.js πŸ†• +1.46 kB 0 B β†’ 1.46 kB
node_modules/undici/lib/web/fetch/dispatcher-weakref.js πŸ†• +1.3 kB 0 B β†’ 1.3 kB
node_modules/undici/lib/web/websocket/constants.js πŸ†• +1.25 kB 0 B β†’ 1.25 kB
node_modules/undici/lib/api/abort-signal.js πŸ†• +1.25 kB 0 B β†’ 1.25 kB
node_modules/undici/lib/web/cache/util.js πŸ†• +1.13 kB 0 B β†’ 1.13 kB
node_modules/undici/lib/handler/decorator-handler.js πŸ†• +1.07 kB 0 B β†’ 1.07 kB
node_modules/undici/lib/web/fetch/global.js πŸ†• +1.04 kB 0 B β†’ 1.04 kB
node_modules/undici/lib/global.js πŸ†• +1002 B 0 B β†’ 1002 B
node_modules/undici/lib/mock/mock-symbols.js πŸ†• +954 B 0 B β†’ 954 B
node_modules/undici/lib/web/eventsource/util.js πŸ†• +929 B 0 B β†’ 929 B
node_modules/undici/lib/interceptor/redirect-interceptor.js πŸ†• +894 B 0 B β†’ 894 B
node_modules/undici/lib/dispatcher/retry-agent.js πŸ†• +856 B 0 B β†’ 856 B
node_modules/undici/lib/interceptor/redirect.js πŸ†• +737 B 0 B β†’ 737 B
node_modules/undici/lib/dispatcher/pool-stats.js πŸ†• +735 B 0 B β†’ 735 B
node_modules/undici/lib/mock/pluralizer.js πŸ†• +682 B 0 B β†’ 682 B
node_modules/undici/lib/mock/mock-errors.js πŸ†• +604 B 0 B β†’ 604 B
node_modules/undici/lib/interceptor/retry.js πŸ†• +539 B 0 B β†’ 539 B
node_modules/undici/lib/llhttp/utils.js πŸ†• +482 B 0 B β†’ 482 B
node_modules/undici/lib/web/cookies/constants.js πŸ†• +480 B 0 B β†’ 480 B
node_modules/undici/lib/web/fileapi/symbols.js πŸ†• +473 B 0 B β†’ 473 B
node_modules/undici/lib/web/websocket/symbols.js πŸ†• +472 B 0 B β†’ 472 B
node_modules/undici/lib/web/fetch/symbols.js πŸ†• +336 B 0 B β†’ 336 B
node_modules/undici/lib/api/index.js πŸ†• +295 B 0 B β†’ 295 B
View detailed bundle breakdown

Added

Asset File Size % Changed
shared/nuxi.D6tXIntv.mjs 0 B β†’ 158.51 kB (+158.51 kB) -
shared/nuxi.Gg4oZG1J.mjs 0 B β†’ 128.29 kB (+128.29 kB) -
shared/nuxi.BVftAOL6.mjs 0 B β†’ 18.11 kB (+18.11 kB) -

Removed

Asset File Size % Changed
shared/nuxi.CcH3VZ-h.mjs 158.51 kB β†’ 0 B (-158.51 kB) -100%
shared/nuxi.sAj5PmqJ.mjs 128.28 kB β†’ 0 B (-128.28 kB) -100%
shared/nuxi.B5WkReRs.mjs 18.11 kB β†’ 0 B (-18.11 kB) -100%

Bigger

Asset File Size % Changed
chunks/dev.mjs 28.45 kB β†’ 938.2 kB (+909.75 kB) +3197.82%
chunks/init.mjs 676.37 kB β†’ 676.48 kB (+113 B) +0.02%
chunks/index5.mjs 5.85 kB β†’ 5.86 kB (+5 B) +0.08%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
index.mjs 247 B 0%
dev/index.mjs 925 B 0%
chunks/add.mjs 6.89 kB 0%
chunks/analyze.mjs 3.35 kB 0%
chunks/build.mjs 2.07 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 780 B 0%
chunks/devtools.mjs 764 B 0%
chunks/generate.mjs 492 B 0%
chunks/info.mjs 4.43 kB 0%
chunks/index.mjs 274 B 0%
chunks/prepare.mjs 1.05 kB 0%
chunks/preview.mjs 3.58 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 2.06 kB 0%
chunks/upgrade.mjs 6.65 kB 0%
chunks/satisfies.mjs 116 B 0%
chunks/main.mjs 15.3 kB 0%
chunks/prompt.mjs 42.91 kB 0%
chunks/index2.mjs 199.56 kB 0%
chunks/jiti.mjs 498 B 0%
chunks/index3.mjs 71.97 kB 0%
chunks/multipart-parser.mjs 5.11 kB 0%
chunks/add2.mjs 12.1 kB 0%
chunks/search.mjs 45.85 kB 0%
chunks/xdg-open.mjs 25.32 kB 0%
chunks/node.mjs 145.67 kB 0%
chunks/index4.mjs 1.23 kB 0%
chunks/index6.mjs 904.13 kB 0%
chunks/multipart-parser2.mjs 4.58 kB 0%
shared/nuxi.Bv-FePcy.mjs 19.81 kB 0%
shared/nuxi.DQjfoGl0.mjs 57.22 kB 0%
shared/nuxi.CTyTlDmo.mjs 18.91 kB 0%
shared/nuxi.C-cP1f7p.mjs 1.71 kB 0%
shared/nuxi.C_u-rG9b.mjs 294 B 0%
shared/nuxi.DUZ_WukQ.mjs 2.57 kB 0%
shared/nuxi.8mhVoXwa.mjs 916.43 kB 0%
shared/nuxi.D2_bzAv0.mjs 1.54 kB 0%
shared/nuxi.DQbQuzNE.mjs 4.07 kB 0%
shared/nuxi.BSm0_9Hr.mjs 107 B 0%
shared/nuxi.DkoVccfL.mjs 10.64 kB 0%
shared/nuxi.CrvQqJcE.mjs 836 B 0%
shared/nuxi.BiWTNJI4.mjs 945 B 0%
shared/nuxi.BAGoDD49.mjs 1.05 kB 0%
shared/nuxi.BjhZEm2-.mjs 1.75 kB 0%
shared/nuxi.QWnQy_ku.mjs 5.75 kB 0%
shared/nuxi.DlMb1OKt.mjs 365 B 0%
shared/nuxi.DU9QXUOf.mjs 26.96 kB 0%
shared/nuxi.8uLzFmy0.mjs 14.73 kB 0%
shared/nuxi.BLb4POFS.mjs 42.47 kB 0%
shared/nuxi.Do0aYBCO.mjs 5.46 kB 0%
shared/nuxi.4t9faemh.mjs 43.64 kB 0%

Copy link
Contributor

github-actions bot commented Sep 24, 2025

Bundle Stats β€” nuxt-cli size comparison

Hey there, this message comes from a GitHub action that helps you and reviewers to understand how these changes affect the size of this project's bundle.

As this PR is updated, I'll keep you updated on how the bundle size is impacted.

Total

Files count Total bundle size % Changed
31 98.78 kB β†’ 103.33 kB (+4.55 kB) +4.61%
Changeset
File Ξ” Size
home/runner/work/cli/cli/packages/nuxi/src/dev/websocket.ts πŸ†• +2.52 kB 0 B β†’ 2.52 kB
home/runner/work/cli/cli/packages/nuxi/src/dev/fetch.ts πŸ†• +2.05 kB 0 B β†’ 2.05 kB
home/runner/work/cli/cli/packages/nuxi/src/commands/dev.ts πŸ“‰ -17 B (-0.15%) 11.31 kB β†’ 11.29 kB
View detailed bundle breakdown

Added

No assets were added

Removed

No assets were removed

Bigger

Asset File Size % Changed
chunks/dev.mjs 11.31 kB β†’ 15.86 kB (+4.55 kB) +40.25%

Smaller

No assets were smaller

Unchanged

Asset File Size % Changed
dev/index.mjs 0 B 0%
index.mjs 236 B 0%
chunks/index.mjs 14.49 kB 0%
chunks/analyze.mjs 3.35 kB 0%
chunks/cleanup.mjs 471 B 0%
chunks/dev-child.mjs 815 B 0%
chunks/devtools.mjs 763 B 0%
chunks/generate.mjs 492 B 0%
chunks/build.mjs 2.07 kB 0%
chunks/index2.mjs 308 B 0%
chunks/add.mjs 11.25 kB 0%
chunks/search.mjs 2.96 kB 0%
chunks/preview.mjs 3.58 kB 0%
chunks/test.mjs 1.16 kB 0%
chunks/typecheck.mjs 2.06 kB 0%
chunks/upgrade.mjs 6.65 kB 0%
chunks/prepare.mjs 1.05 kB 0%
chunks/info.mjs 4.46 kB 0%
chunks/init.mjs 12.75 kB 0%
chunks/add2.mjs 6.89 kB 0%
shared/cli.B9AmABr3.mjs 39 B 0%
shared/cli.CehBW0fN.mjs 1.71 kB 0%
shared/cli.BEUGgaW4.mjs 294 B 0%
shared/cli.BSm0_9Hr.mjs 107 B 0%
shared/cli.At9IMXtr.mjs 1.23 kB 0%
shared/cli.pLQ0oPGc.mjs 836 B 0%
shared/cli.qKvs7FJ2.mjs 945 B 0%
shared/cli.Cr-OCgdO.mjs 727 B 0%
shared/cli.DHenkA1C.mjs 351 B 0%
shared/cli.DVoN1ieL.mjs 5.57 kB 0%

Copy link

pkg-pr-new bot commented Sep 24, 2025

nuxt-cli-playground

npm i https://pkg.pr.new/create-nuxt@1051
npm i https://pkg.pr.new/nuxi@1051
npm i https://pkg.pr.new/@nuxt/cli@1051

commit: 9f5a5b7

Copy link

codspeed-hq bot commented Sep 24, 2025

CodSpeed Performance Report

Merging #1051 will not alter performance

Comparing feat/socket-fetch (9f5a5b7) with main (f4749f8)

Summary

βœ… 2 untouched

@danielroe danielroe marked this pull request as ready for review September 24, 2025 11:11
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could port it to crossws (/node) as Nitro needs this too.

* Fetch to a specific address (socket or network)
* Based on Nitro's fetchAddress implementation
*/
function fetchAddress(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have this at least 3 places now (twice in Nitro and here), this could be maintained single place upstream...

@danielroe danielroe merged commit bc4b293 into main Sep 26, 2025
15 checks passed
@danielroe danielroe deleted the feat/socket-fetch branch September 26, 2025 12:07
@github-actions github-actions bot mentioned this pull request Sep 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants