generated at
Remix
リンク

規約
app/routes/* - ここに配置したディレクトリやファイルの構成をもとに、routesが定義される
app/root.{jsx,tsx} - ルートレイアウト

Adapter
Remixはアダプタを提供することで様々なプラットフォームをサポートしている
公式のアダプタは @remix-run/{adapter} で配布されている (例: @remix-run/cloudflare-workers , @remix-run/express など)
各アダプタは createRequestHandler() というAPIを提供していて、これを使うことでアプリケーションをserveできる

Resource Routes

環境変数
remix dev でサーバを起動すると、dotenvパッケージを使って環境変数が読み込まれる
remix serve の実行時はdotenvによる読み込みが行われないので注意

サーバサイド
Remixは、Tree-shakingによって、サーバサイド向けのコード( loader / action など)がブラウザ向けのバンドルに紛れ込まないように制御している
また、ファイル名に .server を含めておくことで、Tree-shakingがうまく効かないような状況でもコンパイラがうまく取り扱ってくれるようになる (基本的に、サーバからの利用を想定したモジュールは常に .server を付けておくとよさそう)

関連パッケージ/リポジトリ
remix-auth - Simple Authentication for Remix
remix-image - A React component for responsive images in Remix
remix-ssg - A CLI for building static sites with Remix
remix-hono - Hono middlewares for Remix
remix-fastify - Fastify server request handler for Remix
remix-koa-adapter - Koa request server handler for Remix

テンプレート

関連ページ