goetzrobin / spartan

Cutting-edge tools powering Angular full-stack development.
https://spartan.ng
MIT License
1.13k stars 123 forks source link

BrnColumnDefComponent broken in Angular 17.2 #171

Closed badsgahhl closed 4 months ago

badsgahhl commented 4 months ago

Please provide the environment you discovered this bug in.

Use the table component in any angular 17.2 application.

Which area/package is the issue in?

table

Description

In Angular 17.2 the Input Signal Type changed to a Generic with only one input. The current usage of the BrrnColumnDef Component will break the Application during an 17.2 Update.

Please provide the exception or error you saw

X [ERROR] TS2314: Generic type 'InputSignal<ReadT>' requires 1 type argument(s). [plugin angular-compiler]

    node_modules/.pnpm/@spartan-ng+ui-table-brain@0.0.1-alpha.336_@angular+cdk@17.2.1_@angular+core@17.2.2_@spartan-ng+ui-core@0.0.1-alpha.336/node_modules/@spartan-ng/ui-table-brain/lib/brn-column-def.component.d.ts:10:20:
      10 │ ...adonly class: import("@angular/core").InputSignal<string, string>;

Other information

17.1:

/**
 * `InputSignal` is represents a special `Signal` for a directive/component input.
 *
 * An input signal is similar to a non-writable signal except that it also
 * carries additional type-information for transforms, and that Angular internally
 * updates the signal whenever a new value is bound.
 *
 * @developerPreview
 */
export declare interface InputSignal<ReadT, WriteT = ReadT> extends Signal<ReadT> {
    [SIGNAL]: InputSignalNode<ReadT, WriteT>;
    [ɵINPUT_SIGNAL_BRAND_READ_TYPE]: ReadT;
    [ɵINPUT_SIGNAL_BRAND_WRITE_TYPE]: WriteT;
}

17.2:

/**
 * `InputSignal` represents a special `Signal` for a directive/component input.
 *
 * An input signal is similar to a non-writable signal except that it also
 * carries additional type-information for transforms, and that Angular internally
 * updates the signal whenever a new value is bound.
 *
 * @see {@link InputOptionsWithTransform} for inputs with transforms.
 *
 * @developerPreview
 */
export declare interface InputSignal<ReadT> extends InputSignalWithTransform<ReadT, ReadT> {
}

I would be willing to submit a PR to fix this issue

badsgahhl commented 4 months ago

Should automatically be fixed if the spartan project is updated to any 17.2 version.

toliklevy commented 4 months ago

We have the same problem with select component on angular 17.1.3:

Error: node_modules/@spartan-ng/ui-select-brain/lib/brn-select.component.d.ts:17:10 - error TS2314: Generic type 'InputSignal<ReadT>' requires 1 type argument(s).

dir: import("@angular/core").InputSignal<BrnReadDirection, BrnReadDirection>;
goetzrobin commented 4 months ago

I just released a new version. It's now on 17.3 of Angular. Please let me know if this fixes the issue

goetzrobin commented 4 months ago

@badsgahhl @toliklevy should be good in the newest release