Using Vite and Vike for Microfrontends; Plus Other Dev News

If you haven’t heard of Vike, it’s the new name for the vite-plugin-ssr. Its parent build tool is Vite — but it’s also so much more, according to programmer Elijah Asaolu, who wrote about Vike and Vite for the LogRocket Analytics blog.

“Vike started as a plugin designed to add server-side rendering (SSR) capabilities to Vite, but it has since grown into a more comprehensive framework for building complete web applications,” Asaolu wrote. “Behind the scenes, Vike leverages Vite’s bundling and development server to set up a server that renders your application’s pages on the fly.”

Vike generates the HTML on the server at runtime when a user requests a page, he continued. This makes Vike perfect for creating “applications with dynamic content that changes frequently,” he adds.

Vike Logo

Vike Logo via GitHub

Vike can be used as both an SSR framework and as a static-site generator (SSG). A SSG differs from an SSR in that an SSG “will pre-generate the HTML and asset files for your website at build time so that when a user requests a page, the server simply serves these pre-built HTML files,” Asaolu explained.

Vike is designed to be fast and use zero-config. It also integrates easily with tools for data fetching, authentication, server management, CSS frameworks and internationalization, he added.

It supports multiple frameworks, including React, Vue, and Svelte. It also supports the Bun runtime.

Asaolu explains how Vike and Vite can be used to build microfrontends, although he notes that to do so, Vike has to be integrated with a module federation plugin that allows developers to share components and states across different applications. The vite-plugin-federation is one option for achieving this, and he shares how to set that up.

Slint GUI Toolkit Adds New Features, VS Code Project Template

Slint, the native GUI toolkit written in Rust, released version 1.8 this week, with several “much-requested features,” including Property Change Callbacks, improvements to live-preview and a VS Code extension.

Property Change Callbacks can help make an interface more dynamic without requiring a developer to write extra business side logic, the team explained.

“Property bindings are part of how you can achieve a lot with so little code in Slint. Then many elements have callbacks to help manage side effects,” the team wrote. “Take TextEdit and the edited call back to let you react to the changing text the user is being entered. However, you quickly find places where your UI is updating and changing, but unlike TextEdit, there is no callback to use.”

This is where Property Change Callbacks come into play, they added. But there is a warning with its use.

“With great power, comes great responsibility. In most cases try to rely on declarative property bindings, which are more efficient,” they wrote. “So be careful not to introduce unintended performance issues or loops, especially if changes cascade into other properties.”

There’s also a new VS Code project template that can be created by hitting CTRL+shift+P on a PC or CMD+shift+P on Mac, then look for “Slint: Create New Project from Template” as a new option. It will guide you through selecting a template for the language of your choice.

LangChain Version 0.3 Updates Python, JavaScript Ecosystems

LangChain has updated with release v0.3 for both Python and JavaScript ecosystems. LangChain is a framework developers use to build applications with large language models (LLM).

This LangChain blog post shares what’s new for each language.

“This means that if you are using e.g. LangSmith for tracing in a serverless environment, you will need to await the callbacks to ensure they finish before your function ends.”
— LangChain Blog

In language changes for Python, all packages have been upgraded from Pydantic 1 to Pydantic 2 internally, and Pedantic 1 will no longer be supported because it reached end-of-life in June. Python 3.8 also will no longer be supported as it reaches end-of-life in October. So both will be the only breaking changes for the Python version.

When it comes to JavaScript, “all LangChain packages now have @langchain/core as a peer dependency instead of a direct dependency to help avoid type errors around core version conflicts,” the post notes. That means developers will now need to install @langchain/core rather than relying on an internally resolved version from other packages, they added.

Also, callbacks are now backgrounded and non-blocking by default rather than blocking.

“This means that if you are using e.g. LangSmith for tracing in a serverless environment, you will need to await the callbacks to ensure they finish before your function ends,” the post noted.

There are also a number of more general improvements added in this upgrade:

Under “What’s coming” the team wrote, “We are expecting to improve LangChain’s multimodal capabilities during the 0.3 release, and continue our work on improving documentation and reliability of integrations.”

Astro Updates Starlight Documentation Framework

This week Astro updated Starlight, which is it’s official, all-in-one documentation site builder. It’s used as a documentation website framework built on top of the Astro framework, allowing developers to create accessible and high-performance documentation websites.

Among the updates in version .28 are:

Group Created with Sketch.

 

 

 

 

Top