Next.js 15 yangiliklar

Xurshidbek

by Xurshidbek

01 min read

Dec 13, 2024

alt

Share

Eksperimental React Compiler (https://nextjs.org/blog/next-15#react-compiler-experimental). Endi compiler siz o‘rningizga useMemo, useCallback va boshqa optimizatsiyalarni qiladi. Bu degani kod toza, oddiy va tez bo'ladi. Zo'r!

Turbopack local dev uchun stabil bo'ldi (https://nextjs.org/blog/next-15#turbopack-dev) 🎉 Turbopackdan foydalanish uchun: next dev --turbo. Bu localda ishlash jarayonini ancha tezlashtiradi.

Dynamic funksiyalar (https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-functions) (cookies, headers, ...) endi async bo'ladi (https://nextjs.org/blog/next-15#async-request-apis-breaking-change), va ularni await qilishingiz kerak. Buning uchun oddiy codemod (https://nextjs.org/docs/canary/app/building-your-application/upgrading/codemods) bor va qo'lda xech narsani o'zgartirishingiz shart emas.

Endi, default ravishda, Next.js fetch requestlarni, GET Route Handlerslarni va Client Routerni cacheddan uncachedga o‘tkazdi (https://nextjs.org/blog/next-15#caching-semantics). Endi cachedan foydalanish uchun siz cachega opt-in bo'lishingiz kerak. Yangi Next.js dasturchilar uchun bu yaxshi yangilik. Lekin manga oldingi cache defaultlar yoqardi, bu ham yomon emas.

• Endi developmentda, Next.js sizga aniq ko'rsatadi (https://nextjs.org/blog/next-15-rc2#static-route-indicator) – qaysi page static va qaysi page dynamic. Bu narsani next build oldin ham ko'rsatgan. Lekin endi aniq visual ravishda ham bilinadi.

• Yangi <Form> component layout va loading UI-larni prefetch qilib, form submissionda client navigationdan foydalanadi, va agar JS ishlamasa oddiy form-ga fallback qiladi.

Endi next.config.js va next.config.ts (https://nextjs.org/blog/next-15#support-for-nextconfigts) (typescript) support qilinadi. Bu degani NextConfig typedan foydalanshingiz mumkin.

• Hydration xatolar endi tushunish uchun osonroq bo'ldi (https://nextjs.org/blog/next-15#hydration-error-improvements).

• instrumentation.js (https://nextjs.org/blog/next-15#instrumentationjs-stable) yordamida performance va errorlarni monitor qilib Sentry kabi servislarga ma'lumotlarni bervorishingiz mumkin.

• Server actions xavfsizligi yaxshilandi (https://nextjs.org/blog/next-15-rc2#enhanced-security-for-server-actions)

• Self-host qiladiganlar uchun yangiliklar (https://nextjs.org/blog/next-15#improvements-for-self-hosting)

author

Xurshidbek

Loyiha asoschisi

See all posts by this author