FIO-9783: refactor, make dumber#58
Merged
lane-formio merged 13 commits intomainfrom May 15, 2025
Merged
Conversation
7 tasks
travist
approved these changes
May 15, 2025
Member
travist
left a comment
There was a problem hiding this comment.
Looks great! Nicely done @brendanbond!
Merged
This file contains hidden or 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
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.
Link to Jira Ticket
https://formio.atlassian.net/browse/FIO-9783
Description
We've identified a bottleneck in the way we perform form validation in our Enterprise Server - creating VM contexts per request and executing the entire form orchestration pipeline in those contexts turns out to be kind of slow and expensive.
To mitigate this, I've changed the way the vm library is constructed. Rather than opinionated functions that execute certain concrete evaluations that are tightly coupled to other modules (e.g. formio-server) this library now will only provide a stable API for safely sandboxing and executing code. Gone now will be the days of @formio/vm managing its own dependencies - a game that is difficult to play during development (where you have to ensure that the vm dependencies match the upstream consumers) - and being responsible for things like email rendering (which happens in only one place, formio, and should be managed there).
Breaking Changes / Backwards Compatibility
Yeah, this is definitely a major version of this library. The hope is that it will be relatively stable now, and we won't have to make form.io specific changes here (e.g. to things like email rendering, which belong elsewhere) and can just focus on its job - providing an interface with which to sandbox and execute javascript code.
Dependencies
n/a
How has this PR been tested?
I wrote some new automated tests to cover the new interfaces.
Checklist: