This is a migrated thread and some comments may be shown as answers.

Tree Shaking and Typescript Definitions

3 Answers 250 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Fishypixels
Top achievements
Rank 1
Fishypixels asked on 08 Nov 2018, 05:12 PM
I have found mentions that kendo UI supports tree shaking, but I couldn't find any mention of it in the kendo react docs. Looking at module syntax, it looks like tree shaking would be supported but I just wanted to make sure. Does kendo react support tree shaking? Does kendo react come with typescript definitions?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 09 Nov 2018, 08:25 AM
Hello, 

Our code is written in a way that Tree Shaking is possible. Still please have in mind that it is done from the Webpack bundler and could produce different results than expected due to its "safe" checking. More details can be found here:

https://github.com/facebook/create-react-app/issues/2748

As for the TypeScript definitions, the KendoReact components are written on TypeScript and no additional definitions are needed as they are written on pure TypeScript.

Let me know if you need more details on this matter.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Fishypixels
Top achievements
Rank 1
answered on 09 Nov 2018, 03:57 PM

https://github.com/facebook/create-react-app/issues/2748#issuecomment-356099272

"I'll close this. Webpack will get better support for tree shaking in future releases with opt-in purity declarations for packages.". I think he is referring to the side effect flag: https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free in the package json. Is kendo using this flag in their packages? I'm not sure if ES modules are enough alone.

0
Stefan
Telerik team
answered on 12 Nov 2018, 08:39 AM
Hello,

Currently, we do not use the "sideEffects" flag.

Still, Webpack should be able to do TreeShaking where it is possible.

Please have in mind that the Tree Shaking process is not in full control of the KendoReact components, but we are trying the follow the guidelines to make this possible.

Regards,
Stefan
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Fishypixels
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Fishypixels
Top achievements
Rank 1
Share this question
or