Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Compile to non-linear routing strategies

オープン
#467 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
20/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
clojure
領域
api, backend

調査の方向性

ファイルやテストは指定されていません。まず 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 はありません

環境構築

はじめの一歩

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

metosin/compojure-api のほかの issue

metosin/compojure-api の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

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

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