HOT Reloading The Browser With Templ, Tailwind, And Golang

Sdílet
Vložit
  • čas přidán 21. 02. 2024
  • ► Join my Discord community for free education 👉 / discord
    ► Exclusive Lessons, Mentorship, And Videos 👉 / anthonygg_
    ► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO
    ► Enjoy a 60% Black Friday Discount on My Golang Course 👉 fulltimegodev.com
    ► Learn how I became a self-taught software engineer 👉fulltimegodev.com/#mystory
    ► Follow me on Twitter 👉 / anthdm
    ► Follow me on GitHub 👉 github.com/anthdm
    Grab yourself a 33% OFF on the PRESALE event of my building production ready applications with GO + HTMX + Templ + Tailwindcss + JQuery course here: bit.ly/3UFruxO
    Templ command:
    templ generate -watch -proxy=localhost:3000
    Tailwind command;
    tailwindcss -i view/css/input.css -o public/styles.css --watch
    SUBSCRIBE OR NO MARGARITAS
    ╔═╦╗╔╦╗╔═╦═╦╦╦╦╗╔═╗
    ║╚╣║║║╚╣╚╣╔╣╔╣║╚╣═╣
    ╠╗║╚╝║║╠╗║╚╣║║║║║═╣
    ╚═╩══╩═╩═╩═╩╝╚╩═╩═╝

Komentáře • 65

  • @anthonygg_
    @anthonygg_  Před 3 měsíci +2

    ► 33% OFF on my Go + HTMX + Templ Course PRESALE 👉bit.ly/3UFruxO
    ► Join my Discord community for free education 👉 discord.com/invite/Ac7CWREe58
    ► Exclusive Lessons, Mentorship, And Videos 👉 www.patreon.com/anthonygg_
    ► 60% OFF on my Golang course 👉 fulltimegodev.com
    Thanks for watching

    • @NiltonOS
      @NiltonOS Před 3 měsíci

      Anthony nice Course !! -> Go + HTMX + Templ

  • @thomastthai
    @thomastthai Před 3 měsíci +6

    Hi Anthony! Thanks for sharing the video with the community. I wasn't able to find the air config in the description as you mentioned in the video at 03:39. People will find your `.air.toml` configuration file along with your `Makefile` helpful instead of pausing and retyping from the video.

  • @rochakgupta6116
    @rochakgupta6116 Před 3 měsíci

    Anthony has been balling really hard and I, for one, am loving every minute of it.

  • @kal.leroux
    @kal.leroux Před 3 měsíci +3

    love you content you are the one who got me in golang 3 month ago when I was considering go or rust

  • @SebastianSativaLivemore
    @SebastianSativaLivemore Před 3 měsíci

    Amazing value as always! Thanks for sharing 🔥

  • @joelazaro461
    @joelazaro461 Před 3 měsíci

    Nice tip. I'm looking forward to trying this.

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

    If we are already Full time go dev customers do we get the HTMX course included or is an additional purchase my bro?

  • @user-ew7vx9xs5u
    @user-ew7vx9xs5u Před 3 měsíci

    you came in just in the right time ♥♥♥

  • @Kats0unam1
    @Kats0unam1 Před 3 měsíci

    Great stuff as usual, thank you!

  • @sighup124
    @sighup124 Před 3 měsíci

    I also had tried this. Proper way to do it is have some websocket that gets triggered on rebuild and then does the reload. Of course only include it in templ when in dev mode.

  • @SOMEONE-jg6jg
    @SOMEONE-jg6jg Před 3 měsíci +1

    I got really interested in golang because of you

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

    Yeah I made a middleware to refresh the browser when air restarts the server too. It was the first thing when I started doing a Go-htmx project where I was like what the heck? I need this!

    • @guhstanley
      @guhstanley Před 3 měsíci

      Hi man, can you share that with us? I could't make the example from anthony to work as I was getting some random errors. Thank you in advance!

  • @user-ge4uu1gw9r
    @user-ge4uu1gw9r Před 3 měsíci

    Do you ever plan on doing some with other frameworks or perhaps the standard library standalone? I feel like I inhibited my own learning process by using fiber and having to make a ton of utility functions for things that the standard net/http library does by itself quite easily.

  • @anonymouse1344
    @anonymouse1344 Před 3 měsíci +1

    which api are you using to generate images or custom model?

  • @choleralul
    @choleralul Před 3 měsíci +1

    Lets go Tony! Free Acid!

  • @gasanaelvis1777
    @gasanaelvis1777 Před 3 měsíci +1

    The big Anthooonnn

  • @guhstanley
    @guhstanley Před 3 měsíci

    I've tried but got invalid memory address error when executed, then it kept retrying to connect but receiving message "Server not ready". Do you know if any other thing is necessary? Thanks Anthony

  • @axMf3qTI
    @axMf3qTI Před 3 měsíci

    I don't think it's ready to use yet. At least I had a lot of problems. Right now it refuse to give me my latest css file so on the default port of my app I have a different looking page than on port 7331, I had more sync-issues.
    I switched back to air with template generate and hot-reloading for my css. Not ideal but less frustration. Thanks for the tip tho! Definitely will try again in the future.

  • @user-pc7bv8vk4p
    @user-pc7bv8vk4p Před 3 měsíci +11

    Sir please uploaded completely backend tutorial in golang

  • @byerikboltimur5375
    @byerikboltimur5375 Před 3 měsíci

    Hello sir , i am hesitating moving from vue.js to golang htmx . Please write me ur opinion . Golang htmx is server side rendering right ?

  • @davidhendriksen
    @davidhendriksen Před 3 měsíci +1

    Amazing! How did you manage to include DaisyUI as Tailwind plugin?

    • @anthonygg_
      @anthonygg_  Před 3 měsíci

      Just add it as a pluging :shrug:

  • @nexovec
    @nexovec Před 2 měsíci

    Hm, never got a race condition with templ. I've had several other bugs, and a-h has been extremely helpful, even proactive in fixing these. This bit of technology is a bit unique in that it transpiles to go and uses the go compiler to report its own errors, which also makes it hard to make robust. The dev tirelessly works on it and I think it has good future and that's why I currently choose it for all my webdev projects.

  • @marcosissler
    @marcosissler Před 3 měsíci

    I still in love with Svelte. I saw your video about changing to HTMX but still prefer Svelte. It’s soo good. Not sure if HTMX will rock 🚀 and yes. Air is amazing. Tks again for the content.

  • @puterich
    @puterich Před 3 měsíci

    I‘m still waiting on your validation thingy you you teased in the course

  • @javadahmadian7782
    @javadahmadian7782 Před 3 měsíci +1

    Thanks

  • @smartjackasswisdom1467
    @smartjackasswisdom1467 Před 3 měsíci +1

    What Api are you using to generate the AI images?
    I really want to buy it, I'm just really curious in case I need to also allocate some money for the API calls

    • @anthonygg_
      @anthonygg_  Před 3 měsíci +1

      Its a custom trained model. We release it for payed usage soon

  • @NiltonOS
    @NiltonOS Před 3 měsíci +1

    Hi Anthony, I'm your student on the HTMX course, but the project link on github is no longer available, you can update with the correct link, thank you.

  • @gungun974
    @gungun974 Před 3 měsíci +1

    Nice, personally I use vite in my golang project so I just edit my Vite configuration to be capable of sending a curl request for manually refreshing the page and i execute this request in my Makefile when build is done. I know make vite work with go is not easy but I can guaranteed it can be great.

    • @anthonygg_
      @anthonygg_  Před 3 měsíci

      Can you share this to me?

    • @gungun974
      @gungun974 Před 3 měsíci

      @@anthonygg_ Of course but I don't think CZcams comment are the best place to share this kink of thing so I join your Discord server.
      I would be happy to share this via PM first since it's work great for me but I'm currently building my personal utility to build golang projects the way I like it ^^

    • @gungun974
      @gungun974 Před 3 měsíci

      @@anthonygg_ Forget what I was saying, I made an example Git repo and share it on your Discord for everyone.

  • @nexovec
    @nexovec Před 2 měsíci

    They asked for a hot refresh, they got a hottie refresh.

  • @danielmadeley2695
    @danielmadeley2695 Před 3 měsíci

    Is this course included in FullTimeGoDev, looking at purchasing today.

  • @jogurtnaturalny
    @jogurtnaturalny Před 4 dny

    what is brown and sticky? A STICK!!!

  • @nurayatbeltaev9072
    @nurayatbeltaev9072 Před 3 měsíci

    Can you make the tutor on how to get css files with templ?

  • @caiolaytynher5994
    @caiolaytynher5994 Před 3 měsíci

    Sir, are you spying on me? I was literally trying to do this yesterday and couldn't find any good solution, this video is made for me sir

  • @zoop2174
    @zoop2174 Před 3 měsíci

    I do something similar, but instead of opening 3 terminals I just have a script run those in a tmux session.

  • @niquedegraaff
    @niquedegraaff Před 3 měsíci

    How does this work with Echo?

  • @WirIez
    @WirIez Před 27 dny

    Is this HMR or is it live reload?

  • @Metruzanca
    @Metruzanca Před 3 měsíci

    I've got air running all 3 commands using the pre_cmd option

  • @user-yv5lc8on5x
    @user-yv5lc8on5x Před 3 měsíci +1

    anthony can you explain RABBIT MESSAGE QUEUE.... and can you understand with video, please

  • @Benozo17
    @Benozo17 Před 3 měsíci

    I just use air, nodemon, browser-sync and all runs under npm start

  • @naufaldbei4234
    @naufaldbei4234 Před 3 měsíci

    hey was wondering if you know how to make nvim detects templ files? was stuck and switched out to vscode again because of this lol

    • @axMf3qTI
      @axMf3qTI Před 3 měsíci

      There is a templ lsp for nvim look in the templ docs under IDE support. It's explained there.

    • @naufaldbei4234
      @naufaldbei4234 Před 3 měsíci

      @@axMf3qTI hey so i figutred it out but now im stuck on the formatting section, been trying to do what the docs said but somehow the `templ fmt` does not run when i write the buffer. Any idea how to do this? I use lazy nvim and i put the formatting code section from the docs on one of the plugins (example.lua). I put it inside a function on the config property

  • @hexskull1
    @hexskull1 Před 3 měsíci

    can you post the full air.toml file?

  • @hipertracker
    @hipertracker Před 3 měsíci

    I drop air because of not only race conditions but mainly for leaving zombie processes after I stopped the script. I switched to "wgo - watcher-go" . My command refresh *.go and recompile *.templ with: @wgo -file=.go -file=.templ -xfile=_templ.go templ generate :: go run .

    • @adamsribz
      @adamsribz Před 3 měsíci

      ya but this doesn't reload the browser page

    • @hipertracker
      @hipertracker Před 3 měsíci

      ​@ibz yes, but it's still better than having to manually kill zombie processes after every terminal session ends

    • @mai-evan
      @mai-evan Před 3 měsíci

      I bet the zombie processes could be avoided if you caught the os signal and handled context closing. I had this exact same issue and gave up on it and after trying many things came back to air and said I gotta figure this out.

  • @lazyh0rse
    @lazyh0rse Před 3 měsíci +2

    templ & air hotreload are too slow to detect file changes. I have been using entr (Linux program), or fswatch from codeskyblue (native crossplatform go program). Both are extremely responsive.
    However, they don't have a proxy to hotreload the browser which is a shame.

  • @jogurtnaturalny
    @jogurtnaturalny Před 3 měsíci

    I'm leaving some stuff in comment as requested

  • @fikurimax
    @fikurimax Před 3 měsíci

    I should set playback speed to 0.75 everytime I watch your videos 😢. I should practice English more

  • @mehmetuysal163
    @mehmetuysal163 Před 3 měsíci

    O_O

  • @hamm8934
    @hamm8934 Před 2 měsíci

    you really need content policy headers...