Looking into the Svelte compiler

profile

@lihautan

  • 👨🏻‍💻 Frontend engineer at Shopee Singapore
  • 🇲🇾 Grew up in Penang, Malaysia
  • 🛠 Svelte Maintainer

  

Are you ready?


Jon,Margeret

    App.svelte

    Component.svelte

    Hello World

    The Svelte Compiler

    How does compiler work?

    How does Svelte compiler work?

    1. Parsing Svelte code

    2. Static Analysis

    3. Rendering

    2 different targets:

    • generate: dom
    • generate: ssr

    3.1. generate: dom

    3.2. generate: ssr

    4. Output as js + css

    Summary

    1. Parsing Svelte code

    2. Static Analysis

    3. Rendering

      3.1. generate: dom

      3.2. generate: ssr

    4. Output as js + css

    Thank you

    @lihautan