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
feature: JSONata Expression editor enable testing of $flowContext and $globalContext #4011
base: dev
Are you sure you want to change the base?
feature: JSONata Expression editor enable testing of $flowContext and $globalContext #4011
Conversation
I have one failed tests, but I am pretty sure it not casued by my change.
enviroment:node: v14.21.2 |
Hi @yue-wen thank you for this PR. You have linked to a two year old thread on the forum, rather than any active discussion on whether this is something we want to enable in the editor. There are reasons we chose not to support the context functions - mostly due to the overhead of loading context data in the editor. Your approach appears to get all context data just in case it is needed - that is not very ideal if there is a large amount of data stored. If we wanted to add support for the flow/globalContext functions, the code would need to be much more selective over what it loads and when. For example, only loading context data if those functions are actually being used. There is also the matter of how it handles multiple context stores, rather than just the default one. We'd need to look at how that would have to modify the logic around what gets loaded. Finally, to get the current flow id you should use And one more thing... as this would be a new feature, it should target the |
1fa3572
to
514f682
Compare
Hi @knolleary I understand your consider about overhead of loading context data. Because the response schema of
I will try refactor my code to loading context data only once when it being used. |
514f682
to
015c2b9
Compare
015c2b9
to
843afd0
Compare
Proposed changes
Enable JSONata expression editor testing $flowContext and $globalContext with node-red context data.
Test flow:
Checklist
grunt
to verify the unit tests pass