Next js 15 is Here… New Changes Again?!

JavaScript Mastery
24 May 202408:13

Summary

TLDRこのビデオでは、VercelのCEOであるGMO Rouchが開発したNext.jsの最新バージョンであるNext.js 15について紹介しています。React 19のサポート、React Compilerの統合、および改善されたキャッシング技法などが含まれています。また、Next.jsがウェブAPIを変更しないようにしたことや、新しいPPR(部分的な事前レンダリング)機能、Next Afterという新しい機能についても触れています。さらに、開発プロセスを高速化するためにTurbopackを採用し、外部パッケージのバンドルもサポートしています。これらの新機能を学ぶためのガイドも提供されています。

Takeaways

  • 😀 Vercel社のCEOであるGMO Rouchが、開発者がReact周りの設定に数週間を費やすことがあるのに対して、Vercelは8年間をかけてそのプロセスを簡素化しようとしています。
  • 🚀 Next.js 15は、これまでのキャッシュの不都合を解消し、開発者の体験を改善することを目指しています。
  • 💡 Next.jsはReactを置き換えることで、多くの開発者がアプリを書き換える必要があると感じていますが、実際にはそうではないと主張しています。
  • 🔍 Next.js 15はReact 19の機能をサポートしており、これまでのuseRefなどの問題を解決するreact compilerを内蔵しています。
  • 🛠️ React compilerはコードを最適化し、再チェックが必要ない部分を自動的に判断してアプリの実行速度を向上させます。
  • 🌐 Next.jsはグローバルWeb APIを変更することから手を引いて、fetchやroute handlersが自動でキャッシュする動作を削除しました。
  • 🎨 Next.js 15では、SSG、ISR、SSRを組み合わせた新しいレンダリング戦略であるPPR(部分的な事前レンダリング)が導入されています。
  • 📺 YouTubeの再生カウントのように、重要な処理を優先して行い、その後に余計な処理を行うNext Afterという機能が追加されました。
  • 🛠️ 開発者は現在、MPX create next appを使用してNext.js 15のRC版を試すことができますが、年末には正式版がリリースされる予定です。
  • 🔧 Next.jsは開発モードでwebpackの代わりに高速なバンドラーであるTurbopackを採用し、開発プロセスを高速化しています。
  • 📦 Next.jsはアプリディレクトリ内の外部パッケージをデフォルトでバンドルし、アプリケーションのcold startを改善し、開発者の体験を向上させています。

Q & A

  • Vercel社のCEOであるGMO Rouchはどのような問題を解決しようとしましたか?

    -GMO Rouchは、開発者がReact周りのセットアップに数週間も費やすことがあるという問題を解決しようとしました。彼は8年間をかけて、他の開発者たちが同じような時間をかけずに開発できるようにプロセスをスピードアップしました。

  • Next.js 15の目的は何ですか?

    -Next.js 15の目的は、React開発者が効率的に開発を行うためのプロセスをさらに高速化し、キャッシュの問題を改善することです。

  • Next.jsはなぜReactを「食べる」と言われていますか?

    -Next.jsはReactの機能を拡張し、より高速で効率的な開発体験を提供するため、Reactを「食べる」と言われています。しかし、その多くはNext.jsのマジックのように感じる部分や、アプリを書き換える必要があると感じる開発者もいます。

  • Next.js 15がReact 19の何をサポートするようになりましたか?

    -Next.js 15はReact 19のuseReplacementと呼ばれる新機能をサポートしました。これはReactのフックをほとんど置き換え、refをpropとして渡す機能を提供します。

  • React Compilerとは何で、なぜ重要なのですか?

    -React CompilerはReactのコードを最適化するオープンソースのコンパイラです。開発者がuseMemoやuseCallbackなどの最適化技術をスキップしたり誤用したりすることからアプリが遅くなる問題を解決し、自動的にコードのどの部分が再チェックが必要かどうかを判断してアプリを高速化します。

  • Next.js 15ではGlobal Web APIsをどのように扱う予定ですか?

    -Next.js 15では、以前はfetchを使用するとキャッシュ結果が変更される問題がありましたが、開発者からのフィードバックを受けて修正し、fetch、route handlers、linkを使用したクライアントナビゲーションは自動的に結果をキャッシュしなくなりました。必要であれば、フラグを渡してキャッシュを有効にすることができます。

  • Partial Pre-rendering (PPR)とは何ですか?

    -Partial Pre-rendering (PPR)は、ページの一部をSSGでレンダリングし、もう一部分をSSRまたはISRで動的にレンダリングする新しいアプローチです。これにより、静的なコンテンツと動的なコンテンツを組み合わせて最適なパフォーマンスを実現できます。

  • Next.js 15でのNext Afterとは何ですか?

    -Next Afterは、サーバーがウェブサイトのコードをブラウザに送信する際に、重要なタスクを優先的に処理し、その後に余計なタスクを実行する機能です。これにより、ユーザーはサーバーの余計なタスクが完了するのを待たずにコンテンツを受信できます。

  • Next.js 15で使用する新しいバンドラーは何ですか?

    -Next.js 15では、開発モードで使用する新しいバンドラーとしてTurbopackが採用されています。これはwebpackと同じようにウェブサイトのファイルをバンドルしますが、より高速でスムーズです。

  • 外部パッケージのバンドルはどのように改善される予定ですか?

    -Next.js 15では、アプリディレクトリ内の外部パッケージもデフォルトでバンドルされるようになり、これによりアプリケーションのコールドスタートを改善し、遅延を減らし、開発者の体験を向上させます。

  • Vercelの最新機能としてAIストリームとは何ですか?

    -AIストリームはVercelが提供する最新の機能で、最終出力を生成している間にもレスポンスをストリーミングして提供します。これにより、コードが一行ずつ生成される様子を見ながら待つ必要がなくなります。

Outlines

00:00

🚀 Next.js 15の新機能とアップグレードガイド

Vercel社CEOであるTanmai GopalがNext.js 15のリリースを発表しました。このアップグレードは、開発者がReactを使いやすくするための8年間の努力の集大成と位置付けられています。新機能として、React 19の`use`の改善、React Compilerのサポート、キャッシュの最適化、そして部分的な事前レンダリング(PPR)などが挙げられます。また、Next.jsはグローバルWeb APIを変更しないように変更され、`fetch`や`link`を使用したナビゲーションでのキャッシュも制御可能になりました。このセクションでは、Next.js 15の主な変更点と、それらを活用するためのガイドラインが説明されています。

05:00

🛠️ Next.js 15の追加新機能と開発効率の向上

Next.js 15では、新たな機能として`next/after`が導入され、サーバーの追加タスクが完了するまでユーザーを待たないようにする仕組みが提供されています。また、開発効率を高めるために、Next.jsはwebpackの代替として`turbopack`を採用し、開発モードでのバンドルプロセスを高速化しています。さらに、外部パッケージのバンドルもアプリディレクトリ内でデフォルトで行われ、アプリケーションのコールドスタートを改善し、開発者の体験を向上させています。Vercelの最新機能も紹介されており、AIがリアルタイムでコードを生成する様子を見ることができるとのことです。

Mindmap

Keywords

💡Next.js

Next.jsは、Reactフレームワークであり、ウェブアプリケーションの開発を効率化するツールです。このビデオでは、Next.jsの最新バージョンであるNext.js 15の紹介とその新機能の解説が行われています。Next.jsは、開発者がReactをより速く簡単に使用できるように設計されており、ウェブ開発におけるテーマとメッセージに非常に密接に関係しています。

💡React Compiler

React Compilerは、Reactアプリケーションのコードを最適化するためのツールです。ビデオでは、Next.js 15がReact Compilerをサポートし、開発者がuseMemoやuseCallbackのような最適化テクニックを自動的に使用できるようになるという点に焦点が当てられています。これは、アプリケーションのパフォーマンスを向上させる上で重要な役割を果たしており、ビデオの主題に直接関係しています。

💡Partial Pre-rendering (PPR)

Partial Pre-renderingは、Next.js 15で導入された新しいレンダリング戦略です。これは、ページの一部をStatic Site Generation(SSG)としてレンダリングし、残りの部分をServer-side Rendering(SSR)またはIncremental Static Regeneration(ISR)として扱うことができます。ビデオでは、PPRがどのように役立つのかを説明しており、デモも紹介されています。これは、ウェブサイトのパフォーマンスとユーザーエクスペリエンスを向上させる重要な概念です。

💡Vercel

Vercelは、Next.jsを開発している企業です。ビデオでは、VercelのCEOであるGMO RouchがNext.jsの開発と改善に貢献したと紹介されています。Vercelは、ウェブ開発者にとって重要なプラットフォームであり、ビデオのテーマと内容を理解する上で重要なキーワードです。

💡Release Candidate (RC)

Release Candidateは、ソフトウェアの開発プロセスにおける一段階を指します。これは、ソフトウェアが正式にリリースされる前に最終テストを行っている状態を意味しており、ビデオではNext.js 15のRCについて触れています。これは、開発者が新しい機能を試すことができる重要な時期であり、ビデオのテーマに関連しています。

💡Hydration

Hydrationは、Reactアプリケーションにおいて、サーバーサイドで生成されたコンポーネントをクライアントサイドで再アクティブにするプロセスです。ビデオでは、Next.js 15がhydrationエラーを改善し、開発者にとってより良いエクスペリエンスを提供するという点に言及されています。これは、ウェブアプリケーションのパフォーマンスとユーザーエクスペリエンスに直接関係する重要な概念です。

💡Global Web APIs

Global Web APIsは、ウェブ開発において使用される標準的なAPI群です。ビデオでは、Next.jsがGlobal Web APIsを変更しないように決定し、fetchを使用する際のキャッシュに関する問題が解決されたと説明されています。これは、ウェブアプリケーションの互換性と予測可能性を高めるための重要な変更であり、ビデオの内容に密接に関係しています。

💡SSG (Static Site Generation)

Static Site Generationは、ウェブサイトを事前にレンダリングし、静的なファイルとして提供することでウェブサイトのパフォーマンスを向上させる方法です。ビデオでは、Next.jsのデフォルトのレンダリング戦略としてSSGが使用されており、PPRと組み合わせて使用される例も紹介されています。これは、ウェブサイトの高速化とスケーラビリティに重要な役割を果たすキーワードです。

💡Turbopack

Turbopackは、ウェブ開発者がウェブサイトのファイルを高速にバンドルするためのツールです。ビデオでは、Next.js 15が開発モードでTurbopackを主なバンドラーとして採用し、開発プロセスを高速化するという点に言及されています。これは、開発者の生産性とウェブアプリケーションのパフォーマンスに直接関係する重要な技術です。

💡Next After

Next Afterは、Next.js 15で導入された新しい機能で、サーバーがウェブサイトコードを提供する際に重要なタスクを優先して処理し、その後に他のタスクを実行するように設計されています。ビデオでは、YouTubeのビューカウンターを例にNext Afterの使い方を説明しており、ユーザーエクスペリエンスを向上させるための重要な機能です。

Highlights

GMO Rouch, CEO of Versel, emphasizes speeding up development processes.

Next.js 15 aims to improve caching and hydration errors.

Developers express concerns about Next.js having too much 'magic' and potential app rewrites.

Introduction of a quick guide outlining Next.js 15 features.

Release candidate (RC) status of Next.js 15, moving to general availability (GA) later this year.

Next.js 15 supports React 19, including new React compiler features.

React compiler optimizes code by eliminating useMemo and useCallback hooks.

Next.js 15 stops modifying global web APIs, fixing issues with fetch and route handlers.

Introduction of PPR (Partial Pre-Rendering) for combining SSG and SSR.

Next.js introduces 'Next After' to prioritize important tasks on the server.

Instructions for using Next.js 15 features with MPX create next app.

Next.js 15 adopts TurboPack for faster development bundling.

Support for bundling external packages in the app directory to reduce latency.

Introduction of Vercel's AI streaming responses while creating final output.

Announcement of upcoming updates to Next.js course to include new features.

Transcripts

play00:00

yesterday GMO Rouch the CEO of versell

play00:04

realize that I'm spending weeks just

play00:06

setting up all this stuff around react

play00:09

instead he spent eight years to speed up

play00:12

that process for every other developer

play00:15

next GS5 aims to achieve that cashing no

play00:19

longer sucks yeah cashing improvements

play00:22

hydration errors improved developers not

play00:26

yet ready saying that nextjs is eating

play00:29

react that there's too much magic going

play00:32

on and thinking they'll have to rewrite

play00:34

their apps to keep up I used to agree

play00:37

with all of these claims but I no longer

play00:40

do this is not my first rodeo so for

play00:42

that reason in this video I'll give you

play00:45

a quick noons breakdown of what happened

play00:49

during versel ship conference and bring

play00:51

you up to date and no this isn't

play00:53

sponsored by Rell it's just my honest

play00:56

take on the news alongside this video

play00:58

I've also prepared a quick next 15 guide

play01:02

that outlines the most important new

play01:04

features check it out in the description

play01:06

with that said you don't need to run to

play01:08

update your code immediately RC stands

play01:11

for release candidate meaning it will

play01:14

move to GA or general availability later

play01:17

this year while they wait for react 19

play01:20

to be fully supported and I'm happy to

play01:22

say that we'll update our ultimate nsgs

play01:25

course to v15 as soon as that happens

play01:28

teaching you how to Leverage The most

play01:30

important react 19 features and react

play01:33

compiler which next 15 supports by

play01:36

default improved caching methods partial

play01:39

pre-rendering and even this new next

play01:42

after thingy and to make sure I can

play01:44

explain it properly I've already done

play01:46

the research in the next 15 guide you

play01:48

can already start learning about all

play01:50

this stuff first and foremost next 15

play01:54

now supports react 19's use replacing

play01:58

most react hook or everybody's pain of

play02:01

having no ability to pass ref as a prop

play02:05

but what's even more interesting is that

play02:07

nextjs now supports the newly open-

play02:10

sourced react compiler which optimizes

play02:13

your code out of the box eliminating use

play02:16

memo and use callback Hooks and that's

play02:19

great for multiple reasons having been a

play02:22

developer for a long time it has been a

play02:24

huge pain to see many developers either

play02:27

skipping or misusing these optimization

play02:31

techniques this is where react compiler

play02:34

comes into the picture it helps your app

play02:37

run faster by automatically figuring out

play02:40

which parts of your code do or don't

play02:43

need to be rechecked if they haven't

play02:44

changed saving time and if you're

play02:47

interested in understanding the inner

play02:49

workings of react compiler make sure to

play02:52

check out the official docs explaining

play02:54

how it chooses which components to

play02:56

memorize or to skip moving ahead next

play02:59

nextjs has finally decided to stay away

play03:02

from modifying Global web apis before

play03:06

next 15 using fetch would cash its

play03:09

results for you this upset some devs as

play03:12

nextjs was directly changing the global

play03:15

API but after seeing the confusion it

play03:18

caused they fixed it it was similar with

play03:20

route handlers by default get API routes

play03:24

were being cached which left everyone

play03:26

confused wondering why do I keep getting

play03:29

the same results over and over it was

play03:32

meant to be helpful but it backfired so

play03:35

thankfully nextjs HT us and starting

play03:38

from next 15 fetch route handlers and

play03:41

client navigation using link won't

play03:44

automatically cash results anymore but

play03:47

if you do want to cash something you can

play03:49

simply pass a flag to make it happen you

play03:52

might have heard me talking about SSG

play03:55

ISR and SSR plenty of times in my

play03:58

courses by default

play04:00

nextjs performs an SSG rendering

play04:03

strategy and to use the other two we can

play04:06

just provide a flag to that page and

play04:08

switch to them immediately but you

play04:11

needed to choose only one now we can do

play04:14

something else entirely we can make one

play04:17

part of the page SSG while the other

play04:19

part of the page is SSR or ISR combining

play04:24

The Best of Both Worlds this new

play04:27

approach is called PPR part partial

play04:30

pre-rendering and if you're wondering

play04:32

whether this could actually be helpful

play04:34

and work as described it does it really

play04:37

does and to show you here's the demo

play04:40

using this PPR strategy keep your eyes

play04:43

glued on the screen while I explain this

play04:45

notice that if you refresh the page

play04:48

you'll see that the product details

play04:50

remain static while the recommended

play04:52

products and pricing update with each

play04:55

refresh another use case of partial

play04:57

pre-rendering can be found within our

play05:00

Dev overflow application where question

play05:03

details can stay static with SSG while

play05:06

the voting and answers are Dynamic with

play05:10

SSR so if you're enrolled in our next GS

play05:13

course you'll soon find a new section

play05:15

that covers this feature and explains

play05:17

how to implement it in any nextjs

play05:20

project another cool feature nextjs has

play05:23

introduced is next after a bit of a

play05:26

confusing name but I think it makes

play05:28

sense when the browser requests the

play05:31

website code the server does a bunch of

play05:33

stuff to send it back to you but many

play05:36

times alongside the website it also

play05:38

needs to do extra things now it's not

play05:41

fair that you have to wait longer just

play05:44

because the server has some extra stuff

play05:46

to do so next after lets the server do

play05:49

all the important stuff first and only

play05:52

then it takes care of the extra tasks

play05:55

without making you wait a real example

play05:58

of where you would use this is is

play06:00

YouTube views YouTube can first process

play06:03

your request and send this video out to

play06:05

you and while you're watching it it can

play06:08

increase the view counter feed the

play06:10

algorithm with your preferences and

play06:12

update the analytics but you get the

play06:14

video first that's how you can use next

play06:17

after but enough talk how can we really

play06:21

use those next 15 features well to use

play06:24

next5 for now you have to run MPX create

play06:28

next app add RC instead of latest but

play06:31

only for now because around the end of

play06:34

this year we're most likely to see all

play06:36

of these features being stable alongside

play06:39

the usual installation questions it will

play06:41

also ask you about turbo Turbo pack is a

play06:45

super organized high-speed bundler for

play06:48

web developers just like webpack bundles

play06:51

up all your websites files and assets

play06:54

turbo pack does the same but faster and

play06:57

smoother from v15 nextjs will begin

play07:01

adopting it as the primary bundler in

play07:03

development mode instead of webpack

play07:06

aiming to speed up development process

play07:08

if you're excited about seeing all of

play07:10

these features in action with a

play07:12

step-by-step video let me know down in

play07:14

the comments and I'll make it nextjs has

play07:17

also added support for bundling external

play07:20

packages in the app directory they're

play07:22

bundled by default to improve the cold

play07:25

start of the application reducing

play07:27

latency and improving the overall World

play07:29

developer experience there have also

play07:31

been so many other changes also not

play07:35

directly related to next 15 but ver

play07:38

cel's latest features they added to v0

play07:41

now their AI streams the response while

play07:44

it's creating the final output no need

play07:46

to wait click it and AI will write the

play07:49

code line by line while you're watching

play07:51

it do it but it's still only making some

play07:54

basic HTML stuff so no need to worry

play07:57

that it will replace you but I have to

play07:59

give it to it it has silky smooth

play08:03

streaming we love

play08:06

streaming that's it for this quick video

play08:09

and I'll see you in the next one have a

play08:11

wonderful day

Rate This

5.0 / 5 (0 votes)

Related Tags
Next.jsReactコンパイラ開発者最適化SSGISRSSRPPRハイドレーションキャッシュウェブ開発
Do you need a summary in English?