How UI Frameworks Actually Work

Поділитися
Вставка
  • Опубліковано 13 гру 2024

КОМЕНТАРІ • 100

  • @alexanderxin
    @alexanderxin Рік тому +138

    Hi there, VanJS author here. Thank you so much for this awesome video. It's incredible that all of the main logic of VanJS is explained so well in this video within 7 minutes! Thanks for spreading the good words!

    • @awesome-coding
      @awesome-coding  Рік тому +12

      Hey!
      Thank you for your work on this! It was really inspirational to look into Van's codebase. You were able to achieve a lot with just a few lines of code. Really great stuff!
      Thanks for the donation!

    • @boomshakalaka656
      @boomshakalaka656 Рік тому +2

      Dear VanJS author, would you recommend anyone to build a portfolio or semi advanced project (not counter or hello world toys) with VanJS. And also do you have any plans to add a DSL like JSX or maybe the goal of the project to create a foundation for people to then add features on top?

    • @riscnx
      @riscnx Рік тому

      @@boomshakalaka656 I guess you are looking for SolidJS.
      I believe VanJS is something comparable to jQuery, but it makes things reactive.

    • @alexanderxin
      @alexanderxin Рік тому

      ​@@boomshakalaka656Yes, there are lots of sample apps you can find in the website. There are 3rd party add-ons for JSX support.

    • @awesome-coding
      @awesome-coding  Рік тому +4

      @boomshakalaka656 Yes, there are lots of sample apps you can find in the website. There are 3rd party add-ons for JSX support. (this comes directly from Tao Xin, VanJS's author).

  • @StiekemeHenk
    @StiekemeHenk Рік тому +47

    Omg I love this!
    The difference between a good programmer and a great programmer is his understanding of the tools he's using.
    And this is exactly what I've been looking for.

  • @Niksorus
    @Niksorus Рік тому +8

    Such a clean and beautiful project. Thank you very much for covering this!

  • @greidinger-reis
    @greidinger-reis Рік тому +66

    Impressive. Very nice. Let's see Paul Allen's framework

    • @awesome-coding
      @awesome-coding  Рік тому

      Spot on! :))

    • @awesome-coding
      @awesome-coding  Рік тому +27

      Paul Allen's framework - Solid JS, impeccable reactivity, lightning speed, oh my god.. it even has a meta-framework...

    • @vaisakh_km
      @vaisakh_km 6 місяців тому

      @@awesome-coding Something wrong? patrick, you are sweating...

  • @deku_nattsu
    @deku_nattsu Рік тому +2

    Definitely going to try this framework, well done on the explanation

  • @AbhinavKulshreshtha
    @AbhinavKulshreshtha Рік тому +15

    This video reminds me when I saw the source code of wordle for the first time. It had ui components, animations, state, storage, game logic, and a lot more in just a few lines of code. 60% of js file was just the word array for the game. I think actual code was under 200 lines.

  • @mohamedaalabou6859
    @mohamedaalabou6859 Рік тому

    Super good video as always ! Waiting for Awesome merch to drop by this point !

    • @awesome-coding
      @awesome-coding  Рік тому +1

      Haha, maybe one day! Thanks for the kind words!

  • @gabrieljose7041
    @gabrieljose7041 Рік тому +3

    Very good video! And it reminds me of a project I made, I'm not a front end developer, but I created a very similar lib to use in my personal projects, it's called lithen-fns and it uses a tagged function approach inspired by lit-html

  • @crab-cake
    @crab-cake Рік тому +6

    i like projects like these. we need to promote them more. strawberry js is also interesting but i think this is more suitable to building real apps.

    • @awesome-coding
      @awesome-coding  Рік тому

      Strawberry's codebase seems to be way bigger compared to this one 🥲😅

    • @crab-cake
      @crab-cake Рік тому

      @@awesome-coding much larger but smaller than solid and the other frameworks

  • @ashleyfreebush
    @ashleyfreebush Рік тому

    Amazing video, you are getting better

  • @oath_2d
    @oath_2d Рік тому +2

    I love seeing library code it always intresting

    • @awesome-coding
      @awesome-coding  Рік тому

      Same here - VanJS is a really interesting case study due to its small size

  • @lolwingding
    @lolwingding Рік тому

    Can we call proxy as actor? Does it share similarity with message passing patterns like actors, microservices talking via pub-sub, processes talking using d-bus?

  • @TechBuddy_
    @TechBuddy_ Рік тому +1

    Yoo the effort you are putting in is amazing. I am loving the new style of videos ❤. Keep going but IDK if a lot of people would watch these videos though

  • @archmad
    @archmad Рік тому

    i've seen this implementation before. the wheel of time

  • @pauljohnsonbringbackdislik1469

    Although van.js is arguably pretty in how it employs 133 LOC to make 60% of work that we expect from typical UI framework... it becomes impractical choice if even smallest website requires Google Analytics, custom fonts, carousel, lightbox equivalent gallery viewer and contact from. I know you can get around this by trimming and selfhosting fonts, using Plausible for tracking and custom implementation for essential functionality, but does the audience know as well? :) Just and idea for a future video.

    • @awesome-coding
      @awesome-coding  Рік тому

      Good points! Thank you for the suggestion!

    • @pauljohnsonbringbackdislik1469
      @pauljohnsonbringbackdislik1469 Рік тому +1

      Advanced topics worth covering if you'd ever plan any deep dive:
      - comparing pieces of Van.js to Vue/React/Angular to get an idea for "why the bloat exists" because it is not entirely useless
      - augmenting Van.js with fancy logger to have "your own logger" as there are no extensions for DevTools - hence debugging web app could become nightmare
      - full stack of tools for minimalists... could we (devs) be productive with Bun, Van.js, Supabase or some KV store, etc.?

    • @awesome-coding
      @awesome-coding  Рік тому

      @@pauljohnsonbringbackdislik1469 All really great ideas! I especially like the "minimalist" angle. Will add these in my queue. Thanks so much!

  • @nark4837
    @nark4837 Рік тому

    what did you use to generate the code block and animate it?

    • @awesome-coding
      @awesome-coding  Рік тому +1

      Hey! This was made in Premiere Rush with some assets created in Photoshop and Illustrator.

    • @nark4837
      @nark4837 Рік тому

      nice job! the code block designs look awesome!@@awesome-coding

  • @namaefumei
    @namaefumei Рік тому

    Alright! We got a new one lol. Great video thanks!

  • @captsiro233
    @captsiro233 Рік тому +1

    Pretty good video. Great take on the frontend library but I would hate to maintain this library. The code style makes it unreadable and confusing. I would not mind working with it thou.

    • @boomshakalaka656
      @boomshakalaka656 Рік тому

      Ohh here you are actually sharing your true opinion 👀

    • @captsiro233
      @captsiro233 Рік тому +1

      ​@@boomshakalaka656 I'm talking about maintaining the library as of the 150ish lines of code and not about working with the library. I personally wouldnt mind creating something with it.
      I'm sorry, if my writting skills gave you the wrong impression of what I was trying to say. I will try to correct it immediately

    • @awesome-coding
      @awesome-coding  Рік тому +2

      Yep - the code is compact and sometimes confusing due to the focus on making it as small as possible.
      You could easily make it more clear, but you'll spend some bytes doing so :D

    • @alexanderxin
      @alexanderxin Рік тому +2

      Hi @captsiro233, VanJS author here. I chose a concise style while writing the VanJS code as this is the style I like the most. In the context of corporate programming I have to follow the styling rules that are decided by the org. I understand some styling choices in VanJS are controversial, but since it's a personal project, I decided to just follow my heart on styling instead of trying to guess what styles the world likes the most.

    • @captsiro233
      @captsiro233 Рік тому

      @@alexanderxin I'm sorry if my comment was too harsh. By all means use the coding style that you want. It's just that if I had to work in a codebase like this it would have been really difficult because I like more robust style:
      - using a lot of blank lines to separate code into logical blocks
      - using full names for variables (string instead of s or str and so on)
      ...
      Still pretty insane that you made it so small

  • @boomshakalaka656
    @boomshakalaka656 Рік тому +5

    I would like someone to try to make a semi advanced project with this (not a hello world or counter app) and share with the world if the DX cost was worth it.

    • @boomshakalaka656
      @boomshakalaka656 Рік тому

      Imagine making an e-commerce, blog or even portfolio with this. 😂😂😂. Thanks @Awesome but lm skipping this one😖

    • @HeWhoShamesNarwhals
      @HeWhoShamesNarwhals Рік тому +2

      It depends on how the development cost of producing something with a mainstream framework like react is calculated. If you take someone who knows JS but not any framework, I'd wager that they'd be quicker with Van than React or Svelte simply because it's so much simpler, you don't need months of tutorials to get to a place where you can build an app and can't say how it works.
      If you're already an existing frontend dev, then it's not gonna come up directly, but knowing how your tools work is part of being a senior. I've met dozens of React devs and only 1 could ever explain how React actually worked.
      As for e-commerce, blog or even portfolio with Van: there's literally no problem with that, what are you implying?

    • @boomshakalaka656
      @boomshakalaka656 Рік тому +1

      ​@@HeWhoShamesNarwhals Sorry by DX l'm taking about Developer Experience not development cost (sometimes the relation is proportional, but they are 2 diff things).
      By DX cost I'm mainly talking about things like 1) how fast can you build something (not a hello world or counter app), 2) how fast can you make changes to your webapp, 3) if there is a bug how long does it take you to find and fix what caused it and 4) was it worth spending your time trying to solve problems that have been solved by mature frameworks already. These are challenges that only show up when you build semi - advanced web apps (not a toy counter app)!

    • @3urobob
      @3urobob Рік тому +1

      My first reaction is that this poor DX is probably not worth the hassle

    • @boomshakalaka656
      @boomshakalaka656 Рік тому

      @@3urobob I think so too

  • @DanelonNicolas
    @DanelonNicolas Рік тому

    I just love it ❤ amazing

  • @giorgos-4515
    @giorgos-4515 Рік тому +1

    what if they made a compiler that turns react jsx into this? not sacrificing DX and getting maximum performance

    • @captsiro233
      @captsiro233 Рік тому +2

      I don't think that would be possible because van uses the signal reactivity and react uses rerender reactivity. This means that the react component function is executed every single time the state changes. While van component function is executed only once and then signals dictate what will change.
      It is like trying to implement a method on a class that is executed a lot and turn it into a class constructor.
      What could be done is to compile just plain old jsx into this approach. Oh wait that is exactly what solid js does.

    • @awesome-coding
      @awesome-coding  Рік тому

      @captsiro233 well explained!

  • @eyz-4
    @eyz-4 Рік тому

    cover dioxus! it has server functions now

  • @stephenkamenar
    @stephenkamenar Рік тому

    could you try to explain this again in more detail, maybe rewrite some of the functions to be more readable. it's very compressed code and hard to understand what the heck anything is doing. very very cool

    • @awesome-coding
      @awesome-coding  Рік тому

      Hey! Thanks for the suggestion. This is one of the main things I'll post in the near future - more hands on implementations of various aspects used in web frameworks. So, for certain, I'll revisit some of the Van's implementation in more detail.

  • @napapt
    @napapt Рік тому +1

    this lib is much like MithrillJs

  • @drao28
    @drao28 2 місяці тому

    Not supporting JSX is not a strength but a weakness. JSX makes DX so much better. Ultimately devs will gravitate towards what makes their life easier, not necessarily how light or clever the framework is.

    • @awesome-coding
      @awesome-coding  2 місяці тому

      It really depends - you'll find a lot of people complaining about JSX and preferring more classical HTML templates.

  • @naranyala_dev
    @naranyala_dev 6 місяців тому

    tailwind, tailwind, tailwind

  • @jenstornell
    @jenstornell Рік тому +1

    Reefjs works similar

  • @fredericheem
    @fredericheem Рік тому +1

    Vanjs is great but has some issues regarding reactive object and array. For that reason, I've created bau, it solves these issues and add functionalities such as lifecycle methods. Both projects move away from the angle bracket syntax. Readability and writability go to the moon.

    • @awesome-coding
      @awesome-coding  Рік тому +1

      Interesting - do you have a GitHub repo I can maybe check out?
      Thanks!

  • @randomdamian
    @randomdamian Рік тому

    TwoMinutePapers?

  • @kartikmadhak6327
    @kartikmadhak6327 11 місяців тому

    After a while, all I see is bunch of colorful letters.

    • @awesome-coding
      @awesome-coding  11 місяців тому

      😅 you and me both

    • @kartikmadhak6327
      @kartikmadhak6327 11 місяців тому

      @@awesome-coding didn't you make the video tho?

    • @awesome-coding
      @awesome-coding  11 місяців тому

      @@kartikmadhak6327 I did, but it's always the same after revisiting the code after a couple of weeks - I have to focus and remember what I thought I understood in the past.

  • @jrmc732
    @jrmc732 Рік тому +1

    Bro created the Flutter of JS🤣I would do one thing differently, use tagged template literals instead.

  •  Рік тому +2

    Realistically, when would this ever be useful? I just can't think of a situation where I feel like other more prominent libraries are too bloated, and vanilla Javascript is not enough. Like honestly, JS is more than performant enough to handle working with proper frameworks without affecting perceived user performance dramatically at all. And if I was building something large enough for performance to become a concern, I wouldn't go for this solution either because of the many drawbacks.
    If I want reactive components, I'll personally use React - but there are lots of other alternatives that all work fine and have more sophisticated features - and the build step is such a small burden that comes with so many pros that I'm not sure how much that weights in on my consideration.

    • @HeWhoShamesNarwhals
      @HeWhoShamesNarwhals Рік тому +2

      You just learned this framework in 7 minutes. React takes years to learn, and then the framework changes and you need years to re-learn. So that could be a reason.
      Or the direction these huge frameworks are taking (going fullstack) might not be what you want to do.
      I think that the market for these frameworks exists as a "I wanted to do it vanilla and remembered mid development that maybe React is not useless"

    • @the-nasim
      @the-nasim Рік тому +2

      It's a good library to pair with HTMX.

    • @captsiro233
      @captsiro233 Рік тому

      basically, any simple personal project + exploration of different takes on a single problem
      or if you don't want any build step and just make the file run in browser

  • @boomshakalaka656
    @boomshakalaka656 Рік тому +2

    Great a framework for making hello world and counter apps, exactly what no one asked for😂😂😂

  • @boomshakalaka656
    @boomshakalaka656 Рік тому +2

    Serious question. Why on earth would anyone use this?

    • @awesome-coding
      @awesome-coding  Рік тому +1

      Regardless, I still believe it is an interesting case study.

    • @boomshakalaka656
      @boomshakalaka656 Рік тому

      ​@@awesome-coding the project has over 2.2k stars on github, I guess there are people looking for something like this

    • @captsiro233
      @captsiro233 Рік тому

      Basically, any simple personal project + exploration of different takes on a single problem
      Not everyone enjoys compiling ts or tsx.
      Also, it uses solidjs's signals reactivity which is more performant because you don't need to go through the whole tree and check for updates

    • @boomshakalaka656
      @boomshakalaka656 Рік тому

      @@captsiro233 People make it sound like they compile TS/TSX by hand 😂.
      Signals are one small part of what makes a framework usable. Heck the most popular JS framework doesn't even use signals 🤷‍♂

    • @captsiro233
      @captsiro233 Рік тому +1

      ​@@boomshakalaka656 1) A few times I have found myself most of the time just waiting to recompile and then test the output. So it was really nice to just use JS make a change, save, and imidietly see the difference.
      Talking about 3D rendering, it is a stretch, but when I was debugging 3D projection I would loose my mind to recompile on every single little change like changing -2 to -3 or 10 to -10
      2) Signals are better DX for me. It is better abstraction of reactivity for me. I think of reactivity like this:
      You press a button which triggers like event and then little pieces of the UI change because they are directly connected to the button.
      Like I said. It is better abstraction for me. Plus I like to do a little bit more computation heavy and highly reactive application and there the little gain of using signals can be felt. (Although at that point I would not probably use a framework and stick to vanilla JS)

  • @hey_james
    @hey_james Рік тому

    Great video but can you stop ending every sentence on a higher pitch! 😂