You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Heads-up: ng-zorro-antd on the upcoming @angular/build:library builder
#9973
The Angular team is working on a library builder inside @angular/build that is meant to replace ng-packagr: angular/angular-cli#34106. It isn't merged yet and a migration schematic is planned, so nothing to do now — but I built ng-zorro-antd with it and thought the results were worth sharing early.
Setup: the 105 entry points listed explicitly in components/project.json (the new builder has no ng-package.json discovery — entry points live in the build config), everything else left at its defaults.
What matched: the same 421 files, the same 185 keys in exports including every style and less condition, and identical export names in 206 of the 210 emitted files.
Two things that would break the published package today, both filed upstream with reductions:
Speed, median of 3 runs each on a 14-core machine: clean build 10.7s against ng-packagr's 13.3s, warm 9.2s against 10.3s, and in watch a rebuild after a template edit is 80ms against 88ms. The cost is CPU and memory: 87s of CPU and 7.8 GB peak against 21s and 1.7 GB, since it compiles entry points across 13 worker threads. Watch mode is single-threaded and sits at the same 2.5 GB as ng-packagr.
One thing specific to this repo, for whenever the migration happens: components/date-picker/lib/public-api.ts has no ng-package.json and is an internal barrel. In a config that lists entry points by a pattern it gets picked up as an entry point and the build fails on the sibling-import guard, so it needs to be excluded or renamed. With the explicit list it's a non-issue.
Happy to do the migration PR when the builder lands, if that's useful.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
The Angular team is working on a library builder inside
@angular/buildthat is meant to replace ng-packagr: angular/angular-cli#34106. It isn't merged yet and a migration schematic is planned, so nothing to do now — but I built ng-zorro-antd with it and thought the results were worth sharing early.Setup: the 105 entry points listed explicitly in
components/project.json(the new builder has nong-package.jsondiscovery — entry points live in the build config), everything else left at its defaults.What matched: the same 421 files, the same 185 keys in
exportsincluding everystyleandlesscondition, and identical export names in 206 of the 210 emitted files.Two things that would break the published package today, both filed upstream with reductions:
ng-zorro-antd/i18nlosesNZ_DATE_LOCALE. The name is reached through twoexport *paths that each re-export it fromng-zorro-antd/core/time, and the bundler drops it silently.import { NZ_DATE_LOCALE } from 'ng-zorro-antd/i18n'stops compiling. (library builder: a name re-exported through two "export *" paths is dropped from the bundle angular/angular-cli#34130)tslibis not written into the output package.json, though 34 of the 105 bundles import it. ng-packagr adds it automatically. (library builder: tslib is not added to the output package.json angular/angular-cli#34131)Speed, median of 3 runs each on a 14-core machine: clean build 10.7s against ng-packagr's 13.3s, warm 9.2s against 10.3s, and in watch a rebuild after a template edit is 80ms against 88ms. The cost is CPU and memory: 87s of CPU and 7.8 GB peak against 21s and 1.7 GB, since it compiles entry points across 13 worker threads. Watch mode is single-threaded and sits at the same 2.5 GB as ng-packagr.
One thing specific to this repo, for whenever the migration happens:
components/date-picker/lib/public-api.tshas nong-package.jsonand is an internal barrel. In a config that lists entry points by a pattern it gets picked up as an entry point and the build fails on the sibling-import guard, so it needs to be excluded or renamed. With the explicit list it's a non-issue.Happy to do the migration PR when the builder lands, if that's useful.
All reactions