NgModule: forwardRef(ns.X), ns.X.forRoot() and spread/const lists are not resolved (`.d.ts` gets `never`)

オープン
#703 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
compilers

調査の方向性

Start by reading the ModuleLists implementation and the evaluator used for .d.ts references in #697; the issue does not name source files or tests. Trace how NgModule imports and exports are evaluated, then check that forward references, forRoot() calls, and spread or const lists resolve in declarations and JIT scopes. Done means those cases match the ngtsc behavior shown in the issue.

索引モデルが issue の本文から書いたものです。

説明

Found while reviewing #697. Checked against ngtsc 22.2.4. ngtsc resolves NgModule lists statically. Oxc keeps the raw text, so the .d.ts gets never. Consumers then can't see what the module exports, and JIT scopes keep the call expressions.

import * as dep from './dep';
@NgModule({ imports: [forwardRef(() => dep.DepModule), dep.DepModule.forRoot()] }) export class M {}
           ngtsc                                                         Oxc
.d.ts      ɵɵNgModuleDeclaration<M, never, [typeof i1.DepModule,         ɵɵNgModuleDeclaration<M, never, never, never>
             typeof i1.DepModule], never>
scope      setNgModuleScope(M, { imports: [i1.DepModule, i1.DepModule] }) setNgModuleScope(M, { imports: [forwardRef(() => dep.DepModule), dep.DepModule.forRoot()] })
import { DepModule } from './dep';
const LIST = [DepModule];
@NgModule({ imports: [...LIST], exports: LIST }) export class M {}
           ngtsc                                                         Oxc
.d.ts      ɵɵNgModuleDeclaration<M, never, [typeof i1.DepModule],        ɵɵNgModuleDeclaration<M, never, never, never>
             [typeof i1.DepModule]>
scope      setNgModuleScope(M, { imports: [DepModule], exports: [DepModule] })  setNgModuleScope(M, { imports: [...LIST], exports: LIST })
ɵinj       imports: [LIST, DepModule]                                     imports: [...LIST, LIST]   (same at runtime)

To do: resolve forwardRef(() => ns.X), ns.X.forRoot() (ModuleWithProviders) and spread / const lists in ModuleLists, with the evaluator that #697's .d.ts references use.

主要言語
Rust
スター
245
フォーク
26
平均マージ
1日 23分
マージ済み PR(30日)
83

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

voidzero-dev/oxc-angular-compiler のほかの issue

voidzero-dev/oxc-angular-compiler の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。