I HACKED ShadCN to Create Insane React Templates and Installers

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 67

  • @nro337
    @nro337 หลายเดือนก่อน +9

    Love this original video idea!! cant wait to see this start popping up in repos everywhere!

  • @carlosricardoziegler2650
    @carlosricardoziegler2650 หลายเดือนก่อน +9

    Wow this is really game changer!!! I know the powerful from Shadcn but now this open big possibilities!! Amazing content

  • @stasgavrylov
    @stasgavrylov 7 ชั่วโมงที่ผ่านมา +1

    Versioning of this stuff may get tricky, but otherwise looks very interesting and promising! Thanks for the video.

  • @CelsiusAray
    @CelsiusAray หลายเดือนก่อน +1

    This is really awesome. It's better than creating a custom npm component. Thanks a lot

  • @furycorp
    @furycorp หลายเดือนก่อน +4

    shadcn takes copy and paste to the next level by saving the copy and paste part. thanks for the video!

  • @nyumat
    @nyumat หลายเดือนก่อน +3

    Learned something new! As always, thanks Jack!

  • @ramshankarchoudhary9448
    @ramshankarchoudhary9448 หลายเดือนก่อน +2

    nice! I am gonna create some of my own components
    Thanks for your research!

  • @JollyCoding
    @JollyCoding หลายเดือนก่อน +10

    Awesome tool, so many potential usages for easy getting started guides, tutorials and more.
    You don’t have to clone a demo now and copy the code over, they can just provide the registry to pop it straight into your project!

  • @amraromoro
    @amraromoro หลายเดือนก่อน +1

    I love your garden

  • @aj35lightning
    @aj35lightning หลายเดือนก่อน +8

    not the clearest video from a script editing. especially in all the auth trudging setup. would be helpful to frame what is about to happen in full so theres some anchoring in where we are in the narrative. the presentation of the information was all the same, even a quick excali of all the stages of what's being built and referencing where we're at now would help a lot. we see in contrast

    • @trejohnson7677
      @trejohnson7677 หลายเดือนก่อน

      stfu and just slap minified js into a field of a json object l0l

  • @fullzeroo5
    @fullzeroo5 หลายเดือนก่อน +1

    The video is great, thank you for your work. WorkOS is not bad, but I would like a video about self-hosting authorization solutions? Something easy peasy

  • @dave6012
    @dave6012 หลายเดือนก่อน +5

    Pretty cool stuff!
    Idk why it bothers me that you type `rm -fr` instead of `rm -rf` even though the flags are interchangeable and it’s functionally equivalent 😅
    More like, “remove fr fr, no cap” lol

    • @jherr
      @jherr  หลายเดือนก่อน +2

      I use them interchangeably. AFAIK there is no canonically correct way. This is one of those toilet paper over the top or under the bottom type situations. :)

    • @dave6012
      @dave6012 หลายเดือนก่อน

      @@jherr I 100% agree. Maybe it’s a generational gap (I’m old too, but relatively new to programming)

    • @cintron3d
      @cintron3d หลายเดือนก่อน +2

      `rm -rf` forever 😂

    • @Innesb
      @Innesb หลายเดือนก่อน +1

      @@jherr I’m going to be that guy. Research has shown that toilet paper over the top is more hygienic as the paper is less likely to touch the wall, and is less likely to require hand-contact with the wall. The wall next to the toilet is likely to be the most germ-ridden place in the bathroom other than the toilet itself.

    • @jherr
      @jherr  หลายเดือนก่อน +2

      @@Innesb Good thing I go over the top then!

  • @JuicyBenji
    @JuicyBenji หลายเดือนก่อน +1

    So I love this concept, and unlike most other commenters I do actually have a use case I see fit for this. However what I struggle to understand is how you created the json. You kinda quickly brushed over it, which I guess is fine because the video itself is more about exploring the possibility of doing it, rather than doing it. However I'd love to see how you set that up. As far as I gather, you created a tool or something you called "differ" or something which spat out usable json. Does this work with any code snippets you make? It looked like it was based on git or something, but I'm really lost at that step. Maybe I'm just blind but going to the github repo isn't really clarifying it further for me.
    Other than that, great video :D

    • @jherr
      @jherr  หลายเดือนก่อน +1

      It's an OSS utility called shadcn-differ. You run it with `npx shadcn-differ` and it compares the current state of the repo versus the initial commit. So establish your baseline with your initial commit. It should have shadcn installed. Then set up your code and run `npx shadcn-differ` and it will output the JSON to STDOUT.

    • @JuicyBenji
      @JuicyBenji หลายเดือนก่อน

      @@jherr So there is no easy way to keep working in the same project and only output the json for parts of it?
      Here I'm thinking imagine I made my own ui library, and I wanted to install it in the same fashion as shadcn. I'd like to just have all the components I make live in the same repo, but now in order to use this tool, I'd basically have to create a dummy repo each time I'm updating or creating new components, where I copy them into the dummy repo, then run the differ.
      It would be cool if I could just run the cli in a way where I could specify which component I want to generate the JSON for and it just does it, and base it on the structure that exists for that component already. One could even imagine this step being run when building your site, (ie the component documentation site), so that as an author you just need to worry about the components, then the json output will always be built and deployed alongside your changes.
      Obviously I don't know why this CLI is using git for reference, I'm sure there is a very good explanation, I just wish it would be a lot easier, granted this is a lot easier than creating the json yourself, but still. I feel like there is room for improvement.

    • @jherr
      @jherr  หลายเดือนก่อน +1

      @@JuicyBenji I can see why it fits your use case. You can create any tool you want and build the JSON file however you choose. You just need to look at the JSON format and try it out for yourself.
      The tool I created and OSS'ed does it this way because that fits the model of infra teams in companies or SaaS providers. Those teams are looking to help folks set up projects with everything they need all wired up. So, you start with a baseline, set up the project, and then you create the JSON file with the delta between the two.

  • @AlexanderBelov-y8o
    @AlexanderBelov-y8o หลายเดือนก่อน +2

    I've created the components for my form with v0. Crazy how good quality code it generates. Saved me an hour.

    • @nickwoodward819
      @nickwoodward819 หลายเดือนก่อน +2

      Honestly think v0 is crap. Frequently fails on simple components. When it does get something right it tends to just be generic shadcn, which you can do manually to avoid having all your code in one massive block

    • @trejohnson7677
      @trejohnson7677 หลายเดือนก่อน

      @@nickwoodward819brother i fucking hear u. I can’t get it past 500 lines

    • @AlexanderBelov-y8o
      @AlexanderBelov-y8o หลายเดือนก่อน

      @@trejohnson7677 why would you want an 500 line component, lol. This is not a magical tool that will create anything for you.

  • @ArjunShankar1
    @ArjunShankar1 หลายเดือนก่อน +1

    Great video Jack and very innovative way to use ShadCn!
    I am curious if this were to be used in a production context, do we know at all if this so called 'hack' is likely to be supported in the future by the ShadCn team?
    Since the thought of building a future set of whitelabelled UI for multiple clients with the various .json files would be compelling, but would be awful if ShadCn deprecates support for this (if its thought of by them as an unintentional workaround) 😅

    • @jherr
      @jherr  หลายเดือนก่อน +1

      The JSON support will be there, but it's possible the format may change, right? It's not an official contract. So I'm asking the ShadCN folks to roll the differ into the CLI so that it can be all maintained together and folks can depend on the format.

  • @electroheadfx
    @electroheadfx หลายเดือนก่อน +1

    you are great ! amazing tool you made ! thanks I love the concept (btw Pro-nextJS is amazing). A quick question: would like it possible to update a json setup based on some changes applied after the initial creation ?

  • @brayanjpm
    @brayanjpm หลายเดือนก่อน +1

    Innovation from Shad

  • @shahreazneeloy2119
    @shahreazneeloy2119 หลายเดือนก่อน +1

    just amazing stuff

  • @Technology_Forum
    @Technology_Forum หลายเดือนก่อน +1

    Which extension are you using to highlight part of the code in vs code during your presentation

    • @jherr
      @jherr  หลายเดือนก่อน

      None. That's completely manual in post.

  • @Technology_Forum
    @Technology_Forum หลายเดือนก่อน +1

    can you provide the configuration for the terminal it looks so good what theme are you using

    • @jherr
      @jherr  หลายเดือนก่อน +1

      Here is the .oh-my-posh configuration. gist.github.com/jherr/2266b85556b8f8dc65c4e0e512f62ed7

  • @techknowledgebase4504
    @techknowledgebase4504 หลายเดือนก่อน +1

    Awesome feature

  • @khoinguyen-ft2ys
    @khoinguyen-ft2ys หลายเดือนก่อน +1

    Awesome!

  • @Technology_Forum
    @Technology_Forum หลายเดือนก่อน

    Which terminal are using is it kitty and what configuration you have made to look the prompt so nice and also with your cursor terminal

    • @jherr
      @jherr  หลายเดือนก่อน

      It's oh-my-posh with a custom configuration. gist.github.com/jherr/2266b85556b8f8dc65c4e0e512f62ed7

  • @littleluce
    @littleluce หลายเดือนก่อน

    Can this tool work if I want to run codemods also? I've been working on a similar idea for a more niche tech stack, but I would love to leverage this shadcn tool instead if possible

    • @jherr
      @jherr  หลายเดือนก่อน

      Not as it is, no. I suppose that could be a possibility. I had to PR the CLI to make this tool work and they were very receptive to the PR.

  • @hectoraldairaguilarhernand6556
    @hectoraldairaguilarhernand6556 หลายเดือนก่อน

    Hey! Can somone explain to me why is this different from just cloning a repository with all the code you want to share?

    • @jherr
      @jherr  หลายเดือนก่อน +1

      Cloning the repo would give you static versions of all of the dependencies. You'd need to keep the repo up to date with versions. Also, cloning the repo has no way of adding code to an existing repo, this method supports that.

    • @cintron3d
      @cintron3d หลายเดือนก่อน

      @@jherr wait updates too? What happens if I rename, edit, or move one of the files? Feels like we need another video covering real world workflows. Getting started is nice for copy paste but what happens after that? So far this feels like an anti pattern.

    • @jherr
      @jherr  หลายเดือนก่อน

      @@cintron3d Is this more of a critique of ShadCN's copy/paste mechanism in general, or this additional functional of have externally supported JSON templates? Because it sounds like a critique of ShadCN's copy/paste. If that's the case I'd recommend that you look at the files that ShadCN is pasting into your project. They are very small. It's usually 5-10 lines that brings in a headless libraries then creates a component that styles the headless components. Which is what you'd have to write for yourself if you didn't use ShadCN.
      The reason it's pasting the code into your repo is that you are encouraged to change it. Want to change the border radius on the button? Just change it in the file. You don't need a theme provider because the theme is in the implementation of the components. That may or may not be to your liking, but it's a reasonable approach to using headless components.
      As for moving the files, I'm not sure why you'd do that. You can move the files if you want, but you'd need to update the components.json file to point to the new location so that the next time you used `npx shadcn add ...` they would go to the wrong place. If you just moved around the files arbitrarily you're basically opting out of ShadCN.

  • @cintron3d
    @cintron3d หลายเดือนก่อน

    Why do this instead of fork/copy from another repo?

    • @trejohnson7677
      @trejohnson7677 หลายเดือนก่อน

      ur gunna use git clone for one file lol. u should see whats under the porcelain guy.

    • @cintron3d
      @cintron3d หลายเดือนก่อน

      @@trejohnson7677 if it's one file I click view raw and copy paste. Hardly need all this infrastructure for that.

    • @cintron3d
      @cintron3d หลายเดือนก่อน

      @@trejohnson7677 no I would copy paste one file lol
      How does this handle merging into existing repos, updates after the original files have been moved or modified. This comment section is so hyped on the fact that we can do this and not talking about if we should do this.

    • @trejohnson7677
      @trejohnson7677 หลายเดือนก่อน

      @@cintron3d i mean, it's additive. I suppose if you had the exact same file under the exact same path, then you'll overwrite it. oops. git restore. it seems to me once you slap up your components, you're good to go. frankly there's specific tooling for this, such as nx generators, or bit's module federation, but as someone who works w/ both, i can say just slapping junk into json will get the goddamn job done.

  • @blarvinius
    @blarvinius หลายเดือนก่อน +1

    Woah. What have you done? 🧠

  • @dellanmuchengapadare3792
    @dellanmuchengapadare3792 หลายเดือนก่อน

    Interesting. might get tricky if you the component want's to apply certain changes to a file instead of overwriting the whole file.

    • @jherr
      @jherr  หลายเดือนก่อน

      Yeah, that's problematic. Might be nice to have a patch option with a fall-back to a complete overwrite?

  • @Lemmy4555
    @Lemmy4555 หลายเดือนก่อน

    how is this better than npm create ?

    • @jherr
      @jherr  หลายเดือนก่อน +1

      Because it can be applied to existing projects as well as creating new projects. In the Vite example it's applied to an existing project.

  • @rayanfernandes2631
    @rayanfernandes2631 หลายเดือนก่อน

    That's some cool stuff, but Linux devs be like , isn't that what Git patch is for ?

  • @greendsnow
    @greendsnow หลายเดือนก่อน +1

    Erm... What happened to git clone

    • @cintron3d
      @cintron3d หลายเดือนก่อน +1

      Right? Why would I go to this much trouble to create a JSON file when I'll need to maintain a clone-able getting started project anyway?

    • @jherr
      @jherr  หลายเดือนก่อน

      Well, no, you have a reference project. But the JSON that it creates is version-less, and it can be used to add to an existing project as well as create a new project, which is something a clone can't do.

    • @cintron3d
      @cintron3d หลายเดือนก่อน +1

      @@jherr Merging into an existing project is novel. Still, I'm struggling to see where this would be practical. It's a paradigm shift from adding a dependency, to merging in some code that you will have to own from here on out. I already do this in special cases but don't want that to be the norm.

    • @jherr
      @jherr  หลายเดือนก่อน +1

      @@cintron3d This is just an extension of `npx shadcn add carousel`. To support carousel ShadCN needs to bring in a dependency on a headless carousel. So if you had your own carousel component you can now say `npx shadcn add raw.github.com/you/carousel/shadcn.json` and it will import your carousel code with any dependencies you need. Now that's just an example for a carousel. That could be anything. It could be a simple component like a carousel, or it could be something bigger like an auth provider, or instrumentation, or analytics. But the basics are the same, here are some dependencies, here are some files, integrate them into the app. And ShadCN takes care of putting them in the right place, and in the case of `add` warning the developer when they are about to overwrite files.
      As far as to whether it's practical, if adding components is practical, then this is too. And I definitely think we'll be seeing design systems and infra teams go in similar directions. Maybe not identical with this. But I can definitely see MUI, as an example, having a UI builder on their site and then having a CLI tool similar to this to bring those designs into an app. And the mechanisms would need to be roughly similar; here are the dependencies, and the files, etc.

    • @greendsnow
      @greendsnow หลายเดือนก่อน

      They could have just published the additional component code like aceternity or magicUI does + npm install requirements.
      Wrappers around wrappers... this is what we're getting

  • @trejohnson7677
    @trejohnson7677 หลายเดือนก่อน +1

    2bad you have to click retry 10k times2 work w/ v0.

    • @jherr
      @jherr  หลายเดือนก่อน

      Hahah, yeah, I noticed that, I was "in line" with V0 for like an hour and a half once.

    • @trejohnson7677
      @trejohnson7677 หลายเดือนก่อน

      @@jherr it just doesn't make much sense to me how they can't sit down and figure out incremental functionality for the damn thing. v0's got to be a net loss for them.