Thursday, May 6, 2021

Jetpack Compose for Web enters preview as a new UI framework for web development

In the past few years, there’s been a pretty big push for cross-platform program development. Frameworks like React and Flutter were created to allow developers to share a single codebase across Android, iOS, desktop, and even the web. Even JetBrains, the company behind some of the most popular IDEs and the Kotlin programming language, has been working on cross-platform development. First with Kotlin Multiplatform but more recently with Jetpack Compose.

A while back, JetBrains ported Jetpack Compose, Google’s declarative design framework for Android, to desktop. This allowed for cross-platform desktop development based around Java’s JVM. Using Jetpack Compose, you can make an app for Android, macOS, Windows, and even Linux, all from one codebase. But besides iOS, there’s a pretty big platform missing from Compose: the web.

That’s about to change, though. JetBrains has released what they call a Technology Preview of Jetpack Compose for Web.

Now, Technology Preview is basically a fancy name for pre-alpha. Compose for Web is nowhere near ready to be used in production. There are no tutorials, very little documentation, and the APIs are nowhere near complete. With that said, let’s see what Compose for Web offers so far.

In the current version, there are two ways you can develop in Compose for Web: using the DOM API, or using the existing Compose widgets, such as Column or Text.

If you use the DOM API, you’ll have API names that represent the different HTML elements, such as pa, and so on. The big difference between Compose and classic Kotlin JS, though, is that you can use state-based declarative design. This option seems like a bit of a bridge between classic web development and full-on declarative UI development. On top of creating a layout, Compose for Web also lets you create dynamic, state-based stylesheets.

The second option is what will look more familiar to Android and Compose developers. There are pre-made components, like Column, Row, and Slider, which you can use to build a web UI. Right now, these aren’t very complete and styles and options aren’t fully implemented. But it at least gives us an idea of what JetBrains has in store for Compose for Web.

Overall, at the moment, there isn’t really much to Compose for Web. It’s still in its very early days. But it could mean a lot for the future. Personally, as an Android developer, I’ve had trouble getting into browser-based layout frameworks. Basic HTML and CSS can be clunky, and React and Flutter syntaxes are still based around HTML design.

A fully-featured, cross-platform design language that isn’t based on web design principles is pretty exciting. While Jetpack Compose still has a long way to go, what JetBrains has planned could mean a lot for the future of UI design.

If you want to learn more about Compose for Web, check out JetBrains’ announcement. If you’re interested in playing around with the current implementation, head over to the GitHub repository.

The post Jetpack Compose for Web enters preview as a new UI framework for web development appeared first on xda-developers.

HostGator Web Hosting

Related Posts:

  • Fix Sensors on Custom ROM’s on Xiaomi Mi 4 The Xiaomi Mi 4 has an issue of sensors not working on a lot of custom roms and kernels. With the help of this simple guide by XDA Senior Member Prince Chandela, you can have them functioning back to normal on all stock and … Read More
  • Mokee ROM Available for ZUK Z1 ZUK Z1 is slowly starting to receive various ports of Android projects. One of the most recent is Mokee ROM. Unlike MIUI, Mokee ROM is completely open-sourced and brings some of its very own special features on top of AOSP. … Read More
  • Google Hires the Mobile Team of LunarG to Work on Android We saw LunarG demo their low-overhead graphics API earlier this year with some impressive results. Today, the company has announced that LunarG will be splitting in two. The desktop team will continue working on the PC … Read More
  • Opera Max Adds Support For Music Streaming Services Opera Max, the VPN service that aims to save your data, has now added support for music streaming services. Right now, Opera Max supports streaming from Pandora, Slacker Radio, YouTube Music and India-based Gaana and Saavn, … Read More
  • Battery Percentage Text Xposed Module Graphical battery indicators are often very inaccurate. Most custom ROMs offer displaying remaining battery life in percents, but stock firmware lacks this function. You can fix it quite easily by using this Xposed Framework… Read More

0 comments:

Post a Comment