Skip to content

FIO-11157: fix protected-eval enclosed in default object#22

Merged
brendanbond merged 1 commit intomasterfrom
FIO-11157
Feb 25, 2026
Merged

FIO-11157: fix protected-eval enclosed in default object#22
brendanbond merged 1 commit intomasterfrom
FIO-11157

Conversation

@ZenMasterJacob20011
Copy link
Contributor

Link to Jira Ticket

https://formio.atlassian.net/browse/FIO-11157

Description

What changed?

added "export: default" to the output of the webpack config. This allows webpack to know were the protected-eval object is located on default exports. Also made some quality of life changes to the webpack config and tsconfig that align more with what a library that will be bundled into a browser expects

Why have you chosen this solution?

Before when embedding protected-eval.js you would have to call it like so
window['protected-eval'].default
This is because we are exporting our library with

export default {
  evaluator: ProtectedEvaluator
};

adding "export: default" to the webpack configuration allows webpack to correctly put the protected-eval object on the browsers window object

Breaking Changes / Backwards Compatibility

With this change protected eval will now be correctly added as a module into the portal app. It looks like this will break customers that utilize custom javascript

Dependencies

N/A

How has this PR been tested?

manually tested

Checklist:

  • I have completed the above PR template
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • My changes include tests that prove my fix is effective (or that my feature works as intended)
  • New and existing unit/integration tests pass locally with my changes
  • Any dependent changes have corresponding PRs that are listed above

@brendanbond brendanbond merged commit a9f2d59 into master Feb 25, 2026
4 of 5 checks passed
@brendanbond brendanbond deleted the FIO-11157 branch February 25, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants