shlomiassaf / ngrid

A angular grid for the enterprise

Home Page:https://shlomiassaf.github.io/ngrid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build errors after upgrading to 2.2.0

andrewalderson opened this issue · comments

I am getting the following build errors after upgrading to 2.2.0. These also exist in 2.2.1

The package versions I am using are
NGrid - 2.2.1
Angular Core - 10.1.4
Angular CLI - 10.1.4
Typescript - 4.0.2

ERROR in node_modules/@pebula/ngrid/lib/data-source/data-source-base-factory.d.ts:8:324 - error TS2344: Type 'PblDataSource<T, TData, TDataSourceAdapter>' does not satisfy the constraint 'PblDataSource<T, TData, PblDataSourceAdapter<T, TData, PblDataSourceTriggerChangedEvent<TData>>>'.
  Types of property 'adapter' are incompatible.
    Type 'TDataSourceAdapter' is not assignable to type 'PblDataSourceAdapter<T, TData, PblDataSourceTriggerChangedEvent<TData>>'.

8 export declare abstract class PblDataSourceBaseFactory<T, TData = any, TEvent extends PblDataSourceTriggerChangedEvent<TData> = PblDataSourceTriggerChangedEvent<TData>, TDataSourceAdapter extends PblDataSourceAdapter<T, TData, TEvent> = PblDataSourceAdapter<T, TData, TEvent>, TDataSource extends PblDataSource<T, TData> = PblDataSource<T, TData, TDataSourceAdapter>> {
                                                                                                                                                                                                                                                                                                                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@pebula/ngrid/lib/data-source/data-source-base-factory.d.ts:8:348 - error TS2344: Type 'TDataSourceAdapter' does not satisfy the constraint 'PblDataSourceAdapter<T, TData, PblDataSourceTriggerChangedEvent<TData>>'.
  Type 'PblDataSourceAdapter<T, TData, TEvent>' is not assignable to type 'PblDataSourceAdapter<T, TData, PblDataSourceTriggerChangedEvent<TData>>'.
    Type 'PblDataSourceTriggerChangedEvent<TData>' is not assignable to type 'TEvent'.
      'PblDataSourceTriggerChangedEvent<TData>' is assignable to the constraint of type 'TEvent', but 'TEvent' could be instantiated with a different subtype of constraint 'PblDataSourceTriggerChangedEvent<TData>'.

8 export declare abstract class PblDataSourceBaseFactory<T, TData = any, TEvent extends PblDataSourceTriggerChangedEvent<TData> = PblDataSourceTriggerChangedEvent<TData>, TDataSourceAdapter extends PblDataSourceAdapter<T, TData, TEvent> = PblDataSourceAdapter<T, TData, TEvent>, TDataSource extends PblDataSource<T, TData> = PblDataSource<T, TData, TDataSourceAdapter>> {

Checking...

@andrewalderson I couldn't reproduce it in the starter project

I upgrade TS to 4.0.3 and ngrid to 2.2.1

I also tried locally to use infinite scroll, it did not error with or without it.

This possibly has to do with the new --strict option in the Angular 10 cli. I used it when I created my project because it is supposed to help with optimizations but I think that it is still a work in progress.

I will investigate further this week when I get some time. For now I have removed this component and went back to Material Table.

I'm experiencing the same error when strict: true is set in tsconfig's compilerOptions

I will toggle this option at my end and check.
If this is the only issue in strict mode... I was afraid to get more

But I guess that enabling it in the source code will cause a lot more errors...

Anyway, this might be bypassed but turning off library check in TS