New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add @__NO_SIDE_EFFECTS__
or @__PURE__
annotations
#1899
Comments
At least, we cannot mark |
If there are some demands from user, we may have a benefit to do this. But I suspect that we need to wait and see the progress about their annotations (e.g. specification, or inventing a lint rule and push into ESLint). Furthermore, our implementation uses a function declaration syntax for all to define APIs. Of course, this does not help to provide a complete information for code reduction with less computation but their syntax is easier to reduce than function expression + variable declaratio like |
Motivation
This helps to provide more information to a minifier for code reduction.
Implementation
@__NO_SIDE_EFFECTS__
annotation for function definitions@__PURE__
annotation for callee siteUnresolved Questions
See also
#__NO_SIDE_EFFECTS__
annotation for function declaration rollup/rollup#5024#__NO_SIDE_EFFECTS__
comment from Rollup evanw/esbuild#3149The text was updated successfully, but these errors were encountered: