Feature Request: Improve treeshaking #4090
OrkhanAlikhanov
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Top level calls like
Mark.createorExtension.createare not tree-shakable unless they are marked as pure. This means that even if my app does not use certain extensions/marks they will still be bundled if my app has them somewhere in the import chain. To enable eliminating them during treeshaking they need to be annotated with/*@__PURE__*/. Likeconst bold = /*@__PURE__*/ Mark.create(...). There are some babel plugins that do that likebabel-plugin-annotate-pure-calls.Some context: mantinedev/mantine#3118 (comment)
I don't have any sandboxes proving but still wanted to start the discussion (I have actually delayed it by 6 month)
Use Case
Use case is to reduce bundle sizes of apps
Type
Other
Beta Was this translation helpful? Give feedback.
All reactions