Feature request: Qualified subdirectories (directory-based module namespaces)
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
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- ocaml
- Ambito
- compilers
Direzione di ricerca
Read the existing recursive source scanning behavior described in the issue and the related proposals #1974, #1805, and #2459. The issue does not name implementation files or tests; first locate where subdirs: true is handled in the compiler and review its module naming rules. Done means an opt-in qualified mode supports the shown directory hierarchy and duplicate filenames while preserving the default behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Feature request: Qualified subdirectories (directory-based module namespaces)
Hi! I've been using ReScript a bit in my free time recently, and have been really enjoying it. However I've found it quite difficult/frustrating to organize code/packages using ReScript's existing tooling (even when using the "monorepo" features).
I'd like to propose an opt-in feature similar to Dune's (include_subdirs qualified), where source directories automatically become part of the ReScript module hierarchy.
For example, given:
src/
App.res
Components/
Button.res
Input.res
Admin/
Button.res
App.res could reference Components.Button, Components.Input, and Admin.Button.
This would provide two benefits:
- Better code organization: Module hierarchies could mirror the filesystem without manually creating wrapper modules.
- Duplicate filenames: Files such as
Components/Button.resandAdmin/Button.rescould coexist without module-name collisions.
Currently, recursive source scanning (subdirs: true) places all files in a flat module namespace.
Ideally, this would be an opt-in configuration (perhaps subdirs: "qualified"), preserving existing behavior by default. Directory modules could be implemented using compile-time aliases, without introducing additional JavaScript runtime wrappers.
Related issues
- [#1974 — Allow duplicate filenames / path-derived module names](https://github.com/rescript-lang/rescript/issues/1974): Closely related proposal, including examples like
Pages__Index. - [#1805 — Namespace proposal](https://github.com/rescript-lang/rescript/issues/1805): Earlier work on package-level namespaces.
- [#2459 — Recursive subdirectory scanning](https://github.com/rescript-lang/rescript/issues/2459): Related source-discovery functionality, but without directory qualification.
References
Thanks!
Ethan
- Lingua principale
- OCaml
- Stelle
- 7.5k
- Fork
- 483
- Merge medio
- 20h
- PR unite (30g)
- 219
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un 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 rescript-lang/rescript
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
rescript-lang/rescript#9037 ·
I maintainer di solito rispondono entro 1 giorno
-
RFC: Temporal API bindingsAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
rescript-lang/rescript#9044 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
rescript-lang/rescript#8997 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
rescript-lang/rescript#8994 ·
I maintainer di solito rispondono entro 1 giorno
-
Have formatter insert newlines around multi-line expressionsForse già presa @rolandpeelen l’ha presa 4 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
rescript-lang/rescript#8960 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rescript-lang/rescript
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
manuscript-lang/manuscript#1604 ·
I maintainer di solito rispondono entro 1 giorno
-
rust testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
NekomyaDev/nudge#275 ·
I maintainer di solito rispondono entro 1 giorno
-
crash lld:COFF
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
llvm/llvm-project#235970 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug scope:types
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100