-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Why yarn? Any chance pnpm could eventually be supported (in the name of saving disk space)? #2907
Comments
@matronator Yup, there is no explicit reason, other than we have some technical debt that we've been cleaning up. We're getting there! @dac09 Could we run an experiment on the RedwoodJS project side to see if it's possible? |
We use Yarn for Yarn Workspaces. NPM did not support Workspaces until recently, which may mean we can switch in the future. General FYI: I did an experiment two weeks ago using Yarn 2 with the Redwood Framework — even without pnpm there were major breaking changes and substantial behavior changes to dependency management and resolutions. Importantly, they are handling Workspaces differently in 2. Nothing a dealbreaker, but it did make me inclined to wait for Yarn 3 GA before re-evalutating. |
If we decide to move forward with Yarn 3 we should take a look at what a migration to |
StackBlitz also teased their own package manager; they haven't released it yet (I'm assuming they will one day)—just another one to consider. |
Early days, but NPM v7 might be a case similar to Yarn v2 in regards to some big, fundamental changes. Hot take. Needs verification. |
Correct, I ditched npm v7 and started using Yarn 1 because of the breaking change in v7, just do not want to use that --legacy-peer-dep arg. 😂 |
Yarn 3 announcementGrist for the mill
|
From Maël, lead Yarn maintainer:
|
Interesting. I'm curious about taking this for a test run. Although I have strong doubt about this quote in particular --> "Even for Yarn 1 users, migrating from 1 to 3 should be easier". Lerna and Yarn Workspaces got into a fight when I tried to upgrade to v2 for a POC. Overall, this feels like good news. I just think it's going to take about 6 months to see where the ecosystem lands in terms of support. E.g. even if we upgrade to Yarn v3 for the framework, will projects using v3 have build support on Netlify, Vercel, Render, etc... |
I'm trying to get to the point where we don't dictate the package manager for Redwood projects. My goal is that we create single binary that encases the build and design time packages. The user will only install the run-time packages: express, react, apollo-graphql, etc. Then we don't have to rely on workspaces and a user is free to use whatever they prefer as a package manager. A bunch of added advantages: crazy fast installations. |
You can use You don't need to wait for ecosystem to be ready for Yarn 3 if you will continue to use |
Hi @larixer! Thank you for jumping in here. These all sound like great benefits. Definitely want to look more into understanding I did use node_modules in my attempt to upgrade to Yarn v2 in our Framework monorep. What I discovered was a lot of emerging resolution issues, likely due to improvements that revealed issues we've had along. More importantly, our use and setup of Yarn Workspaces threw a lot of errors and broke the scripts/tools we have in place. If you're curious (and have time for some suggestions), take a look at our scripts in the project's root package.json here: Lines 24 to 38 in d9d3852
Overall, it felt like there was a path forward. Just not a clean one. But know I'm motivated to give Yarn v3 a trial run in the near future! |
Yes, I'm curious and willing to take a look. I am not sure what I'm looking at, you referenced one commit and I don't understand what exactly have you tried to do and what problems have you faced? Do you have some Pull Request where you have tried to migrate to Yarn 2 with description of problems you faced? Alternatively are you comfortable to pop on our discord: |
Well, look at that "Upgrade Framework to Yarn v3" #3154 😉 |
@matronator thank you for your patience while I hijacked this issue to resolve one of the tech debt issues! Now back to focusing on your original question:
Now that the Framework is using Yarn v3, we have identified the outstanding issue(s) to resolve in order to use Yarn v3 in a Redwood project. My assumption is that we need to resolve the same issues to be able to use pnpm (instead of Yarn) for a Redwood Project. See: @jtoar is going to take a look at requiring the dependencies (and therefore binaries) correctly within our CLI Package. Any/all help would be appreciated, including results from testing pnpm with a fresh Redwood Project. No pressure. |
@thedavidprice No worries 😉 Okay, I tried running the tutorial with pnpm instead of yarn and got stuck trying to run the project. I ran into similar scoping issues with Anyways, running
It failed on the Click to show the full output
So I tried running But then I couldn't figure out how to run the project without Yarn as pnpm couldn't reach down the tree for the "redwood" command when trying |
@matronator thank you for trying this out and reporting back here! I think your experience verifies what we've been assuming is the next steps on our end:
I'm not sure if there's a path forward directly from a project, unfortunately. |
Is this something being looked at, especially with Bun making it to 1.0? |
Also here because of Bun 1.0, would love to finally escape the slow installs of yarn and npm, ref oven-sh/bun#4207 and Bun - a fast all-in-one JavaScript toolkit for more info, integration seems blocked on changes here and it's been nearly two years since a substantial update :( |
When Bun, as a runtime, can support full node compatibility and, for example, work with Fastify and Pino, it would be very interesting to explore running Redwood on Bun. As of this time, I'm unsure how Bun could even be used to run Redwood's dev server (Fastify and Vite currently). There's a lot to like about Bun. And I hope it pushes the ecosystem in the right direction. But given that Redwood already solves, out of the box, the challenges of toolchain integration, I'd be curious to better understand what it is that is currently of high enough value to make a swap? And, additionally, if you're aware of what those tradeoffs might be? If you're about to answer "performance", please do take a look at this excellent writeup by @mcollina: Here's an important excerpt:
And, it also just so happens that Yarn 3 is as performant as pnpm (I know, right? Who knew 🤷♂️): I know Node performance has been lagging, but I'm very optimistic about Node 20. And I'm very hopeful that Bun will further push Node's overall performance roadmap: 🚢 Shippers Gotta ShipLastly, I get that Redwood simply might not support the tools you want to use. Or, frankly, support you easily swapping out tools you use when you want to. There are a lot of things we could to better to this end. But we choose not to. For one reason, we build with Redwood and we've chosen to accept good enough. For a more important reason, we're investing our limited time and resouces in shipping innovative new features instead of futzing around with tooling. ('Cause, frankly, it's a lot more interesting and we don't really like futzing around with tooling even though we signed up for it as framework authors.) New Features: Redwood Realtime and Mailer + StudioIf you haven't checked out v6.2 yet, I suggest you do because I hope you'll get excited about Redwood Realtime and Redwood Mailer API + Studio integration. React SSR, Streaming, and Server ComponentsWe have an experimental version of Redwood SSR + Streaming that's availble. And we created a very fun production app that runs on Fly.io, using Neon.tech Postgres, with Resend.com for emails. You can learn more about that here. Lastly, we're well into being the second major framework to suport RSC, which you can try as an experimental feature today. These are the things that are important to us, along with the other items on our Bighorn Epoch roadmap: redwoodjs.com/roadmap This priorities might not resonate with you and your requirements. I totally get that. But if they do resonate, Redwood is an open source project for a reason — we welcome and would love your help! 🤗 |
Thanks @thedavidprice for the thorough response, anything is better than nothing when it comes to longstanding open issues. I'll admit I'm no expert here--I got through half the Redwood tutorial when it was v2, that was 6+ months ago. I was impressed. Bun obviously has some catchy graphs advertising speed and a low-level language behind it that makes those claims almost believable, but I haven't built anything with it yet. I was asking more out of curiosity and hope than anything grounded. Thanks for clarifying your position here, it makes a lot of sense that the goal of Redwood is basically to be "Bun + backend," and I think you guys are doing a great job. No need to support Bun, really, just wanted an update on this issue in general, and you provided that 😄 |
I would love to bring my personal point of view here if that's ok I think both pnpm and Bun are awesome!! It was easier for us to support Bun thanks to the fact we are building based on standards and @ardatan's great library @thedavidprice about the article you shared from Matteo - Its true that Bun is not 100% compatible with Node, but I'm not sure it has to be in order to be used for the use case we want Fastify and Pino for. The Guild has an HTTP framework that works with Bun for a couple of months now, and we are definitely not the only ones.. Also, Bun install speeds is really not the only or main benefit for us - we've seen crazy gains on runtime performance of our gateways (both GraphQL and HTTP) when using bun in our famous benchmarks. By the way, on that actual topic, The Guild has moved all of our libraries to use pnpm a while back and would love to support if you want to go aheads with that transition. I guess my main point - the developer doesn't need to become a prophet and knowing who wins in the future. Lastly - I don't think the defensive position maintainers are taking is looking at the feedback in the right way. Looks ilke there are some discussions happening on my Twitter comment about that... |
FWIW: Yarn is a full stop no go, can't use it. I am passing on Redwood due to inflexibility in allowing the user to decide on what to use. I can't even check it out due to the need for yarn. |
@AddictArts Absolutely hear you. The ability to pick a package manager is something that we'll make happen. |
I looked (okay, not that hard, but I definitely didn't see it mentioned in the tutorial), but couldn't find an explanation of why is yarn a requirement? Can you please clarify to me, why yarn?
I primarily use pnpm as my package manager, mostly because I'm slightly worried about my 8 years old MacBook's internal SSD running out of lifecycles due to excessive
npm install
garbage. And yarn isn't much better in this, it installs just as much garbage as npm. So anyways, onto my second question:Is there any possibility in the future, that npm/pnpm would be supported as well and not just yarn?
Thank you!
The text was updated successfully, but these errors were encountered: