API reference

API リファレンス

公開 import パス、アプリケーションファクトリーの API、依存関係の互換性要件を調べます。

Effront の API は、アプリケーションの定義、実行環境への接続、ビルド時の統合に分かれています。 ページ、ルート、サービス、Server Function は @effront/core で定義し、実行環境、Markdown、スタイリングには対応するパッケージを使います。

公開 API の一覧

インポート先主な APIリファレンス
@effront/coreApplication、PageViewTransitionApplication、コンポーネント
@effront/core/httptoHttpEffect、makeHttpEffectネイティブ HTTP
@effront/core/workerscreateFetchHandler、WorkersRequestContext、Context の読み取り関数Fetch と Workers Context
@effront/cloudflare/workersCloudflareExecutionContext、Cloudflare Context の読み取り関数Fetch と Workers Context
@effront/server/nodeNode.js の serveNode.js / Bun サーバー
@effront/server/bunBun の serveNode.js / Bun サーバー
@effront/server/assetswithAssetsNode.js / Bun サーバー
@effront/alchemy/cloudflareapplicationHttpEffect、makeApplicationHttpEffectAlchemy
@effront/viteeffront、EffrontViteOptionsVite と Cloudflare プラグイン
@effront/cloudflareeffrontCloudflare、EffrontCloudflareOptionsVite と Cloudflare プラグイン
@effront/server/viteeffrontServerNode.js / Bun サーバー
@effront/alchemy/cloudflare/viteeffrontAlchemyAlchemy
@effront/markdowncreateMarkdownCollection、parseMarkdown、MarkdownErrorMarkdown
@effront/tailwindeffrontTailwindTailwind
@effront/markdown/documentMarkdownDocument、MarkdownDocumentPropsMarkdown
@effront/markdown/mathMathMarkdown
@effront/markdown/mermaidMermaidMarkdown

| @effront/core/query | query、queryAtom、stream、streamAtom、型付き Server Function error | Query Server Function、Stream Server Function |

@effront/core の実行時インポートには react-server 条件が必要です。 ホストプロセス全体でこの条件を有効にせず、effront() が構成するアプリケーショングラフ内で使用してください。 アプリケーションのセットアップは はじめに と プラットフォーム を参照してください。

アプリケーションファクトリーの索引

Application.effront<Services>() は次のファクトリーとメソッドを返します。 関連する定義には、同じファクトリーインスタンスか、そこから withMiddleware で派生したファクトリーを使います。

メンバー戻り値リファレンス
Component、Page、Layout、Loading描画内容とルート UI の定義コンポーネント
Routes、Middlewareルートグループとスコープ付きリクエストミドルウェアRoutes と Middleware
ServerFnSchema で検証する Server FunctionServerFn
withMiddleware同じアプリケーション ID を保ち、ミドルウェアを追加した派生ファクトリーApplication
makeアプリケーション定義。サーバーの起動は行わないApplication

依存関係の互換性

通常のセットアップでは、バージョンを付けずにパッケージ名でインストールします。 対応する依存バージョンの範囲は、版数一覧を複製せず、インストールした Effront パッケージの peerDependencies を参照してください。 任意のアダプターや連携パッケージを含めて Effront のバージョンを統一し、再現可能なインストールのためにアプリケーションの lockfile を保持します。 React と React DOM は同じバージョンが必要で、@vitejs/plugin-rsc が提供する RSC トランスポートも、その React と互換性が必要です。 Effront のページ遷移は ViewTransition と addTransitionType を使用します。 アプリケーションとホスト別 Effect パッケージで、整合性のある単一の Effect を使用してください。 Alchemy の更新前には、インストールしたアダプターの peer 要件と統合の互換性に関する説明を確認してください。 Vite 連携の公開 Vite peer dependency は * です。 セットアップガイドでは VitePlus を使用します。