Mark .
(dot) notation components as PURE
.
#3225
Labels
feature request
Request a feature or introduce and update to the project.
Milestone
Describe the feature in detail (code, mocks, or screenshots encouraged)
Currently we define components using the following syntax:
This works great but means that if
Component
is imported, all subcomponents, used or not used, are bundled.For bundlers to do their job correctly we can utilize the
/*#__PURE__*/
comment to mark an object as "pure" meaning that the properties can be treeshaken individuaally without affecting one or another. We should add these comments to our exported.
components.It would look something like this:
What type of pull request would this be?
Enhancement
Provide relevant links or additional information.
https://github.com/javascript-compiler-hints/compiler-notations-spec/blob/main/pure-notation-spec.md
https://webpack.js.org/guides/tree-shaking/#clarifying-tree-shaking-and-sideeffects
The text was updated successfully, but these errors were encountered: