-
-
Notifications
You must be signed in to change notification settings - Fork 509
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
Support #__PURE__
and #__NO_SIDE_EFFECTS__
notation
#9193
Comments
I propose a |
#__PURE__
and #__NO_SIDE_EFFECTS__
notation#__PURE__
and #__NO_SIDE_EFFECTS__
notation
This method did not scale, if the downstream app required more annotation |
Can you give us an example? |
vite has a special magic comments |
https://github.com/rolldown/rolldown/blob/b546e53adf0d8fecbca8a9f0dddbcb44cb308a99/crates/rolldown/src/ast_scanner/new_url.rs?plain=1#L35-L43, for now this code works fine when the ast is parsed from source code, but will not work if the ast is generated by transformer. If use the method you proposed, you may need to add many flag to support other widely used tools. |
What about use a hashmap to store leading comments of some generated node, the key should be their Address |
But I think your method is good enough for rolldown and vite |
|
Background: https://github.com/javascript-compiler-hints/compiler-notations-spec
The text was updated successfully, but these errors were encountered: