-
Notifications
You must be signed in to change notification settings - Fork 26
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
Refactor/template calc service #2792
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…nal/open-app-builder into feat/data-items-local
…international/open-app-builder into feat/data-items-local
…international/open-app-builder into feat/data-items-local
…international/open-app-builder into feat/data-items-local
…pp-builder into feat/data-items-local
Rebase into #2793 for cleaner commits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Checklist
Breaking Changes
The
window.calc
accessor has been marked as deprecated, e.g.@calc(window.calc.pick_random([1,2,3]))
Any methods available via
window.calc.xxxx
are already available directly, e.g.@calc(pick_random)
, so use that way instead.I can't see any examples of this being used in example_calc, so assume this is mostly a legacy behaviour anyways
The only method that should still be accessed via the window is the
date_fns
utility library, e.g.@calc(window.date_fns.add_days(...))
Description
Changes merged from #2772 for easier review, a handful of updates to the
template-calc.service
which handles authored@calc(...)
statements, specificallyAuthor Notes
Beyond the marked deprecation, there shouldn't be any breaking changes or functional testing required.
Review Notes
The code doesn't introduce changes to how calc statements are evaluated (for follow-up), so more just to confirm test cases behave as expected
Dev Notes
The changes introduced here should be mostly non-functional (testing, mock and type-safety improvements). The additional method included is designed for future integration in #2772, so in itself shouldn't be breaking.
Whilst diving into the service I did notice a handful of inconsistencies and clunky areas within the code, however have avoided larger refactor as would be best done through RFC procedures first (beyond marking
window.calc
as deprecated. Goals of a larger refactor would include:Git Issues
Closes #
Screenshots/Videos
If useful, provide screenshot or capture to highlight main changes