Page 1 of 2

[ANGULAR] Bundle size (again)

Posted: Tue Apr 05, 2022 4:50 pm
by oleh

Hello, thank you for your amazing product!

We use the Scheduler in our Angular app, and the scheduler bundle size is quite large. Is it possible to use the technique described in 'Custom build using WebPack' example to decrease the bundle size by not including features we don't need?

But I can see that 'scheduler-angular' wrapper imports everything from the lite bundle @bryntum/scheduler/scheduler.lite.umd.js, so probably we can't, right? Should we write our own angular wrapper, maybe?..

What do you think?


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 8:51 am
by alex.l

Yes, in case you want to decrease bundle size, you'll be needed to write your own wrapper (you can find source code or our wrapper in its npm package), and create your own bundle from our source code.
You might try it with our wrapper, but very possible you'll have problems with exports that wrapper will be required in. We didn't test it.


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 9:02 am
by alex.l

We've opened a ticket to dive into that and find best ways to achieve that https://github.com/bryntum/support/issues/4466


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 9:14 am
by oleh

Thank you!

Unfortunately, there are no angular wrapper sources in npm package, at least for version 4.3.5, that we use. It would be good to have them.


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 9:50 am
by alex.l

4.3.5 is pretty old, and wrapper has some bugs that we fixed in new versions. It might save you a lot of time in the future if you do upgrade before implement your custom code.
In case wrapper is not imported from the npm in that version, you imported it as a file, so that's easy to find it. It will be also available in our examples for react.
If it's imported from package, /node_modules/@bryntum folder contains all you need.


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 10:15 am
by oleh

In 5.0.1 npm package (@bryntum/scheduler-angular) there are no wrapper sources, only compiled bundles and files.
Image


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 10:43 am
by alex.l

check esm5/lib/ and esm2015/lib for files like bryntum-scheduler-base.js or bryntum-scheduler-base.component.js or bryntum-scheduler.component.js
That's what you need.


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 10:48 am
by alex.l

Also /lib subfolder has ts version


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 11:01 am
by oleh
alex.l wrote: Wed Apr 06, 2022 10:43 am

check esm5/lib/ and esm2015/lib for files like bryntum-scheduler-base.js or bryntum-scheduler-base.component.js or bryntum-scheduler.component.js
That's what you need.

Yes, I was expecting .ts sources )

alex.l wrote:

Also /lib subfolder has ts version

No, it doesn't, these are .d.ts files only


Re: [ANGULAR] Bundle size (again)

Posted: Wed Apr 06, 2022 2:06 pm
by alex.l

No, it doesn't, these are .d.ts files only

That's exactly what I meant to review :)

These js/d.ts files - all we have from the source code.