New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to disable adding yarn global scripts to $PATH
#10641
Comments
I think it's reasonable add an environment variable. Maybe |
With the edit, I agree! 😃 Sounds good to me 👍 |
I'd prefer the setting to be zstyle ':omz:plugins:yarn' global-path false In the code, we can test for that setting with zstyle -T ':omz:plugins:yarn' global-path Here This can be tested or chained with the normal true/false semantics: if zstyle -T ':omz:plugins:yarn' global-path; then
# or
zstyle -T ':omz:plugins:yarn' global-path && ... |
Looks great. I'll update the PR then |
Awesome, thank you! Before (in yarn v2 repo) $ hyperfine -w 2 'zsh -i -c exit'
Benchmark 1: zsh -i -c exit
Time (mean ± σ): 1.618 s ± 0.136 s [User: 1.833 s, System: 0.312 s]
Range (min … max): 1.490 s … 1.934 s 10 runs After $ hyperfine -w 2 'zsh -i -c exit'
Benchmark 1: zsh -i -c exit
Time (mean ± σ): 299.1 ms ± 10.7 ms [User: 201.1 ms, System: 140.3 ms]
Range (min … max): 272.6 ms … 311.6 ms 10 runs |
If the feature request is for a plugin or theme, specify it here.
yarn
pluginIf the feature solves a problem you have, specify it here.
See #10290 (comment)
Tl;dr:
yarn global bin
takes a long time (yarn global bin 0.15s user 0.05s system 83% cpu 0.241 total
on my system), adding significant overhead to new sessions.Additionally, Yarn v2 and later doesn't support the command, so in projects using the modern versions of Yarn the command always fails. Using
hyperfine
, callingzsh -i -c exit
takes1.568 s ± 0.063 s
with the yarn plugin and298.8 ms ± 6.6 ms
with it removed.Also of note is that the global
yarn
will probably remain on v1 forever (see e.g. nodejs/docker-node#1180 (comment) for some discussion about which version to ship in the officenode
Docker images)Describe the proposed feature.
Add some way of disabling the feature added in #9410. Probably some environment variable?
Describe alternatives you've considered
Disabling the plugin entirely. But I dearly love the aliases and completions, so that would be a shame 🙂
Additional context
No response
Related Issues
#10290, #10396
The text was updated successfully, but these errors were encountered: