Premium support for our pure JavaScript UI components


Post by elelad »

Hi,
I'm understanding there is a problem with building Angular 10 apps with "buildOptimizer": true In angular.json.

I'm referencing this post: viewtopic.php?f=51&t=15698&hilit=prod&start=20.

We are having an issue (not related to re-rendering) when adding events or resources to the store.
The problem only exists when building to production, and not acquired when we are using "buildOptimizer": false.

FYI, I tested this on angular 11 too - same issue.

We will appreciate some info regarding this issue. Do you have a time estimation for fixing this? We have a really big app, and we want to use every production feature that exists in Angular.

BTW, I think you should add this as a known issue to the integration guide (https://www.bryntum.com/docs/scheduler/#guides/integration/angular.md). It would have saved us a lot of debugging time...


Post by saki »

When buildOptimizer:true then Angular tries to do so called tree-shaking as a part of the building process, which is determining the unused code and not including it in the resulting bundle. Apparently, the tree-shaking is too aggressive because it strips down parts the code that are (or will be) needed.

It's pretty tricky to debug because it may be a bug in Angular itself or it can be the way how our bundles are built.

We need a positive showcase to investigate the problem. Have you tried to reproduce it with any of our demos? Which product do you use (Grid, Scheduler, SchedulerPro, Gantt, Calendar)? Had the problem appeared with a specific Angular version?


Post by plus »

I've the same exact problem.
Scenario:

  • Angular 9
  • Bryntum Scheduler 4.0.8

With a minimal config like that:

export default {
  appendTo: 'test',
  resources: []
  events: []
};

The --prod build doesn't work, as seen on elelad's example.

By setting buildOptimizer to false or using a new config:

export default {
  appendTo: 'test',
};

It works fine.

buildOptimizer: false is a big nono in our project.


Post by saki »

I'd suggest to upgrade to 4.1.0 that uses packages from npm server and all our examples of this version can be built and run with buildOptimizer:true without problems.

Note: There was a couple of angular demos with build optimizer set to false but I've tested the right now and they all work when it is on.


Post Reply