Introduction to JavaScript Framework Unpoly Framework

HTML has been thriving online as a more straightforward way of creating web applications without using as much JavaScript. It works by sending HTML over the wire, not JSON.

Now, a new JavaScript framework called Unpoly has emerged as a competitor to Basecamp's HTML online framework, Hotwire. Unpoly promises "a fast and flexible front end for server-rendered HTML views". Unpoly creator Henning Koch explains why frameworks like Unpoly are growing in popularity.

"Code is always a burden, and it's always worth exploring ways to write less code," he said. "In our experience, Unpoly has allowed us to build applications using far less code than comparable SPAs, while retaining much of the speed and flexibility of the front end. It's been a better starting point for us."

Koch describes Unpoly as 一个不显眼的 JavaScript 框架providing a fast and flexible front end for server-rendered HTML views.

It sends HTML over the wire, no JSON API required.

It has no dependencies and works with any backend language or framework.

Unpoly debuted seven years ago in 2015. It's the latest brainchild of Koch, who has been developing Web applications for more than 25 years. "I've spent half my career as a development lead at Makandra, a web development company," he explains. "With Unpoly, I can draw from the hundreds of web applications my team has delivered.

As you work on a few new projects each year, you can see patterns emerge organically and draw from them. "

Using Unpoly, a web app's views can do things that are not normally possible in HTML, such as:

  • Open the link in a modal dialog.
  • Links only update fragments of the page.
  • Interaction between layers.

Unpoly was developed by Koch because he noticed that the code used to create Web applications was becoming more and more complex and most of the time unnecessary. "Basically, when SPA frameworks became popular in the early 2010s, my team went all-in on AngularJS for a while. We were struggling with the limitations of server-side rendering, and we hoped that SPA-style applications would allow us to use less Complex code provides a more ambitious UI," he said.

"When Angular made a major compatibility breakthrough between version 1 and version 2, we took the opportunity to look back at our SPA work over the past few years with mixed emotions," Koch continued. "While some applications benefit from the extensive JavaScript approach, we are not satisfied with most others, especially the amount of code and repetitiveness required by the SPA approach."

Koch noted that his team decided to dig deeper into their new hypothesis — that there must be a way to improve their JavaScript coding while simplifying the already complex language.

Guess you like

Origin blog.csdn.net/i042416/article/details/131361457