loopbackio / loopbackio/loopback-next

How to build a new API transport extension (or migrate a LB3 one)

オープン
#5,425 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Docs epic Extensions Migration
主要言語
TypeScript
スター
5.1k
フォーク
1.1k
平均マージ
2日 21時間
マージ済み PR(30日)
27

説明

This story is extracted from #4099, where we researched existing LoopBack 3 components and various techniques they use.

Now we need to write documentation for extension authors to show how to solve the following use cases in LoopBack 4:

  1. A new server type to handle requests coming from a non-REST source, e.g. Primus/WebSockets and RabbitMQ.

  2. WebSockets: mount WebSocket-handler on the underlying http server used by @loopback/rest.

  3. Message queues: allow consumers to also produce (publish) new messages, e.g. as a response to the incoming message.

Prior work:

I see the following major areas to cover (feel free to add more items to this list):

  • How can a transport implementation discover endpoint handlers (controllers, routes, message consumers, etc.) registered in the application context? (Related: How can extensions introspect application artifacts #5426)
    • Also how to handle handlers added dynamically after application has started
  • How should be a transport extension structured like?
    • Ensure that app.start() will start the server/subscriber, app.stop() stop it
    • How to create a per-request context and populate it with request-specific metadata

In most cases, the new content will be useful to authors building new LB4 components too, therefore we should structure the content in two parts:

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず既存の Creating servers ドキュメントを読み、その後 Extending LoopBack 4 と Migrating components and extensions のガイドを確認します。コンポーネントサービス、トランスポートハンドラーの検出、動的ハンドラー、アプリケーションの起動と停止、WebSockets とメッセージキューのリクエストごとのコンテキストを扱います。両方のガイドで、一覧にあるユースケースと移行固有の考慮事項が明確に説明されていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
node.js, typescript
領域
backend-api-design, documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
28/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。