Why I’m using a monorepo with Yarn workspaces

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024
  • 💬 Discord / discord
    🔔 Newsletter newsletter.web...
    📁 GitHub github.com/web...
    📺 Twitch / webdevcody
    🤖 Website webdevcody.com
    🐦 Twitter / webdevcody

Комментарии • 53

  • @prasanthrv4850
    @prasanthrv4850 Год назад +18

    Hi, I just love your unscripted, no flashy clickbait thumbnail kind videos, always get to the point, great stuff 💛. Would like some videos on your thoughts about contributing to open source and how to get started, etc., or is it necessary to get a remote job. Anyways love your videos, keep going 🔥

    • @ethisfreedom
      @ethisfreedom Год назад +2

      he’s been one of my favorite source of information related to web development or development in general. He never clickbaits only sometimes with title of video but its for SEO afaik.

  • @hsider
    @hsider Год назад +2

    This is cool, without you I wouldn't know this exists. I had a question in my mind for a long time on how to couple my project parts/apps in a single git and here you are :). Your videos are like going into the local bakery and see bread being made, that's what makes your channel unique. 👍

    • @WebDevCody
      @WebDevCody  Год назад +1

      Haha i like that analogy!

    • @hsider
      @hsider Год назад

      @@WebDevCody hhh happy that you like it. It's a signature of your channel, may be you don't know it, that's how I and other people see it.

    • @WebDevCody
      @WebDevCody  Год назад +2

      @@hsider it’s the vibe I’m going for. One of the best way to learn how to code is to actually watch someone code; obviously coding yourself is the best way

    • @hsider
      @hsider Год назад +1

      @@WebDevCody exactly! Add to that what dev channels on RUclips do is promoting simple stuff to make money it has nothing to do with development 😆 it's addressed to new programmers. Most of your viewers are actually old and good developers, they're interested in seeing what and how others do real projects where every aspect is important.

  • @meganfrankosky351
    @meganfrankosky351 Год назад +3

    I'm just getting started with yarn and building a monorepo structure and this overview was super helpful! I'd love to hear what snags you ran into along the way and your take on if it's worth it in the long run.

  • @notarealhandle123
    @notarealhandle123 Год назад +1

    From my experience, the main challenge I faced - building the server, because after adding monorepo I ended up with the server code that I no longer could just copy over to my hosting provider via FTP, since it now had a dependency on my local "shared" repository. I needed to add bundling that would make "shared" code part of the server's PROD build. That's the major downside to monorepos.

  • @JegErN0rsk
    @JegErN0rsk Год назад +1

    Looking at your videos there is clearly so much more to being a web developer than just React for the frontend and Java/C# or whatever language for the backend. Can you make a video talking about the "unspoken" tools and tasks that are expected of each end of the stack?

  • @gordonfreimann
    @gordonfreimann Год назад

    highly useful, very informative. Thank you

  • @medalikhaled
    @medalikhaled Год назад

    Thanks for sharing, your content helps a lot

  • @anasouardini
    @anasouardini Год назад

    do I need to use workspaces if I'm using pnpm?
    I don't know that much about workspaces bu from what you've said seems like it's used to save disk space.

  • @aleksandrszagorskis3306
    @aleksandrszagorskis3306 Год назад +1

    Hey, mate! Great video. Can you share what VSCode theme are you using?

  • @amitsingh5198
    @amitsingh5198 Год назад

    Great video. I also had trpc not importing types when using in pnpm wokrspaces but the issue was that we have to install trpc/server in the client package as well for types to work. Now I have trpc as separate package and types work correctly

    • @WebDevCody
      @WebDevCody  Год назад +1

      I’ll have to try that out, maybe that’s all I needed. Nothing wrong with rest either; it’s still the dominating approach to client server communication, but I do miss my tRPc on this project a bit

  • @anthonygg_
    @anthonygg_ Год назад

    Nice vid Cody!

  • @hnnazm
    @hnnazm Год назад +1

    When you upload the code to version control, do you upload each of the workspace into separate repo and linked it by submodule? Or just in one repo?

    • @WebDevCody
      @WebDevCody  Год назад

      They are all in the same repo

  • @anhibitor1023
    @anhibitor1023 Год назад

    Keep up the amazing content

  • @OleksandrKucherenko
    @OleksandrKucherenko Год назад

    Is it possible to setup with Yarn 3.5 PnP mode and ts-node as a major executor of the code in developer mode?

  • @monawwarabdullah7438
    @monawwarabdullah7438 Год назад +1

    Which icon package is it?

  • @charliesta.abc123
    @charliesta.abc123 Год назад +1

    Lol this is what I was busy trying this today. Everything works but now I'm trying to rip out my prisma stuff into it's own package. I'm not winning. Typescript is showing me flames. I don't even know if this is something I should do

  • @berkesandras
    @berkesandras Год назад

    Nice video @WebDevCody! One question came in my mind - how do you deploy the API package individually as they have common dependencies in a shared node_modules folder?

  • @VincentJenks
    @VincentJenks 10 месяцев назад

    Interesting, thanks for posting this. I've been making the rounds, trying to build the perfect boostrap/prototype DX for a fullstack serverless + React application, in a basic monorepo. The issue I've run into so far, is the hoisting of node_modules to the top level of the repo. It seems to break any shared references in the lambda functions, since it can't deploy what isn't directly available inside of the lambda portion of the repo. I'm turning to Yarn now, as a last-ditch effort, because it seems to be the only pkg manager that allows "nohoist", and allows you to physically divide node_modules to the various project/package folders within the monorepo. I don't care about disk space, I just want shared code to work within my lambdas! Any thoughts on that?

  • @peevable
    @peevable Год назад

    Hi WDC, do you code on windows or linux or mac (or maybe some sort of linux VM)? I can't really tell since you hide a lot of your screen.

  • @lacherolachero9409
    @lacherolachero9409 Год назад

    I have hard time to understand how all this beauty works in prod?
    How to you compile the needed imported packages and run everything using Docker?

    • @WebDevCody
      @WebDevCody  Год назад

      Well usually you’d have library packages which would be imported when you bundle next or your ui or api. That bundle would have all the code needed which you could run inside a container

  • @notarealhandle123
    @notarealhandle123 Год назад

    A good practice for monorepos is not to use specific package names in workspaces, but rather use "packages/*". The reason is to be able to deploy packages only as needed. For example, you want to deploy a server - you copy just the server + shared packages, then you can run the root install successfully, and it won't be looking for "client" package on the server, whereas in your approach it will.

    • @marqetintl
      @marqetintl Год назад

      Care to expand on this pls? By "copy" i'm guessing you're referring to docker but I still fail to understand how this would be helpful. Or maye you meant "workspace:^" instead of "packages/*"

  • @JohnZakaria
    @JohnZakaria Год назад

    Do you have good reasons to why aren't you using yarn berry?

  • @amranimohamad4741
    @amranimohamad4741 Год назад

    yo , what 's the Packege manager that ur gonne stick with for the future I've heard that Pnpm is more effiecient then npm what would you say about it ???

    • @WebDevCody
      @WebDevCody  Год назад

      No clue, I think you can randomly pick one and the world will keep turning

  • @SeibertSwirl
    @SeibertSwirl Год назад

    Good job babe!!!!!

  • @midosobhy2922
    @midosobhy2922 4 месяца назад

    what is the name of this vscode theme ?

    • @WebDevCody
      @WebDevCody  4 месяца назад +1

      bearded theme stained blue

    • @midosobhy2922
      @midosobhy2922 4 месяца назад

      @@WebDevCody thank you

  • @shreerajshiramoji4488
    @shreerajshiramoji4488 Год назад

    Nice one

  • @oussama40612
    @oussama40612 Год назад

    Why do use ts node to run a .ts file instead of compiling it

    • @WebDevCody
      @WebDevCody  Год назад +1

      It’s faster than waiting for the entire thing to compile and then you’d need to cd into the dist directory to run the js

  • @Hiperultimate
    @Hiperultimate Год назад

    Hi Web Dev Cody, I thought of checking out this project of yours and after getting overwhelmed by the sheer amount of stuff you used a question came in mind. How did you know that which technology you have to use and why? And did you learn those technologies before using or just read the docs and did the bare bones? It would be really great if you could reply.

    • @WebDevCody
      @WebDevCody  Год назад +1

      Yeah it’s a lot, and I learned most of this over years on the job. It’s better to just pick Nextjs and deploy to an existing provider if your starting off or have a small team. Docker is just a bonus. Yarn is just npm with slightly different commands. Terraform and serverless are IaC tools you’d only need if you like doing things the hard way in AWS. GitHub actions are only if you need a ci pipeline.

    • @Hiperultimate
      @Hiperultimate Год назад

      @@WebDevCody I see.... First off thanks for the reply! I am learning NextJS at the moment as my current job refuses to give me anything other than testing for some reason even though they took me as a dev. They are working on a platform called ServiceNow which is not so good to work with. So I thought id take matters in my own hands and keep doing what I like. I hope one day I would be as good as you so I can confidently do my work and play games in my free time :D

    • @WebDevCody
      @WebDevCody  Год назад +1

      @@Hiperultimate you’ll get there. It stinks your company doesn’t let you do other things, but testing is good to learn

  • @anuragpramanik6095
    @anuragpramanik6095 Год назад

    Are you using yarn v2?

  • @Alan910127
    @Alan910127 Год назад

    Have you ever tried Turborepo? It seems that it works with yarn/npm/pnpm workspaces, and adds some additional ability to them. I would like to see you make some videos about that.

  • @055David
    @055David Месяц назад

    hmmmmmmmmm, not that valuable, can find this in most docs, should focus more on issues you faced, and not how to achieve what most ppl can set up following the worst stackoverflow comment. Camera quality is good though!