Ui On The CDN

A Jamstack application consists of a static UI (in HTML and JavaScript) and a set of serverless functions to support dynamic UI elements via JavaScript. There are many benefits to the Jamstack approach. But perhaps one of the most significant benefits is performance. Since the UI is no longer generated at runtime from a central server, there is much less load on the server and we can now deploy the UI via edge networks such as CDNs.

2 STASHED

WebAssembly Serverless Functions in Netlify

medium.com

MORE IDEAS FROM THE ARTICLE

Running WasmEdge from Netlify’s current serverless container is an easy way to add high-performance functions to Netlify applications. Going forward an even better approach is to use WasmEdge as the container itself. There will be no Docker and no Node.JS to bootstrap WasmEdge. This way, we can reach much higher efficiency for running serverless functions. WasmEdge is already compatible with Docker tools .

2 STASHED

Example 2: AI inference

The second demo application allows users to upload an image and then invoke a serverless function to classify the main subject on the image.

2 STASHED

Example 1: Image processing

Our first demo application allows users to upload an image and then invoke a serverless function to turn it into black and white. A live demo deployed on Netlify is available.

2 STASHED

However, the edge CDN only solves the problem of distributing the static UI files. The backend serverless functions could still be slow. In fact, popular serverless platforms have well-known performance issues, such as slow cold start, especially for interactive applications. That’s where WebAssembly could help.

With WasmEdge , a cloud-native WebAssembly runtime hosted by the CNCF , developers can write high-performance serverless functions deployed on the public cloud or on edge computing nodes.

2 STASHED

Finally, the WasmEdge Tensorflow API provides the most ergonomic way to execute Tensorflow models in the Rust programming language. WasmEdge installs the correct combination of Tensorflow dependency libraries, and provides a unified API for developers.

2 STASHED

High-performance functions written in C/C++, Rust, Swift, and other languages can be easily compiled into WebAssembly. Those WebAssembly functions are much faster than JavaScript or Python commonly used in serverless functions.

However, if raw performance is the only goal, why not just compile those functions to machine native executables (Native Client or NaCl)? Netlify already runs these functions safely in AWS Lambda with the Firecracker microVM.

Our vision for the future is to run WebAssembly as an alternative lightweight runtime side-by-side with Docker and microVMs in the cloud

2 STASHED

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP:

RELATED IDEAS

Some of the main disadvantages of the current structure
  • There are two realms: JS and Native which are not really aware of each other and do not share the same memory
  • The communication is async through the bridge between the two realms
  • It is slow to transfer large chunks of data. Since the memory is not shared, all the data passed between js and native is a new copy
  • No way to update the UI in a sync way.
  • The library repo is HUGE. It makes the library heavier and also making it slower to contribute code from outside or release new fixes

1 STASHED

4 LIKES

React Native — A Bridge To Project Fabric 

medium.com

Testing in React Native

As your codebase expands, small errors and edge cases you don’t expect can cascade into larger failures. Bugs lead to bad user experience and ultimately, business losses. One way to prevent fragile programming is to test your code before releasing it into the wild.

There is more value in testing than you might realize. One of the best ways to fix a bug in your code is to write a failing test that exposes it. Then when you fix the bug and re-run the test, if it passes it means the bug is fixed, never reintroduced into the code base.

7 STASHED

4 LIKES

Testing · React Native

reactnative.dev