HTMX + Go + Web Components | Exploring Lit Web Components

Sdílet
Vložit
  • čas přidán 28. 09. 2023
  • LIVE ON TWITCH: / theprimeagen
    Get in on Discord: / discord
    Get in on Twitter: / theprimeagen
    Got Something For Me to Read or Watch??:
    / theprimeagenreact
  • Věda a technologie

Komentáře • 53

  • @cnaccio
    @cnaccio Před 10 měsíci +18

    I use web components for salesforce development, and I love them. Love how raw and native they are.

  • @jaysistar2711
    @jaysistar2711 Před 10 měsíci +9

    You don't need to build to use LitElement, but you can't use decorators. You just need to add a property to say what your attributes are, register the class once it's defined, and everything should fall into place with no build step.

    • @jaysistar2711
      @jaysistar2711 Před 7 měsíci

      @PaulAllsopp You're probably better just going with the web component API, but if you're coming from React, LitElement is helpful. lit-html is used by LitElement, and can be used without it. I had a project in WASM where I used Rust and lit-html to make several web components, and I think the workflow worked well.

  • @jtucker87
    @jtucker87 Před 10 měsíci +13

    He doesn't want TS but he never turns off the TS option in the examples to get the regular JS.

    • @oPatrickVico
      @oPatrickVico Před 6 měsíci

      The best option is not necessarily a great option. You know what they about democracy.

  • @connorlatham9578
    @connorlatham9578 Před 10 měsíci +1

    We use Lit for our web apps at work and I'm so happy we use it and not anything else. I just feel like theyre so easy to use.

  • @jaysistar2711
    @jaysistar2711 Před 10 měsíci +1

    6:20 From what I've heard, it hashes, but only parses if it hasn't seen that string before, but if it has, it doesn't parse, and internally uses the previous parse.

    • @YouCodeThings
      @YouCodeThings Před 9 měsíci +1

      You're close in that Lit only ever prepares a template once, except Lit doesn't need to hash template strings. A feature of tagged template literals is the static string reference is stable. This means we can tell by reference in a constant time check if we've seen a template before.

  • @bartek...
    @bartek... Před 10 měsíci +2

    Finally! I caught @theprimeagen do programming in HTML 🤣

  • @oussama40612
    @oussama40612 Před 10 měsíci +1

    Absolutely love this channel. I love you!

  • @rickdg
    @rickdg Před 10 měsíci

    Once you go the htmx way, why not also generate your JS files in your server language of choice?

  • @jaysistar2711
    @jaysistar2711 Před 10 měsíci

    Neon is the thing to bind native Rust code to Node JS code.

  • @jogibear9988
    @jogibear9988 Před 10 měsíci +1

    I also love Webcomponents, but I liked the approche google had with polymer (templates) more, instead of the render function wich is now in lit.
    Cause of this I build my own small base component wich works more like polymer before.
    With this I build a complete WYSIWYG designer framework in webcomponents (also as a webcomponent), wich also works without any compilation (only ts -> js)

    • @jogibear9988
      @jogibear9988 Před 10 měsíci

      You can also do everything without a compilation step, if you use importmaps, and do not use decorators (they are optional)

  • @aleksandrkravtsov8727
    @aleksandrkravtsov8727 Před 7 měsíci

    do you have version where you only writing code?

  • @laughingvampire7555
    @laughingvampire7555 Před 10 měsíci +1

    fun fact perl was invented as a replacement & improvement for awk

  • @JeremyAndersonBoise
    @JeremyAndersonBoise Před 10 měsíci +13

    Pretty sure i was tequila drunk for this stream. I’m admitting that, specifically, in fact. Apologies and/or you’re welcome.

  • @xXYourShadowDaniXx
    @xXYourShadowDaniXx Před 8 měsíci +2

    I don't think I've laughed more than you just dropping chat gpt code in and it installing vue and react alongside each other

  • @TedoHamTole
    @TedoHamTole Před 10 měsíci

    looks interesting

  • @grinsk3ks
    @grinsk3ks Před 10 měsíci +5

    why does he refuse to `pnpm create vite`?

  • @danko95bgd
    @danko95bgd Před 10 měsíci +2

    Bruh vite literally has Lit template with 5 other frameworks... just init the god damn cli aaaaargh

  • @JeremyAndersonBoise
    @JeremyAndersonBoise Před 10 měsíci +5

    The existence of build steps for client side javascript still feels morally wrong, htmx is compelling for that reason alone

  • @LusidDreaming
    @LusidDreaming Před 7 měsíci

    I think apline.js fits better with HTMX than web components, it is much more focused on declarative hypermedia, whereas web components is like react lite, where everything is in the JS and all you can do is pass in props via attributes.

  • @Krzysiekoy
    @Krzysiekoy Před 10 měsíci +3

    Well this was a trainwreck

  • @RoccoAugusto
    @RoccoAugusto Před 7 měsíci +1

    You could have used regular JavaScript and avoided Typescript. In all the LitElement examples, in the top right hand corner, you could have chosen to show them in .js format instead of .ts

    • @lcarv20
      @lcarv20 Před měsícem

      I was frustratingly thinking about the same, and no one the chat told him xD. But we can also blame on dark reader’s extensions that hides the js button

  • @vincentrouilhac4532
    @vincentrouilhac4532 Před 10 měsíci +5

    I'd like to see a new "JS tool" that does not sells itself as "Fast", It seems like everything in dev world sells itself as Fast xD

  • @phead2137
    @phead2137 Před 4 měsíci

    I think that you could just read the docs instead of yelling, but whatever

  • @wasile
    @wasile Před 10 měsíci

    😂

  • @GiulioZelante
    @GiulioZelante Před 10 měsíci

    even with angular you can create reusable web components without the need of a framework. I think also svelte has something similar, and surely I would choose the latter if I could

    • @filipegoncalves3739
      @filipegoncalves3739 Před 10 měsíci +9

      lil bro angular IS a framework

    • @ea_naseer
      @ea_naseer Před 10 měsíci

      you can use web components in any framework.

    • @sub-harmonik
      @sub-harmonik Před 10 měsíci +3

      angular is the most js framework that ever frame worked

    • @GiulioZelante
      @GiulioZelante Před 10 měsíci

      ​@@filipegoncalves3739 maybe you didn't understand the comment. I'll quote the angular doc
      "Angular elements are Angular components packaged as custom elements (also called Web Components), a web standard for defining new HTML elements in a framework-agnostic way."
      And That's what I meant, not that angular is not a framework...

    • @GiulioZelante
      @GiulioZelante Před 10 měsíci

      @@sub-harmonik ​maybe you didn't understand the comment. I'll quote the angular doc
      "Angular elements are Angular components packaged as custom elements (also called Web Components), a web standard for defining new HTML elements in a framework-agnostic way."
      And That's what I meant, not that angular is not a framework...

  • @dromedda6810
    @dromedda6810 Před 10 měsíci +1

    first

    • @noTmeDev
      @noTmeDev Před 10 měsíci +1

      no.

    • @ea_naseer
      @ea_naseer Před 10 měsíci

      ​@@noTmeDevjust let him have it bro 😂😂

    • @dromedda6810
      @dromedda6810 Před 10 měsíci

      @@noTmeDev wanna fight about it at the nearest costco by having a competition about who knows the most shitty acronyms?

    • @noTmeDev
      @noTmeDev Před 10 měsíci +1

      @@dromedda6810 bruh XD

    • @dromedda6810
      @dromedda6810 Před 10 měsíci

      @@noTmeDevxD

  • @pookiepats
    @pookiepats Před 10 měsíci

    Vue can be added anywhere like htmx in the head - it doesn’t have to be your EVERYTHING like react or svelte

    • @axMf3qTI
      @axMf3qTI Před 8 měsíci +1

      This is true. I used vue with shopify in the past like that, next if I have to something similar I probably use htmx though.

    • @pookiepats
      @pookiepats Před 8 měsíci

      @@axMf3qTI Vue is slept on to some extent in JS land but other languages like PHP and the .NET flavors have long embraced Vue for this fact - JS only try hards simply do not know and that is what makes it so cringe to watch them speak all this ignorance. Prime usually knows his stuff but oh well, at least he's funny.