Resolve bare .rx specifiers through node_modules so libraries can ship .rx source

Ouverte
#83 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
48/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
node.js, typescript
Domaine
backend, tooling

Piste de recherche

Start with compiler/src/modules.rs, especially join_path and the package_declaration path used for MO-10c. Trace how bare imports are resolved through node_modules, exports, then module/main, and check how resolved .rx files enter checking and lowering. Add coverage for a package exporting an .rx target; done means the example import resolves and is compiled as part of the importing program.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Request

Resolve bare .rx specifiers through node_modules, so that a component library can ship .rx source and consumers import it like any other .rx module:

import { Button } from "@acme/ui/button.rx"

Today

A JS package can already ship a .d.rx beside the file its import resolves to (MO-10c, package_declaration in compiler/src/modules.rs). An .rx import, though, is always joined to the importer's directory (join_path, modules.rs:31). A bare specifier like the one above becomes <importer dir>/@acme/ui/button.rx and fails with MODULE_NOT_FOUND.

Why it matters

Solid component libraries increasingly publish source (.tsx, StyleX source) and let the consumer's compiler build it, rather than shipping dist plus .d.ts. .rx is a natural fit for this, because the consumer's checker then sees the library's real signatures (MO-9), not a hand-written .d.rx. It also matches how @solidjs/vite-plugin already treats .rx as source in the bundle.

Suggested behaviour:

  • Resolve the way MO-10c already does: walk node_modules upward from the importer, then use exports, then module/main.
  • An exports target ending in .rx is then an .rx module, checked and lowered as part of the importing program.
  • A module shared by several programs stays one module, keyed by its factory (CP-4b module).

Happy to test a branch against a real design system.

Langage dominant
TypeScript
Étoiles
127
Forks
7
Merge moyen
15 h 42 min
PR mergées (30 j)
63

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de solidjs/reactivescript

Toutes les issues de solidjs/reactivescript

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.