Improved prefix support for verified routes
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
Direzione di ricerca
Start at Phoenix.VerifiedRoutes and trace how the existing path_prefixes option is parsed and applied to ~p routes. Define the route-dependent behavior for :locale prefixes, including coexistence with unprefixed routes and multiple prefixes, then verify the implementation against the proposed syntax.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
use Phoenix.VerifiedRoutes currently supports path_prefixes: [{Gettext, :get_locale, []}] as an option. This is quite limiting though, because it's a static prefix set per module (per use call). ~p"/somewhere" implicitly gets the prefix applied based on context alone.
Often prefixes also happen to be mixed in with non prefixed routes in templates (e.g. in the app layout) and the need for distinct modules makes this confusing.
I'm proposing changing the option to path_prefixes: %{"locale" => {Gettext, :get_locale, []}}, which makes applying the prefix depend on the route provided like so: ~p"/:locale/somewhere". This clearly indicates the use of a prefix, while allowing for multiple prefixes as well as no prefix to coexist.
- Lingua principale
- Elixir
- Stelle
- 23.2k
- Fork
- 3.2k
- Merge medio
- 1g 3h
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di phoenixframework/phoenix
-
~p treats routes as static when they only start with a static directory nameForse già presa @mandar1045 l’ha presa 2 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 30/100
phoenixframework/phoenix#6895 ·
I maintainer di solito rispondono entro 1 giorno
-
Connection: close header not sent before closing HTTP 1.1 connection when a controller raises an exceptionForse già presa @javiergarea l’ha presa 30 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
phoenixframework/phoenix#6859 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
phoenixframework/phoenix#6853 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
LongPoll session tokens are not bound to the mount path or socket handlerForse già presa @SteffenDE l’ha presa 76 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
phoenixframework/phoenix#6791 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
phoenixframework/phoenix#6785 · 5 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di phoenixframework/phoenix
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
component:obi contribfest go test
Difficoltà 2/5 Meno di un'ora Idoneità per principianti 77/100
open-telemetry/opentelemetry-ebpf-instrumentation#4142 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
ash-project/ash_typescript#111 ·
-
4.0.0 is released!Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 83/100
-
Aggregate takes a snapshot on the first command after being restored from a snapshotForse già presa @a-nassim l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100