Feature Request: Support document.baseURI resolution
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- react, typescript
調査の方向性
まず Router と Link のエントリーポイント、および base 値と hrefs の既存の処理を読んでください。提案されている document.baseURI ベースの相対解決を現在の ~ の動作と比較し、その後、既存のテストスイートを実行して、カバレッジが必要なルーティングケースを特定してください。カスタマイズ可能な document のベースパスが一貫して解決され、現在のリンクを壊さなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
I have an application that is configured to deploy to a customizable base path (configured at runtime not build time), which is defined on the document using <base /> and accessible via document.baseURI. Because of this, ~ loses its utility and the base router's base value is tricky-at-best.
The URL class can be used to resolve these things but, at least so far, I haven't come up with a clean way to use Wouter's current functionality to support this use case. Is there a good way to do this today?
Proposed Behavior
What I would love is to be able to do something like this:
<Router base=".">{/* resolves under the hood to (new URL(document.baseURI).pathname) */}
<Link href="/bat">Bat</Link>{/* Because this is under base=".", this becomes "./bat" -> <base>/bat */}
<Link href="~/foo">Foo</Link>{/* links to <base>/foo from anywhere */}
{/* OR, if we don't want to overload the ~ semantics: */}
<Link href="./bar">Bar</Link>{/* pretty simple: new URL("./bar", document.baseURI), leaving: -> <base>/bar */}
<Link href="~/bing">Bing</Link>{/* links to /foo from anywhere as it does today */}
- 主要言語
- TypeScript
- スター
- 7.9k
- フォーク
- 193
- 平均マージ
- 6分
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
molefrog/wouter のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
Links using ~ do not respect `base`対応中かも @molefrog が 24 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
molefrog/wouter の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
better-auth/better-auth#12132 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
hurttlocker/o8#5112 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
webrecorder/wabac.js#386 ·
-
needs-triage
難易度 1/5 1〜3時間 初心者へのやさしさ 92/100
agent-of-empires/agent-of-empires#5098 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信