-
Notifications
You must be signed in to change notification settings - Fork 13
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
Serialize function AST instead of source #6
Comments
Hi @josephfrazier. Sure. Creating the syntax tree itself may be expansive and changing the current behaviour would require a major version bump. So you’d probably make it an option and call it |
Great, I'll see what I can come up with. I agree that it should be an option. Note to self: Ideally, this would eventually be resistant to variable renaming within the function, but that would require a more sophisticated analysis (using something like http://esprima.org/demo/rename.html). |
Thanks @josephfrazier! |
Thanks for the quick merge/release! How would you feel about the |
My gut tells me that migration tasks should be avoided in production code. They should rather be implemented in a deployment pipeline. |
That makes sense. In order for such a migration to be possible, I think we should export |
Yes, that sounds reasonable. |
Hey @borisdiakur, thanks for the module! I was wondering if you'd be willing to accept a patch that would allow the comments/formatting of a function to change, without invalidating the cache. The idea is that instead of hashing the source code of the function, we would use a parser like babylon to build an AST (abstract syntax tree) of the function that represents its semantic behavior while disregarding comments/formatting/etc. The AST would be serialized into JSON and then included in the hash.
The text was updated successfully, but these errors were encountered: