Compile to non-linear routing strategies
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 20/100
調査の方向性
ファイルやテストは指定されていません。まず context と HTTP 動詞のエンドポイントマクロを追跡し、次にそれらが Compojure のルートへどのように展開されるか、また分離されたエンドポイント関数がどのように扱われるかを調べてください。HTTP 動詞によるルーティングを含む、より効率的な非線形ルーティング戦略をサポートし、直近の context の外側にあるルートを失わないようにできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
These will probably have to be different than reitit's since route conflicts are idiomatic. We'll probably want more types of routing between trie and linear.
I think routing based on HTTP verb is a good start;
e.g.,
(context "/foo" []
(GET "/bar" [] (ok 1))
(POST "/bar" [] (ok 1))
(PUT "/bar" [] (ok 1))
(PATCH "/bar" [] (ok 1)))
=>
(context "/foo" req
(case (get-http-verb req)
:GET (GET "/bar" [] (ok 1))
:POST (POST "/bar" [] (ok 1))
:PUT (PUT "/bar" [] (ok 1))
:PATCH (PATCH "/bar" [] (ok 1))))
This could probably be achieved at runtime by reifying some of the structure of a route macro at runtime.
Maybe a static context can communicate to its endpoints to return a data representation of themselves instead of expanding to compojure and the static context can compile a more efficient router.
This could be accomplished more dynamically by having context bind a dynamic variable and expanding endpoints to code that checks for this variable to decide whether to return a data representation or a compojure route.
This has the advantage over static transformation under a context of working even if the endpoint is not directly under the context (say, separated by a function call).
- 主要言語
- Clojure
- スター
- 1.1k
- フォーク
- 145
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
metosin/compojure-api のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
metosin/compojure-api#489 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
metosin/compojure-api#468 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
metosin/compojure-api#464 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
metosin/compojure-api#463 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
metosin/compojure-api#462 · コメント 3 件 ·
metosin/compojure-api の issue をすべて見る
似ている issue
-
Permissioned transactions fetch each entity once per tx-step, producing huge permission-check queries対応中かも @verveguy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 半日 初心者へのやさしさ 84/100
clojure-lsp/clojure-lsp#2502 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信