HOT Reloading The Browser With Templ, Tailwind, And Golang

Поделиться
HTML-код
  • Опубликовано: 27 окт 2024

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

  • @anthonygg_
    @anthonygg_  8 месяцев назад +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 8 месяцев назад

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

  • @thomastthai
    @thomastthai 8 месяцев назад +9

    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.

  • @kal.leroux
    @kal.leroux 8 месяцев назад +4

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

  • @rochakgupta6116
    @rochakgupta6116 8 месяцев назад +1

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

  • @erikslorenz
    @erikslorenz 8 месяцев назад +5

    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 8 месяцев назад +1

      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!

  • @nexovec
    @nexovec 7 месяцев назад +1

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

  • @FaheemAfridi-n5n
    @FaheemAfridi-n5n 8 месяцев назад +12

    Sir please uploaded completely backend tutorial in golang

  • @marcosissler
    @marcosissler 8 месяцев назад +1

    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.

  • @sighup124
    @sighup124 8 месяцев назад +1

    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.

  • @axMf3qTI
    @axMf3qTI 8 месяцев назад +1

    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.

  • @gungun974
    @gungun974 8 месяцев назад +2

    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_  8 месяцев назад +1

      Can you share this to me?

    • @gungun974
      @gungun974 8 месяцев назад +1

      @@anthonygg_ Of course but I don't think RUclips 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 8 месяцев назад +1

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

  • @seanknowles9985
    @seanknowles9985 8 месяцев назад +4

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

  • @nexovec
    @nexovec 7 месяцев назад

    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.

  • @Cheun-b4q
    @Cheun-b4q 8 месяцев назад +1

    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.

  • @hipertracker
    @hipertracker 8 месяцев назад +1

    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 8 месяцев назад

      ya but this doesn't reload the browser page

    • @hipertracker
      @hipertracker 8 месяцев назад

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

    • @mai-evan
      @mai-evan 8 месяцев назад

      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.

  • @zoop2174
    @zoop2174 8 месяцев назад +1

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

  • @jogurtnaturalny
    @jogurtnaturalny 5 месяцев назад +1

    what is brown and sticky? A STICK!!!

  • @yousseframadan-m1q
    @yousseframadan-m1q 8 месяцев назад +1

    you came in just in the right time ♥♥♥

  • @davidhendriksen
    @davidhendriksen 8 месяцев назад +2

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

    • @anthonygg_
      @anthonygg_  8 месяцев назад +1

      Just add it as a pluging :shrug:

  • @NiltonOS
    @NiltonOS 8 месяцев назад +2

    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.

    • @anthonygg_
      @anthonygg_  8 месяцев назад +1

      Download llink in last video

  • @joelazaro461
    @joelazaro461 8 месяцев назад +1

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

  • @WirIez
    @WirIez 5 месяцев назад +1

    Is this HMR or is it live reload?

  • @SebastianSativaLivemore
    @SebastianSativaLivemore 8 месяцев назад +1

    Amazing value as always! Thanks for sharing 🔥

  • @lazyh0rse
    @lazyh0rse 8 месяцев назад +3

    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.

    • @anthonygg_
      @anthonygg_  8 месяцев назад +1

      Agree

    • @viniciusataidedealbuquerqu2837
      @viniciusataidedealbuquerqu2837 8 месяцев назад +1

      maybe they use a polling technique which is really unresponsive

    • @zyr4c31
      @zyr4c31 8 месяцев назад +1

      is it possible while using htmx to submit a response to the browser with the HX-Refresh header for hotreload?

  • @YmamHudaynazarow-e2s
    @YmamHudaynazarow-e2s 7 месяцев назад +2

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

  • @xLittlePsycho
    @xLittlePsycho 4 месяца назад +2

    runs a command, it fails 2 of 3 times... says: i swear to god it works 99% of time. rofl are you kidding me? it obiously does not work in 66% of the time...

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

      Yeah what a loser, im unsubscribing.

  • @Metruzanca
    @Metruzanca 8 месяцев назад +1

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

  • @smartjackasswisdom1467
    @smartjackasswisdom1467 8 месяцев назад +2

    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_  8 месяцев назад +1

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

  • @anonymouse1344
    @anonymouse1344 8 месяцев назад +2

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

  • @SOMEONE-jg6jg
    @SOMEONE-jg6jg 8 месяцев назад +1

    I got really interested in golang because of you

  • @guhstanley
    @guhstanley 8 месяцев назад +1

    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

  • @nurayatbeltaev9072
    @nurayatbeltaev9072 8 месяцев назад +1

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

  • @Benozo17
    @Benozo17 8 месяцев назад +1

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

  • @Kats0unam1
    @Kats0unam1 8 месяцев назад +1

    Great stuff as usual, thank you!

  • @choleralul
    @choleralul 8 месяцев назад +2

    Lets go Tony! Free Acid!

  • @gasanaelvis1777
    @gasanaelvis1777 8 месяцев назад +2

    The big Anthooonnn

  • @caiolaytynher5994
    @caiolaytynher5994 8 месяцев назад +1

    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

  • @hexskull1
    @hexskull1 8 месяцев назад +1

    can you post the full air.toml file?

  • @naufaldbei4234
    @naufaldbei4234 8 месяцев назад +1

    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 8 месяцев назад

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

    • @naufaldbei4234
      @naufaldbei4234 8 месяцев назад

      @@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

  • @javadahmadian7782
    @javadahmadian7782 8 месяцев назад +2

    Thanks

  • @jogurtnaturalny
    @jogurtnaturalny 8 месяцев назад +1

    I'm leaving some stuff in comment as requested

  • @fikurimax
    @fikurimax 8 месяцев назад

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

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

    so you still need to reload your browser? are you kidding me? in which world would this be a good choice to develope a web app?

  • @byerikboltimur5375
    @byerikboltimur5375 8 месяцев назад

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

  • @hamm8934
    @hamm8934 7 месяцев назад

    you really need content policy headers...

  • @mehmetuysal163
    @mehmetuysal163 8 месяцев назад

    O_O

  • @danielmadeley2695
    @danielmadeley2695 8 месяцев назад

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