denoland / deno_install

Deno Binary Installer
https://deno.land/
960 stars 179 forks source link

`.bashrc` lines should be added by default in the install one-liner #286

Open josephrocca opened 6 months ago

josephrocca commented 6 months ago

TL;DR: Rust, Bun, and many other tools add .bashrc lines automatically, and this makes it a lot easier to quickly get up and running with a tool, especially for newbies. I really think Deno should add .bashrc lines automatically.


Each time I have to install Deno on a new machine (not often), I'm re-surprised that a one-liner install is made into a multi-step, newbie-confusing process. It's not that it's hard/annoying for me, because I very rarely have to do it and I'm an experienced dev, but I'm just surprised that this very obvious friction is sitting there, year after year.

I find it hard to believe that the team hasn't considered reducing the friction by the install experience one-step, so I'm (wildly) guessing someone on the team has a kind of ~ideological/"correctness"/theoretical position against it or something, but, again, I'm wildly guessing here and could be completely off-base on that assumption.

I guess another possibility here is that the team has a kind of "curse of knowledge", and so doesn't actually perceive this as friction for newer devs. I've tutored in coding so it's painful for me to see such plain and fixable friction, knowing how hard it can be for newer devs to deal with "simple" stuff like this, especially when the full instruction given to them is just this blob of unformatted/unspaced text:

Archive:  /home/joe/.deno/bin/deno.zip
  inflating: /home/joe/.deno/bin/deno  
Deno was installed successfully to /home/joe/.deno/bin/deno
Manually add the directory to your $HOME/.bashrc (or similar)
  export DENO_INSTALL="/home/joe/.deno"
  export PATH="$DENO_INSTALL/bin:$PATH"
Run '/home/joe/.deno/bin/deno --help' to get started

I installed Bun just now, and they add it automatically. Rust does too. Also, another thing to take inspiration from Bun is the formatting of the install text:

image

image

(Deno's kinda makes my eyes defocus. But that's just an aside - not super important.)

Please, for the benefit of newbies and the growth of Deno, add the bashrc lines automatically 🙏

Thank you for coming to my ted talk.

matoaaa commented 6 months ago

Additionally also environment variables (DENO_INSTALL, PATH) in the current shell session could be updated so users can start using deno directly without the need to restart shell or rerun ~/.bashrc.

josephrocca commented 6 months ago

Unfortunately I don't think that part is possible (though I could be wrong), so there should instead be a clear instruction like in Bun/Rust/etc.

muddlebee commented 6 months ago

+1

josephrocca commented 4 months ago

@mmastrac Any chance this could could be fixed for v2.0?

dsherret commented 3 months ago

PRs welcome.

kt3k commented 3 months ago

Historically we keep rejecting this suggestion. ref #52 #157 #177 #178 #231 #268

One reason is that proper shell detection is more difficult in *nix system (there are many shells and they use different profile paths) than on windows. Another reason is that we'd like to keep the script easily understandable & auditable by the users.

josephrocca commented 3 months ago

I'm not sure I'll say anything to convince you here that you haven't already heard, assuming you read at least the bold parts of my original post, but: Deno install experience could be delightful, and other projects realise how important this is, and are willing to trade away (legitimately important) things for that (like install script simplicity, as you say). MacOS+Windows+Ubuntu would be enough. No need to dump *nix burdens on newbies - just add one new flag, and add that to the default install command on the install docs page. Or add even add a dropdown to select OS. Or almost literally anything other than making people manually add stuff to their bashrc. Newbies will suffer less, can't save souls in an empty church, etc.

If you are unmoved, please feel free to close this issue - painful, but no hard feelings.

kt3k commented 3 months ago

Bun, for example, does the detection of bash, zsh, fish, and it takes ~116 lines for it https://github.com/oven-sh/bun/blob/ba5dd63eb6d2855fd814fbc92589f796b5b8adf5/src/cli/install.sh#L179-L295, which is almost double of our current install.sh (60 lines). I'm not sure it's worth it

@ry Do you still feel strongly about this policy?

marvinhagemeister commented 3 months ago

+1 on adding those by default. This removes a point of friction for new users. We should do this and the benefits for new users far outweighs concerns over lines of code of the install script to me.