🏄
Matsuri-tech Frontend Weekly 2023-11-17

hrdtbs

hrdtbs

2023年11月17日
MFWVitePrettierNext.js

社内向けに、フロントエンド関連のニュースや業務で発生したQ&A、利用しているライブラリなどの情報を定期的に書いています。

社内の開発部メンバーに向けて直近でリリースされたライブラリなどの情報をMatsuri-tech Frontend Weeklyとしてまとめています。内容は実務や趣味で使えそうなものを中心に扱っており、網羅的ではなく偏りがあります。

# Vite 5

2023年11月16日にVite 5がリリースされました。

Announcing Vite 5Vite 5 Release AnnouncementAnnouncing Vite 5

Rollup 4を利用するようになりパフォーマンスが向上した他、非推奨な機能の削除が行われました。またCJSのconfigが非推奨になっています。マイグレーションはさほど難しくなさそうです。

ViteNext Generation Frontend ToolingVite

# Prettier 3.1

2023年11月13日にPrettier 3.1がリリースされました。

Prettier 3.1: New experimental ternaries formatting and Angular control flow syntax! · PrettierThis release adds indentation back to nested ternaries along with a new `--experimental-ternaries` flag to try a more novel "curious ternary" format that scales better to deeply nested conditionals. We are keen for [your feedback](https://forms.gle/vwEuboCobTVhEkt66) on the experimental format before it rolls out as the default behavior later this year!Prettier 3.1: New experimental ternaries formatting and Angular control flow syntax! · Prettier

Babel 7.23.0でサポートされた次の構文がサポートされました。

// Source Phase Imports
import source x from "mod";

// Deferred Import Evaluation
import defer * as ns from "mod";

// Optional Chaing Assignments
maybeObj?.props1 = value

三項演算子の新しい整形ルールのフィードバックが募集されています。--experimental-ternariesで試すことが出来ます。

A curious case of the ternaries · PrettierTernary formatting has always been a challenge, and we're finally addressing it in v3.1.0 with the introduction of a novel formatting style.A curious case of the ternaries · Prettier

# PPR - Vercel

Next.js 14で実験的な機能として追加されたPPR (Partial Prerendering)についてのVercelによる記事が公開されました。

Building towards a new default rendering model for web applications – VercelPartial PrerenderingBuilding towards a new default rendering model for web applications – Vercel

PPR は、動的な部分を <Suspense> で包むことで部分的に動的レンダリングを行い、それ以外の部分を静的にレンダリングすることで、ISRとSSRの長所を組み合わる手法です。今後のデフォルトのレンダリングモデルになる可能性が示唆されています。