Generate Images Programmatically on the Edge

Поділитися
Вставка
  • Опубліковано 11 жов 2022
  • A new tool from Vercel called OG can generate images on the edge for Open Graph with some basic JavaScript. This can be a great way to improve SEO and the clickability of links shared on social media.
    Try out my Next.js Course fireship.io/courses/react-nex...
    Vercel OG vercel.com/blog/introducing-v...

КОМЕНТАРІ • 145

  • @Exilum
    @Exilum Рік тому +122

    One day someone needs to create a wizard tool to figure out what framework and libraries to use depending on what you need to do. How awesome would it be to get from thousands of possibilities to a few and picking the one you're the most familiar with.

    • @themisir
      @themisir Рік тому +81

      The tool would become deprecated a minute after being published by not being able to catch up to the speed of js ecosystem evolution.

    • @faceboy1392
      @faceboy1392 Рік тому +4

      @@themisir a new javascript framework every hour

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

      i will make a JS framework that does exactly this, determines what framework to use.
      Honestly that's genius...

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

      @@keent I wish I could put a Jeremy Clarkson clip there.

  • @louiscassany
    @louiscassany Рік тому +73

    Another piece of gold, nice work man!

  • @tnvmadhav2442
    @tnvmadhav2442 Рік тому +21

    I built this for myself and now happy that there’s now a faster implementation 😅

  • @StephenGillie
    @StephenGillie Рік тому +22

    The real magic here is the JSX to SVG library. The rest is just routing.

  • @ste-fa-no
    @ste-fa-no Рік тому

    Already 100k, congrats for another success, and thank you for keeping up with great content!

  • @0x5DA
    @0x5DA Рік тому +172

    a video on fleet please!

    • @jordanmckoy1935
      @jordanmckoy1935 Рік тому +4

      I second this tried it out and I LOVE the UI

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

      @@jordanmckoy1935 love the git integration

    • @0x5DA
      @0x5DA Рік тому

      @@jordanmckoy1935 ikr! quick to boot also, and the language integration feels really awesome

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

      Please no. It currently is unethical and they do not plan to change that. Don't draw any attention to the abomination

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

      @@MH_VOID wdym?

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

    I sometimes think this guy is a sorcerer, how does he digest new tech that quick and sell it to us in an undeniable fashion???

  • @ByteBound
    @ByteBound Рік тому +4

    Great video! Perfect timing 👏

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

    This is awesome, thanks. Vercel does an amazing job with Next.

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

    this is incredible and exactly what i was looking for. really appreciate you 🙏🏻

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

    This is GOLD. Thank you!

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

    I literally googled this topic today. thank u fireship

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

    I was just trying to figure this out for my site. Thanks

  • @XceptionalBro
    @XceptionalBro Рік тому +16

    Great video man
    Lately I've been developing a serverless function to modify the open graph meta attributes of a url for a SPA. I think that'd make a nice video!

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

      Open graph servers don't usually parse Javascript, let alone evaluate it. How do you modify the flat HTML? If I knew, I'd add it to my serverless framework.

  • @sharbelokzan9673
    @sharbelokzan9673 Рік тому +7

    "Fleet, VSCode killer?"
    Really like to see that as a video title ;)

    • @JaimitoAleman
      @JaimitoAleman Рік тому +4

      Fleet does not intend to be a VS Code Killer. They are just expanding their software line-up. VS Code will always be free, but Fleet will NOT!

    • @JaimitoAleman
      @JaimitoAleman Рік тому +4

      BTW: GREAT software will always have a value - thus JetBrains will not release Fleet as free, because that is not its "market niche".

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

      ​@@JaimitoAleman "great __ will always have a value" is a flawed vision of a good future

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

      @@JorgetePanete Not like vim and Emacs and derivatives has been free for 30-40 years

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

    You the OG Dawg 🔥

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

    Such cool thing worths trying. Thanks

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

    Vercel is on fire🔥🔥🔥

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

    OMG! Thank you so much bro!

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

    vercel great as always

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

    THANK U SO MUCH FOR THIS !!!!!!

  • @KevinArellano
    @KevinArellano Рік тому +4

    I manually made this in Vue like a boss xd

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

    Really cool!

  • @Gelo2000origami
    @Gelo2000origami Рік тому +4

    Wow this is almost exactly what I was looking for (was thinking of using image magick before). I wanted to do simple overlays and it should be easy with this

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

    Thank's man

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

    Hi im glad to be here

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

    amazing

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

    Awesome!

  • @JohnnyMayHymn
    @JohnnyMayHymn Рік тому +11

    it seems like someone could take this to make something similar to flash games, back in the day

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

      You know you can run not just games but the entire Godot IDE in the browser right?

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

      @@chelbez Try googling next time. Seems like you can.

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

    Just learned about Nuxt Image like a few days ago

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

    Awesome

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

    Can you use Tailwind for styling the dynamic image?

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

    original gangster jeff

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

    Nice egg about cyberpunk edge runner :p

  • @heroe1486
    @heroe1486 Рік тому +4

    So it's just a library to get an SVG on the fly given some html/css ? I'm surprised nobody has done that before but thanks for the discovery, might be useful !

    • @skylerockspecial
      @skylerockspecial Рік тому +18

      It uses jsx and the react native layout engine (yoga) to generate svg’s and then rasterises the svg into a png.
      The standard before this was to spin up a headless chrome browser and take a “screenshot” with puppeteer.
      The part that renders jsx as svg is called satori
      The part that renders svg to png is called resvg

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

    Couldn't you do this with vanilla js+html?

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

    Let's gooooo

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

    game changer

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

    Would like to use it in an internal project, does it need to connect to vercel in order to generate the Image? Or can I do this offline?

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

    Pre 10k sub club

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

    I was this close to refreshing my PHP knowledge to make this happen myself... now I don't even need to bother with that because there's a way better solution now lol

  • @Paul-sk3cd
    @Paul-sk3cd Рік тому

    Will you create a Nuxt 3 course when it will be a stable release?

  • @69bruh
    @69bruh Рік тому

    Nice firedaddy

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

    The W

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

    imagemagick has done this since forever

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

      From html/css ? I guess that's the appeal here

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

      @@heroe1486 yes, takes a "screenshot"

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

    shesshh

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

    Please do a video on jetpack compose

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

    For some reason when implementing this I just get a blank image shown at the api route

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

    This is great, but it doesn't translate well to the app directory. Can you make one for the app directory?

  • @Tony-dp1rl
    @Tony-dp1rl Рік тому +5

    Kinda feels like Software Engineering has jumped the shark, using a 50MB instance of Chrome browser in a serverless function to create ... wait for it ... a simple SVG image. LOL

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

    Dynamic Mages

  • @E-Codz
    @E-Codz Рік тому

    Does it work without Next.js too?

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

    is it the same way with angular and Ts?

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

    Does it need to be hosted in Vercel environment?

  • @hugo-garcia
    @hugo-garcia Рік тому +1

    Now we know how to do on the Edge we want to know how to Generate Images Programmatically on the Chrome

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

    Canb this generate any sort of images or only open graph?

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

    Og og og, je protège mon gang et mon lobby !

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

    What about canvas?

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

    Noice.

  • @killiandatabase
    @killiandatabase 2 дні тому

    Can I save de generated image on an database or something?

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

    Figma supremacy

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

    first you sounded like a text-to-speech coverter..
    but anyway, 😆 now we can use this to automate making of video thumbnail...

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

    Can you run this on your own server as well or only on Vercel?

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

      You can see the api running on localhost at 0:51

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

      He's running it on his local machine so yes, and you can probably run this even outside of NextJS

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

    I still hate that SSR is required for doing basically any embedding or meta tag stuff nowadays.
    Would love if I could just say and have that URL handle things.

  • @ThomasValadez-tv
    @ThomasValadez-tv Рік тому

    Does anyone know of tools to help with this without using next?

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

    Could this also be used to serve dynamic images with a Discord bot?

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

    Fleet review

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

    It's not new I am using this feature from 2021, but there no package from next until now

  • @ulrich-tonmoy
    @ulrich-tonmoy Рік тому

    I think beyond fireship video should be more details and more lengthy whereas the fire video should be like 100 secs

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

    well couldnt you do that with a cloudflare worker for years?

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

    this looks sick, too bad I'm stuck with Netlify now

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

    Why not just write the SVG?

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

    whats wrong with me, i only hear background noises

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

    Wtf today I was just wondering how this can be done! I guess now I know.

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

    So now Jeff can create videos as code with Remotion, thumbnails as code with OG. Now if only there was a trained model for Jeff's voice, which can read out video scripts with memes created by (INSERT NEXT HOT JS LIBRARY HERE).

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

    Your courses needs to get updated in fireship.

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

    Who is fireship?

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

    As far as I know, OG images doesn't support SVG format.
    Not sure, how they're doing though.

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

      They convert it to png

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

      @@theindieprogrammer Ok,so do they first convert HTML to SVG then to PNG?

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

      @@MASTERISHABH Yes, they made this Satori library to convert HTML and CSS to SVG, then they use puppeteer to make a screenshot of the result

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

      @@theindieprogrammer Nopes, after getting svg they use resvg lib to convert it to a png

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

      @@mmaaz403 That's correct, I got confused with their old og-image implementation, which uses a chromium instance.

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

    Wow! no need to create dynamic svgs

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

    OG, which stands for Original Gangster.
    😂😂

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

    A video on discords full stack plzzz

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

    Why o why would you define an image in HTML rather than SVG? 🥺🥺 I mean, I get that if you're in a rush and unfamiliar with SVG it might take longer to learn... so I guess there might be valid use cases for it... but it definitely isn't something that sounds sensible for a 'mature' product?

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

    Waiting for Vue3 and Nuxt3 videos

  • @GbpsGbps-vn3jy
    @GbpsGbps-vn3jy Рік тому +1

    So this is the JSON way to spawn CSS shit, yes?

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

    Trade compute f bandw... Hmm

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

    Can anyone share some good php library for generating og image

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

    Please help: I don't still understand the use.
    Like can't we load images normally? why go through the hassle?
    Why not create an image and just use an svg converter to render the image as svg?
    Why create an image using css and hmtl when you can just create the same image using your favorite image editor and insert it into your code?
    Please someone should help me out with a clear explanation of this tool while contrasting it with other ways on manipulating images. Please

    • @chris-pee
      @chris-pee Рік тому +2

      The idea is that this automates and *parametrizes* the thumbnail creation.

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

      Please re-watch the video and listen carefully to what he says :)

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

      Doing it the traditional way is fine. The use case for this would be for a content creator (or others) who churns out multiple blog posts (or similar) per day which would mean doing it the "traditional way" would be time consuming where as this "programatic" approach would save you lots of time at the but you get less customizability compared to a tool like Figma/Photohop i.e. the "Traditional" way

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

    SVG mark-up isn't that complicated

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

    Sounds good, but the pattern of the image will eventually and quickly become recognizable and generic.

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

      did you not see that you can customize the image with html and css? anyway it's literally just a thumbnail for embeds, not a big deal

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

    First comment 🎉

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

    Fart on space

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

    Npm package.
    For generating a f*king preview.
    I don't know what is better describing everything what's wrong with a WebDevs.

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

    You said the first rule of SEO is to make good content, and now you say SEO is important, so are you saying it's important to make really good content?

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

    9 views 💀

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

    I feel like things are getting more complicated just for the fun of it :-/

  • @ste-fa-no
    @ste-fa-no Рік тому

    Jeff, you have bots impersonating every channel you own 😅 I hope you'll see this comment, and I hope none of your users would reply to those phishing scams

  • @akash.deblanq
    @akash.deblanq Рік тому

    which stands for "original gangster" bruh 😂

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

    a video on fleet please!