Fireship · @fireship

The Nuxt big thing in web development?

Uploaded April 25, 2022 · Length 4:55

The Nuxt big thing in web development?

Summary

Fireship reviews Nuxt's unique features, including Auto Imports, Nitro server engine, and data fetching capabilities.

  • nuxt
  • web development
  • javascript
  • auto imports
  • nitro server engine
  • server side rendering
  • edge deployment
  • server routes
  • state management

Transcript preview

The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.

  1. 0:01

    it is April 25th 2022 and you're

  2. 0:04

    watching the code report after 16 months

  3. 0:06

    of hard work nujs version 3 has finally

  4. 0:08

    hit release candidate it's been 84 years

  5. 0:12

    and it was well worth the wait it's kind

  6. 0:13

    of like the nextjs for the view

  7. 0:15

    ecosystem and at first glance the only

  8. 0:16

    real difference is just one valve but

  9. 0:18

    the truth is that n has implemented some

  10. 0:20

    really unique features that are about to

  11. 0:22

    blow your mind if you've never used it

  12. 0:24

    imagine a world where every file has

  13. 0:26

    access to every component in your

  14. 0:27

    project so you never have to write an

  15. 0:29

    import statement ever again I never

  16. 0:30

    thought I'd see it in my lifetime but

  17. 0:32

    njs figured out a way to handle Auto

  18. 0:34

    Imports in a way that makes total sense

  19. 0:36

    we'll look at that along with a bunch of

  20. 0:38

    other features over the next few minutes

  21. 0:40

    first we need to talk about its

  22. 0:41

    documentation when you generate a new

  23. 0:43

    project you get this extremely minimal

  24. 0:44

    starting point and you're left wondering

  25. 0:46

    what do I do next well just like view

  26. 0:48

    itself this is a progressive framework

  27. 0:50

    that can do a lot of different things

  28. 0:51

    like build a single page app a static

  29. 0:53

    site a server rendered site a rest API

  30. 0:56

    or all of these things together at once

  31. 0:58

    what stands out in the documentation is

  32. 0:59

    that there's a page that corresponds to

  33. 1:01

    every directory in your project many of

  34. 1:03

    these directories do some magic like

  35. 1:05

    Pages handles all of your routing like

  36. 1:07

    nextjs and I really like how the

  37. 1:08

    documentation explains what every file

  38. 1:10

    in a project will do on top of that it

  39. 1:12

    has traditional API documentation as

  40. 1:14

    well as a ton of examples with

  41. 1:16

    interactive demos now the big core

  42. 1:18

    feature of Nu that makes everything else

  43. 1:19

    possible is a server engine they built

  44. 1:21

    from the ground up called Nitro it

  45. 1:23

    supports SSR and static site generation

  46. 1:26

    but most importantly it allows you to

  47. 1:27

    deploy on the edge like on cloudflare

  48. 1:29

    workers for example that means you're

  49. 1:31

    not limited to node.js and you can

  50. 1:33

    literally run serers side code all over

  51. 1:35

    the world as close as possible to the

  52. 1:37

    end user making your site extremely fast

  53. 1:39

    but the one thing it doesn't do yet is

  54. 1:40

    hybrid rendering where you have some

  55. 1:42

    routes that are static and others that

  56. 1:44

    are server rendered although this will

  57. 1:45

    be supported in the future now the most

  58. 1:47

    important aspect of rendering is how you

  59. 1:49

    fetch data on the server if we go into a

  60. 1:51

    component you'll notice we have a setup

  61. 1:53

    script which contains code that will run

  62. 1:54

    on the server now we can fetch data from

  63. 1:56

    our API or a database with composes like

  64. 1:59

    use async data or more conveniently use