Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Feature request: Qualified subdirectories (directory-based module namespaces)

Aperta
#9,006 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

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.res and Admin/Button.res could 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
References

Thanks!
Ethan

Lingua principale
OCaml
Stelle
7.5k
Fork
483
Merge medio
20h
PR unite (30g)
219

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rescript-lang/rescript

Tutte le issue di rescript-lang/rescript

Issue simili

Altre issue su Compilers

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.