Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add secondary entries #3234

Merged
merged 7 commits into from
Apr 19, 2019
Merged

Conversation

wzhudev
Copy link
Member

@wzhudev wzhudev commented Apr 8, 2019

close #700

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Build related changes: support both `NgZorroAntdModule` and secondary modules
[ ] CI related changes
[ ] Documentation content changes
[ ] Application (the showcase website) / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #700

Users could only import NgZorroAntdModule to their modules, thus bundles are not optimized enough for projects that only use several the components.

What is the new behavior?

Secondary modules and entries are available now. Say a user only wants to render a NzButton on the screen, he can import NzButtonModule instead of `NgZorroAntdModule. Building is faster and the bundle's size is reduced from 432KB to 242KB.

屏幕快照 2019-04-11 12 21 22

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@wzhudev
Copy link
Member Author

wzhudev commented Apr 9, 2019

Circular imports

These modules have circular imports:

  • menu & dropdown (solved)
  • tree & tree-select (solved)

Reasons for circular imports are the same: component B wants to know if it's wrapped in component A:

  • Tree wants to know if it's in a tree-select.
  • Menu wants to know if it's in a dropdown.

CSS

  • Now we will compile style for each component.
  • Other basic of shared styles are compiled to style/index.css.

Official website

  • Now the official website built on netlify for preview purpose is built from the source code of the components.

@netlify
Copy link

netlify bot commented Apr 11, 2019

Deploy preview for ng-zorro-master ready!

Built with commit 3982d19

https://deploy-preview-3234--ng-zorro-master.netlify.com

@wzhudev wzhudev marked this pull request as ready for review April 12, 2019 02:54
@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #3234 into master will increase coverage by <.01%.
The diff coverage is 99.16%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3234      +/-   ##
==========================================
+ Coverage   97.51%   97.52%   +<.01%     
==========================================
  Files         562      607      +45     
  Lines       11852    11864      +12     
  Branches      866      867       +1     
==========================================
+ Hits        11558    11570      +12     
  Misses        183      183              
  Partials      111      111
Impacted Files Coverage Δ
components/dropdown/nz-dropdown.service.ts 100% <ø> (ø) ⬆️
components/date-picker/lib/util.ts 100% <ø> (ø) ⬆️
...omponents/date-picker/lib/candy-date/candy-date.ts 100% <ø> (ø) ⬆️
components/cascader/nz-cascader-li.component.ts 94.44% <ø> (ø) ⬆️
components/core/util/check.ts 91.66% <ø> (ø) ⬆️
...nts/core/no-animation/nz-no-animation.directive.ts 95.23% <ø> (ø) ⬆️
components/core/logger/logger.service.ts 72.22% <ø> (ø)
components/core/tree/nz-tree-base-node.ts 93.38% <ø> (ø)
...ts/date-picker/lib/calendar/ok-button.component.ts 100% <ø> (ø) ⬆️
components/core/testing/public-api.ts 100% <ø> (ø) ⬆️
... and 228 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b4bde4...3982d19. Read the comment docs.

docs/getting-started.zh-CN.md Outdated Show resolved Hide resolved
docs/getting-started.zh-CN.md Outdated Show resolved Hide resolved
@hsuanxyz
Copy link
Member

@vthinkxie stackblitz 能改成按需引入吗?这样可能会提高加载速度,也许还能暴露一些 bug,可以先发 next 测试一下

@vthinkxie
Copy link
Member

@vthinkxie stackblitz 能改成按需引入吗?这样可能会提高加载速度,也许还能暴露一些 bug,可以先发 next 测试一下

可以的,你们先review完,我这边还有一些工作,合并完之后可以先发next

Copy link
Member

@hsuanxyz hsuanxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avatar 组件 .spec.ts 文件改漏了

Copy link
Member

@hsuanxyz hsuanxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core/style/index.less 也需要编译,并且在 【快速上手/二级入口】 中说明,因为里面对有些组件样式进行了覆盖。

components/tree-select/nz-tree-select.service.js Outdated Show resolved Hide resolved
components/tree/interface.ts Outdated Show resolved Hide resolved
@wzhudev wzhudev force-pushed the secondary-entry branch 3 times, most recently from c443b15 to ba28816 Compare April 18, 2019 11:40
Wendell added 6 commits April 19, 2019 11:27
close NG-ZORRO#700

fix: fix imports in components and specs

fix: circular import of tree and tree-select

fix(module:menu,dropdown): fix circular import

fix(module:*): fix imports

build: fix build

build: fix primary important

docs: fix doc site build

fix: build

build: add css secondary entries

docs: update doc

fix: imports in tests

fix: fix updatehostservice in submenu component

docs: change docs on gettings started

docs: specify version

fix: fix styles and update docs

docs: update docs

fix: fix tooltip and patch files

build: fix primary entry

fix: core export bug

fix: fix nz_i18n injection error

fix: fix dropdownservice provide position

fix: fix missing import

docs: fix CONTRIBUTING.md

fix
@hsuanxyz hsuanxyz merged commit 53724be into NG-ZORRO:master Apr 19, 2019
@wzhudev wzhudev deleted the secondary-entry branch April 20, 2019 02:27
andrew-yangy pushed a commit to andrew-yangy/ng-zorro-antd that referenced this pull request Jun 20, 2019
* build: add secondary entries
close NG-ZORRO#700

fix: fix imports in components and specs

fix: circular import of tree and tree-select

fix(module:menu,dropdown): fix circular import

fix(module:*): fix imports

build: fix build

build: fix primary important

docs: fix doc site build

fix: build

build: add css secondary entries

docs: update doc

fix: imports in tests

fix: fix updatehostservice in submenu component

docs: change docs on gettings started

docs: specify version

fix: fix styles and update docs

docs: update docs

fix: fix tooltip and patch files

build: fix primary entry

fix: core export bug

fix: fix nz_i18n injection error

fix: fix dropdownservice provide position

fix: fix missing import

docs: fix CONTRIBUTING.md

fix

* fix: fix import in breadcrumb

* fix: some lint

* fix: some lint

* fix: less import in component.less

* docs: fix some docs

* docs: notice ngzorroantdmodule
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this pull request Apr 9, 2020
* build: add secondary entries
close NG-ZORRO#700

fix: fix imports in components and specs

fix: circular import of tree and tree-select

fix(module:menu,dropdown): fix circular import

fix(module:*): fix imports

build: fix build

build: fix primary important

docs: fix doc site build

fix: build

build: add css secondary entries

docs: update doc

fix: imports in tests

fix: fix updatehostservice in submenu component

docs: change docs on gettings started

docs: specify version

fix: fix styles and update docs

docs: update docs

fix: fix tooltip and patch files

build: fix primary entry

fix: core export bug

fix: fix nz_i18n injection error

fix: fix dropdownservice provide position

fix: fix missing import

docs: fix CONTRIBUTING.md

fix

* fix: fix import in breadcrumb

* fix: some lint

* fix: some lint

* fix: less import in component.less

* docs: fix some docs

* docs: notice ngzorroantdmodule
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
* build: add secondary entries
close NG-ZORRO#700

fix: fix imports in components and specs

fix: circular import of tree and tree-select

fix(module:menu,dropdown): fix circular import

fix(module:*): fix imports

build: fix build

build: fix primary important

docs: fix doc site build

fix: build

build: add css secondary entries

docs: update doc

fix: imports in tests

fix: fix updatehostservice in submenu component

docs: change docs on gettings started

docs: specify version

fix: fix styles and update docs

docs: update docs

fix: fix tooltip and patch files

build: fix primary entry

fix: core export bug

fix: fix nz_i18n injection error

fix: fix dropdownservice provide position

fix: fix missing import

docs: fix CONTRIBUTING.md

fix

* fix: fix import in breadcrumb

* fix: some lint

* fix: some lint

* fix: less import in component.less

* docs: fix some docs

* docs: notice ngzorroantdmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

perf: standalone/secondary entry modules
4 participants