Constructor name changed after compiling

Hello eneryone!
I am having a problem in a functionality that uses the names of the constructors of the diagram elements. For example, when working locally, the node type elements have the constructor name “Shape”, the flow type elements are “Connection”, but when compiling the project to deploy I have noticed that these names are changed during compilation.

This is an insight of the constructors names, locally:

Captura de pantalla 2024-01-23 a la(s) 15.14.46

This is the case of the constructors names with the compiled project:

Captura de pantalla 2024-01-23 a la(s) 15.02.46

How can I resolve this inconsistency?

This is due to the fact that compilation performs minification. You’d want to prevent minifying the names to prevent this (can typically be fine-tuned).

I wonder though why you need this (at all). We typically rely on feature testing to figure out if a thing is a shape, connection or label. Using constructor names shall, at least for that purpose, not be necessary.

Okay! Thanks for the explanation regarding the compile-time minification.
Answering the question about why I used the name of the constructor, it was to evaluate whether a canvas element was shape or flow type, but now that I know this, I will do it directly by analyzing some characteristic of the businessObject of each element.
Thank you!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.