IDEMSInternational / open-app-builder

PLH App Frontend
GNU General Public License v3.0
6 stars 25 forks source link

fix: plh-function shared references #2132

Closed chrismclarke closed 11 months ago

chrismclarke commented 11 months ago

PR Checklist

Description

When a calc function tries to refer to another calc function everything works fine in development, however in production there is a mismatch in the names of functions made available to evaluator context, and the names of the functions as minified by the angular compiler.

This PR adds a small workaround so that all calc functions can also be accessed via a window.calc method, which preserves the names.

Review Notes

Create a production build

yarn build

Use npm serve module to serve the contents of the production build locally (reads from local seve.json for config)

npx serve

Dev Notes

I've added to #2131 as a reminder to try and address this issue in a better way in the future if possible (currently still possible for developers to write functions that work locally but not production)

Git Issues

Closes #

Screenshots/Videos

Debug sheets working in production serve (port 5000). Previously was white-screen

image