NG-ZORRO / ng-zorro-antd

Angular UI Component Library based on Ant Design
https://ng.ant.design
MIT License
8.87k stars 3.94k forks source link

Feature Request: Update to Angular 10 #5471

Closed xiaoxiangmoe closed 4 years ago

xiaoxiangmoe commented 4 years ago

What problem does this feature solve?

Update to Angular 10

pburgmer commented 4 years ago

Is there a schedule for this?

vthinkxie commented 4 years ago

we will release angular 10 beta soon

dylanvdmerwe commented 4 years ago

Hi @vthinkxie

We are also very interested in upgrading to Angular 10. Zorro is usually the one dependency that causes us to lag behind with keeping up to date with Angular. I understand the Angular 9 upgrade was large due to Ivy and took a while to be released.

What needs to happen to Zorro to enable the upgrade to Angular 10? The timeline given on Twitter was for a Sept release. Is this still on?

vthinkxie commented 4 years ago

Hi @dylanvdmerwe we have released 10.0.0-beta.2, you can have a try

dylanvdmerwe commented 4 years ago

@vthinkxie sorry but I don't see any 10.0.0 releases tagged: https://github.com/NG-ZORRO/ng-zorro-antd/releases

xiaoxiangmoe commented 4 years ago

@dylanvdmerwe see https://www.npmjs.com/package/ng-zorro-antd/v/10.0.0-beta.2

xiaoxiangmoe commented 4 years ago

@vthinkxie is there any breaking change between v9 and v10?

0x80085 commented 4 years ago

Is there any breaking change between v9 and v10?

Possibly, check https://update.angular.io/#9.0:10.0 for info

Also I have tried this with my project and received following error

 ERROR in node_modules/ng-zorro-antd/core/testing/componet-bed.d.ts:4:54 - error TS2314: Generic type 'ModuleWithProviders<T>' requires 1 type argument(s).

    4 declare type ComponentDeps = Array<Type<NzSafeAny> | ModuleWithProviders>;
                                                           ~~~~~~~~~~~~~~~~~~~ 

(Also there's a typo in this class componet-bed.d.ts (should be component imo))

This is related to this Angular migration:

▸ ModuleWithProviders migration.
  As of Angular 10, the ModuleWithProviders type requires a generic.
  This migration adds the generic where it is missing.
  Read more about this here: https://v10.angular.io/guide/migration-module-with-providers

I tried running w latest ng-zorro-antd + Angular 10: ng serve says Compiled successfully but my app is stuck on the splash screen. No errors in the web console are found, to my surprise.

So from my experience, I can confirm the current ng-zorro-antd is not compatible with the latest Angular version yet.

snebjorn commented 4 years ago

So from my experience, I can confirm the current ng-zorro-antd is not compatible with the latest Angular version yet.

That's not true. I'm running @angular: 10.0.7 and ng-zorro-antd: 9.3.0

Only "problem" is the angular cli is complaining A LOT about ng zorro, but it runs fine

xiaoxiangmoe commented 4 years ago
import { NzSelectModule } from 'ng-zorro-antd';

This does not work in antd 10 and we should import from ng-zorro-antd/select.

It seems unnecessary to deprecate this API, because angular 9 improves tree shaking.

CipherdevNL commented 4 years ago

Hi Ant design team,

The company I work for wants to update to the next version of Angular. But it's not possible because we can't safely update ant-design. Almost 2 months have passed since the release of Angular 10. For Angular 9 it was understandable for the introduction of Ivy.

Is it possible that the next version of Angular (11) ant-design can be updated more quickly. If I understand it correclty now there are also other changes made when there is an Angular update. But can't these changes be introduced in a minor version? (Or maybe already made before Angular has released the next version)

wzhudev commented 4 years ago

@kingbreddo Hi! You can try v10-beta.2 which is compatible with Angular 10 but not contains features and potential breaking changes we would like to introduce in 10.x. The core team is busy with other tasks at the moment but we promise the work will be done. Thanks for your patience. ❤️

0x80085 commented 4 years ago

@snebjorn Oh, thanks for mentioning it does work. Then there must be smth wrong in my project. Which is what I actually wanted to know :+1:

Also @wendellhu95 thanks for the update :heart:

CipherdevNL commented 4 years ago

@wendellhu95 Thank you for the reply and update. I've updated ant-design to 10.0.0-beta.2 and 10.0.0-beta.4. But by both versions npm is still complaining about an Angular dependency mismatch.

Regarding the upgrade time, I can understand that the core team is busy with other tasks. And as far as I'm concerned, ng-zorro-antd v10 doesn't have to be released tomorrow or any time soon. So don't feel pressure to release ng-zorro-antd v10 very soon.

What I'm trying to achieve is a faster upgrade process for future ng-zorro-antd versions (So version 11+). As you stated the beta.2 version contains only Angular 10 compatibility fixes. So that means that beta.3 and beta.4 contain new ant-design features/changes.

In my opinion, it would be better if the ant-design team was already working on the beta.3 and beta.4 changes prior to the Angular 10 release. And when Angular 10 has been released that only fixes should be made to make ng-zorro-antd compatible with Angular.

If I miss something please correct me. (E.g. ant-design or company policies etc. )

dylanvdmerwe commented 4 years ago

Angular 10 was released on 2020-06-24. There were many betas and release candidates to get ng-zorro compatible.

It becomes bad when we all have to continue holding back on updating to a new main version for over 2 months just for 1 dependency. This is a pattern with zorro as seen with compatibility only arriving months after the angular version was released. Sure angular 9 was a big change because of Ivy.

I appreciate everything that the team is doing, but please note that it is important to stay in sync with major Angular releases. That is why they release so many betas and RCs.

It also doesn't help that the version 10 of Zorro releases is not tagged correctly on Github.

vthinkxie commented 4 years ago

Hi all

There will some changes that will be introduced in the v10 version, we want to fix some issues that has been opened from quite long ago like incorrect data handling in the tree component.

There are also some new features and changes in our plan such as the menu directive will turn into a component(but the directive is compatible in v10)

Unfortunately, all of our members' bandwidth is full these two months(the opensource won't pay us, but our job are based on the beta version of the ng-zorro-antd already, so if you urgent to upgrade to v10, you can use ng-zorro-antd@next version)

All the upgrade works will start before Sep and we will release the v10 stable version in Sep

Thanks for all you guys

gemron commented 4 years ago

谢谢你们的努力,加油!

xiaoxiangmoe commented 4 years ago

@vthinkxie import { NgZorroAntdModule } from 'ng-zorro-antd'; 这种 API 要被废弃了吗?(Angular 9 之后加上了 tree shaking,理论上,用得正确的话,这种用法也不会造成包体积膨胀)

vthinkxie commented 4 years ago

@vthinkxie import { NgZorroAntdModule } from 'ng-zorro-antd'; 这种 API 要被废弃了吗?(Angular 9 之后加上了 tree shaking,理论上,用得正确的话,这种用法也不会造成包体积膨胀)

tree shaking 每个版本都存在,引入整体包的问题不在于体积膨胀,而是在于treeshaking需要的编译时间和内存

xiaoxiangmoe commented 4 years ago

所以这个 API 会在下个版本废弃吗?如果要废弃,我们得排期,改我们的下游组件库适配一下。

vthinkxie commented 4 years ago

所以这个 API 会在下个版本废弃吗?如果要废弃,我们得排期,改我们的下游组件库适配一下。

会的,在10.0.0 上会废弃掉,如果你们之前使用的是9.x应该已经有warning了

dylanvdmerwe commented 4 years ago

Angular 10.1.0 is now out and still no sign of Zorro support. How are we looking here? We're in September.

ccppprogrammer commented 4 years ago

@vthinkxie All the upgrade works will start before Sep and we will release the v10 stable version in Sep

It's almost the end of September and angular released 11.0.0-next.2 a week ago, but we still stuck on angular9. Any news on ng-zorro-antd release for angular10?

adamalfredsson commented 4 years ago

5835 Looks like it has been released now!

vthinkxie commented 4 years ago

Hi all v10 has been released https://github.com/NG-ZORRO/ng-zorro-antd/releases/tag/10.0.0 more features will come at 10.x versions