Blogs
As we near the first GA of 7.3, one change we've managed to make was to migrate off Soy + Metal.js and fully onto React.js. The story reminded me of how far our frontend infrastructure has evolved in the past fifteen years that I’ve been a part of Liferay. While this was initially going to be a longer post, due to some user error on my part, I have decided to split this into two posts. This first one will describe where we currently stand internally, and a second one that talks about the history of our frontend.
Internally we’ve settled on the use MVCPortlet for simple UIs, because of the familiarity from developers, speed in build time, and server-side rendering performance. Increasingly though we are leveraging React.js for complex UIs, because of the excellent tooling, terrific open-source community, and the fast turnaround time from design to code. These choices were made because they were the frameworks that work best for our internal needs.
Our community though will often ask which front-end technology they should use with Liferay DXP. As with much of our product, we’ve designed Liferay DXP’s front-end to be technology agnostic. Our answer is always the same: Pick the one you are most comfortable with. Every framework has it’s pros and cons and there are no silver bullets.
If you have no idea which to choose, I've listed a few Java frameworks and JavaScript frameworks with my personal thoughts, so you can find ones you're most comfortable with or interested in.
Java Frameworks
Liferay MVCPortlet w/ Declarative Services
Liferay MVCPortlet has been a staple of Liferay’s core development for the past 10+ years. It was designed from the ground up to be fully compatible and highly extensible for all Liferay needs. The addition of OSGi DS has made it even easier to inject services. It is an easy choice for any Java developer who wants a simple framework.
Java Server Faces (JSF)
Standards-based option that is well supported via the Liferay Faces project and with a choice of a variety of component suites including PrimeFaces, RichFaces, ICEfaces, BootsFaces, ButterFaces, and Liferay Faces Alloy. If you have Java developers that hate JavaScript but want some of the same components, this is a good compromise.
PortletMVC4Spring (previously Spring Portlet MVC)
Spring Portlet MVC is probably the most popular Java portlet framework. Liferay maintains the project now as PortletMVC4SPring. Most Java developers will probably feel comfortable with this choice. While you are currently required to bundle the Spring Framework jars in WEB-INF/lib as a WAR file, we have some optimizations in our roadmap to remove the need of bundling the Spring Framework.
MVCBean (Portlet 3)
This is the latest portlet spec. I haven’t seen this in action yet but you can watch Neil’s DevCon presentation: Portlet 3.0 MVCBean and PortletMVC4Spring for additional information. It sounds quite promising.
JavaScript Frameworks
React.js
React is the most popular javascript framework in the market today and for good reasons. The documentation is excellent, great performance, and a number of components to select from. We believe it is currently the safest choice to use amongst the frameworks and began using it internally. We even provide a set of components to use within React and integration with their cli. If you don’t have a horse in the race, we recommend trying React as your first choice if you would like a JavaScript framework.
Angular.js
Angular is a very popular choice amongst enterprises. The community is robust and there are many components available. Liferay provides good integration with their cli to provide a very fluid developer experience. The library is extremely heavy though causing a noticeable first load penalty. The frequent breaking updates also makes you feel like you’re always trying to play catch up.
Vue.js
Vue.js on paper looks extremely promising. The community is passionate, the library is extremely lightweight, and it seems to fit into Liferay’s design patterns very well. The only thing holding it back is the lack of real world implementations. In time, this may turn out to be the best framework to use with Liferay.
Soy + Metal.js
Liferay has invested several years into Soy believing it was the holy grail. We believed the ability to compile closure templates would provide us the performance of JSP with the reusable components of other JavaScript frameworks. While it came close to achieving some of those goals, we never hit the performance we wanted and more importantly, it always felt like we were the only people using this technology. We’ve moved on and recommend you learn from our mistakes and stay away.