Question
Best Practice for embedding Javascript UI Frameworks
Wanted to ask if we are going against Pega Best Practice for UI, or otherwise violating any support contracts in place if we build custom HTML rules to use Javascript frameworks such as AngularJS / NodeJS / etc.
The question is not about whether things will work - I'm sure we can make anything work. Question is does Pega endorse this approach for UI reuse,
OR
Does Pega recommend we build all UI consumed from PEGA portal to application users using PEGA rules meant for that purpose.
Trying to avoid situation where if we end up reusing UI widgets using some Javascript framework, by embedding within some harness, and then finding out later PEGA does not really support such reuse.
the UI library has different examples on how to use AngularJS, React and Vue.js along with Pega UI components. You can find more details on how to create a simple React component here https://community1.pega.com/community/pega-support/question/how-use-react-pega
It is recommended to use as much as possible the auto-generated Pega components for the core components (link, button, input...) and only use these 3rd party framework for complex components that are not already provided by Pega. Because only few components will use the 3rd party framework, the benefit of the framework (like using React for the Virtual DOM) is limited.
Using React or Vue inside the Pega UI will not be as efficient from a performance standpoint as building a standalone React app using CRA: there is no tree shaking and it requires an additional payload of 150Kb+ to load the React library. If your component is very simple, you are better off to built it as a simple custom control using server side rendering.