oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
74.37k stars 2.78k forks source link

Performance Enhancement for Creating Nuxt 3 Project #9916

Open zhaolinlau opened 7 months ago

zhaolinlau commented 7 months ago

What is the problem this feature would solve?

I am a Windows 11 user, I was trying to create a nuxt 3 project using bun and it took a lot of time...

Time taken to create a nuxt 3 project using bun is around 62.99s:

PowerShell 7.4.1
PS C:\Users\Win10> cd desktop
PS C:\Users\Win10\Desktop> bunx nuxi init test1

✔ Which package manager would you like to use?
bun
◐ Installing dependencies...                                                                               12:36:30 PM
bun install v1.1.0 (5903a614)

$ nuxt prepare
✔ Types generated in .nuxt                                                                                12:37:35 PM

 + nuxt@3.11.1
 + vue@3.4.21
 + vue-router@4.3.0

 756 packages installed [62.99s]
✔ Installation completed.                                                                                 12:37:35 PM

✔ Initialize git repository?
Yes
ℹ Initializing git repository...                                                                          12:37:37 PM

Initialized empty Git repository in C:/Users/Win10/Desktop/test1/.git/
                                                                                                           12:37:37 PM
✨ Nuxt project has been created with the v3 template. Next steps:
 › cd test1                                                                                                12:37:37 PM
 › Start development server with bun run dev                                                               12:37:37 PM
PS C:\Users\Win10\Desktop>

Time taken to create a nuxt 3 project using pnpm is around 21.9s:

PowerShell 7.4.1
PS C:\Users\Win10> cd desktop
PS C:\Users\Win10\Desktop> pnpm dlx nuxi init test2
Packages: +1
+
Progress: resolved 2, reused 1, downloaded 0, added 1, done

✔ Which package manager would you like to use?
pnpm
◐ Installing dependencies...                                                                               12:38:06 PM
Packages: +755
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 803, reused 755, downloaded 0, added 755, done

> nuxt-app@ postinstall C:\Users\Win10\Desktop\test2
> nuxt prepare

ℹ Compiled types/imports.d.ts in 758.65ms                                                                 12:38:28 PM
ℹ Compiled plugins/server.mjs in 819.28ms                                                                 12:38:28 PM
ℹ Compiled plugins/client.mjs in 831.15ms                                                                 12:38:28 PM
ℹ Compiled types/plugins.d.ts in 831.92ms                                                                 12:38:28 PM
✔ Types generated in .nuxt                                                                                12:38:28 PM

dependencies:
+ nuxt 3.11.1
+ vue 3.4.21
+ vue-router 4.3.0

Done in 21.9s
✔ Installation completed.                                                                                 12:38:28 PM

✔ Initialize git repository?
Yes
ℹ Initializing git repository...                                                                          12:38:29 PM

Initialized empty Git repository in C:/Users/Win10/Desktop/test2/.git/
                                                                                                           12:38:30 PM
✨ Nuxt project has been created with the v3 template. Next steps:
 › cd test2                                                                                                12:38:30 PM
 › Start development server with pnpm run dev                                                              12:38:30 PM
PS C:\Users\Win10\Desktop>

What is the feature you are proposing to solve the problem?

Improve the performance

What alternatives have you considered?

No response

Jarred-Sumner commented 7 months ago

Hm I wonder whats going on here

ReeceXW commented 7 months ago

This actually fails completely in MacOS TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)

Running with --bun fails with different issues