In an article dated July 2, 2024, Matt Glaman demonstrates that Drupal 10 can be run directly in a browser using WebAssembly technology.
Drupal can now be run client-side via WASM
WASM, or WebAssembly, is a binary code format designed to run in web browsers.
- It is a low-level language, close to machine language.
- It allows code to be executed at speeds close to native applications.
- It is designed to work alongside JavaScript in web browsers.
- WASM allows developers to write critical parts of their web applications in languages like C, C++, or Rust, then compile them into WebAssembly.
- The main goal is to improve the performance of complex web applications, such as games or video editing tools.
Why is this important for Drupal?
Beyond the technical achievement and the POC (Proof of Concept) aspect of this tour de force, what could this mean for the future of Drupal?
Making Drupal easier to get started with: WASM allows users to run Drupal directly in their browser without installing or configuring a server. This drastically lowers the barrier to entry for new users, beginner developers, or anyone who just wants to explore Drupal. They can start using and testing the CMS immediately without worrying about hosting or server setup complexities. In other words, it could also replace or provide a cheaper alternative to simplytest.me!
Performance: WASM is designed to offer performance close to machine code. For Drupal, this can mean faster execution of certain client-side operations, such as page rendering, data processing, or complex user interactions. This performance boost can be especially noticeable for Drupal applications with many interactive features (maps, animations, games, etc.).
Portability: With WASM, Drupal can run on any device or platform with a modern web browser, with little adjustment required. This includes desktops, smartphones, tablets, and even potentially web-compatible IoT devices. This increased portability can greatly broaden Drupal's use cases.
Demo and testing: WASM greatly simplifies the Drupal demonstration process. Consultants, agencies, or developers can quickly show a working version of Drupal to clients or colleagues without having to set up a complex demo environment.
Development and prototyping: Developers can use the WASM version of Drupal to quickly prototype features, test configurations, or try out the CMS without setting up an environment.
Edge Computing: WASM makes it possible to run certain parts of Drupal directly on a CDN (Content Delivery Network) or an edge server. This can allow faster processing of some requests, reduce latency, and improve the user experience, especially for users who are geographically far from the main server. All or part of Drupal could thus be run via platforms like Netlify or Vercel, for example.
New architectural capabilities: Using WASM could lead to new ways of designing and deploying Drupal applications. For example, one could envision hybrid architectures where certain parts of the application run client-side in WASM, while others remain on the server. This could pave the way for more responsive Drupal applications, with better load balancing between client and server.
Ludovic, for the bluedrop.fr team.