This document highlights all the new features introduced in 4D 21 LTS, covering everything added from 4D 20 R2 up to 4D 21. Each feature includes direct links to its blog post for practical examples and to the documentation for full technical details.
Also, sections with the New tag focus specifically on what’s new since 4D 20 R10.
This document is divided into ten sections:
4D 21: YOUR AI ENGINE
4D 21 turns 4D into its own AI engine, delivering a full-featured AI toolkit built for real-world business applications. You can communicate with cloud or locally hosted models, generate and store vectors, run semantic search natively in ORDA, and connect your business logic directly to AI-driven conversations, all without external wrappers, patchwork processes or major architectural changes.
AI becomes a natural extension of your existing code, whether your application is brand new or decades old. With native vector support, streamlined model communication, and tools for embedding intelligent behavior into everyday workflows, 4D 21 makes AI integration smooth, practical, and immediately useful.
Add AI Capabilities with the built-in 4D AIKit Component
4D AIKit is a built-in 4D component that brings OpenAI-compatible capabilities directly into your 4D environment. With just a few lines of code, you can automate processes, enrich user experiences, and integrate intelligent features into business logic without stepping outside of 4D.
AIKit includes over 30 classes designed to support:
-
Text generation and chat-based interfaces
-
Image tagging, object recognition, and descriptive analysis
-
Speech-to-text transcription
-
Visual generation from prompts
-
Moderation of text content
AIKit also enables advanced workflows that blend both cloud-based and locally hosted models. You can build social media automation tools, AI-powered content pipelines, or dynamic learning experiences by combining text and image analysis in a single flow.
NATIVE VECTOR SUPPORT FOR AI EMBEDDINGS & SEMANTIC SEARCH
Intelligent features start with one foundational element: vectors. Whether you’re building semantic search, recommendation systems, document classification, or image grouping, vectors are the structure that represents meaning. With 4D 21, vectors become a native, first-class part of the platform.
4D.Vector is a new built-in class designed specifically for storing and operating on AI embeddings. It holds high-dimensional numeric data in a memory-efficient format and supports key similarity operations like cosine similarity, dot product, and euclidean distance directly inside 4D. This makes semantic queries fast, precise, and fully integrated with your data model.
You can store vectors in your database, use them in class-typed attributes, and build features that sort, compare, or cluster data based on meaning rather than exact matches. It’s the backbone of modern AI-powered workflows, now native to 4D.
To complement this, 4D AIKit introduces native vector generation via OpenAI’s embeddings API. The new OpenAIEmbeddingsAPI.create() method transforms strings or collections into 4D.Vector instances in a single call, no token handling, no HTTP plumbing, no JSON parsing. Once generated, vectors flow seamlessly into similarity scoring, semantic filtering, ranking systems, or ORDA queries.
Together, 4D.Vector + AIKit embeddings deliver a complete pipeline for semantic intelligence:
- Generate embeddings
- Store them efficiently
- Compare and score them natively
- Run semantic queries directly in 4D
It’s AI-ready architecture, built into the language and the data layer.
SEMANTIC QUERIES New
You can now integrate semantic search directly into your ORDA queries. Instead of relying on separate processes, you can compare a record’s vector field against a reference vector and instantly return the most relevant results, all within the same ORDA grammar you already use.
The query accepts a simple parameter object with a required vector and optional attributes such as the similarity metric (which defaults to cosine) and a similarity threshold.
// Step 1: Define the kind of profile you want to match semantically
$searchText:="senior project manager with strong HR background, based in France"
// Step 2: Create an AI client (local baseURL optional)
$client:=cs.AIKit.OpenAI.new("YourApiKey")
$client.baseURL:="http://127.0.0.1:1234/v1"
// Step 3: Generate an embedding vector for the search text
$embedResult:=$client.embeddings.create($searchText; "text-embedding-mxbai-embed-large-v1")
$semanticVector:=$embedResult.vector
// Step 4: Build the semantic query object with similarity options
$semanticQuery:={vector: $semanticVector; metric: "cosine"; threshold: 0.4}
// Step 5: Run the query — combine semantic match with traditional filter
$results:=ds.Profiles.query("yearsOfExperience >= 5 & expertise >= :1"; $semanticQuery)
Vector conditions blend seamlessly with classic ORDA logic, so you can combine semantic similarity with traditional filters in a single query. By adjusting the threshold, results can shift from broad and noisy to narrow and precise, giving you meaningful, context-aware results without adding complexity. The entire process stays within the ORDA grammar you already know, keeping your queries clean, expressive, and easy to maintain.
AI Tool Calling and Response Format New
AI tool calling and structured response formats extend 4D AIKit with the ability to integrate business-specific functions directly into AI-driven conversations. Tool calling allows you to expose selected functionality from your application, such as “list available product categories” or “get top selling products”, as callable tools. When an AI model determines that a tool is needed, 4D AIKit automatically routes the call to your registered 4D functions and integrates the result back into the response. This avoids the need to upload or retrain large datasets, while still enabling the AI to answer user queries with live, application-specific data. In practice, this means you can embed a chat assistant in your application, and when a user asks, “What are the top 10 best-selling products by category?”, the model can call your functions, retrieve real business data, and return the answer in natural language.
In addition, 4D AIKit now supports structured response formats, making integration with downstream processes more reliable. Besides plain text, responses can be requested as strict JSON objects or forced to comply with a JSON schema that you define. This is particularly useful when unstructured input from users needs to be transformed into predictable data, or when AI-generated content must flow into automated workflows without manual cleanup.
Together, semantic queries, tool calling, and structured response formats make AI in 4D not just a conversational layer, but a fully integrated system component, capable of retrieving relevant business data, applying logic securely inside your application, and delivering structured outputs that fit seamlessly into your workflows. And now, with AIKit open-sourced, you gain complete visibility and the ability to shape, extend, and evolve it around your own business requirements.
NETWORK
4D 21 redefines the networking layer with a modern, performance-driven foundation built for today’s connectivity expectations. Whether you’re running high-latency client/server workloads, switching networks mid-session, integrating devices over TCP or UDP, or optimizing repeated HTTP calls, the entire stack is engineered to deliver faster connections, stronger resilience, and tighter control. QUIC becomes the recommended transport protocol for smoother, low-latency remote sessions, TCP gains asynchronous APIs with TLS and fine-grained timeout handling, UDP arrives with a new event-driven socket API, and HTTP requests benefit from persistent connection management through dedicated agents. Together, these upgrades bring speed, stability, and flexibility to every layer of your application’s network communication.
QUIC: MORE RESILIENT CLIENT/SERVER CONNECTIVITY
QUIC is a modern networking layer designed to make 4D Client/Server connections more resilient and reliable, especially when network quality varies. With 4D 21, you can enable QUIC directly from the Structure, User, or Database Settings, even in compiled applications, making it easy to test and deploy without rebuilding.
In real workloads, QUIC delivers better performance than ServerNet and handles unstable or high-latency connections more gracefully. That means quicker interactions for users, smoother work over Wi-Fi or mobile networks, and a more resilient experience overall.
ServerNet remains supported, but QUIC is now the recommended choice for new deployments aiming to benefit from today’s Internet transport standards. Before migrating an existing environment, be sure to verify that your infrastructure supports UDP, since some networks restrict it.
Seamless Network Switching with QUIC New
With QUIC, switching between network interfaces no longer interrupts your 4D Remote connection. Whether you move from Ethernet to Wi-Fi, change adapters, or wake a laptop on a different network, the client automatically re-establishes its session with 4D Server and continues execution without data loss. QUIC enables fast, resilient reconnections across changing network conditions, making the experience smooth even in mobile or unstable environments.
Your workflow stays intact: the execution context is preserved, and processes resume exactly where they left off. On the server side, the client’s IP address updates in real time in the Administration dialog, diagnostic logs, and the Session attributes, giving administrators complete visibility. This makes 4D Remote significantly more robust when network conditions frequently shift.
MODERN SECURE TCP NETWORKING (CLIENTS, SERVERS & TLS)
4D 21 delivers a complete, modern TCP networking stack that replaces the old 4D Internet Commands with a faster, cleaner, and fully asynchronous approach.
The TCPConnection class handles client-side communication with an object-oriented API and callbacks like onConnection, onData, onShutdown, and onError. You can send blobs or text, react to events as they occur, and connect to external devices, services, or custom protocols with ease.
The TCPListener class adds the server side. It lets you listen on a port, accept or reject incoming connections, and hand each accepted client off to a dedicated TCPConnection instance. This gives you a consistent model for building lightweight services or device gateways directly in 4D.
To secure everything, TCP connections now support native TLS/SSL encryption. By enabling the TLS attribute in the new options parameter of 4D.TCPConnection.new(), you establish encrypted sessions automatically, with TLS 1.3 as the default protocol. Standard and secure ports can run in parallel, and encrypted communication begins as soon as the handshake completes.
TCP connections also expose a .connectionTimeout property, giving you direct control over how long to wait before abandoning a stalled or unresponsive connection. This lets you tune latency thresholds, fail fast in poor network conditions, and avoid UI freezes or endless waits.
Together, these features provide a modern, flexible, and secure foundation for implementing custom TCP protocols and building both client and server networking solutions entirely in 4D.
NEW UDP COMMANDS
The new 4D.UDPSocket class gives developers full control over real-time, event-driven communication using the UDP protocol. It supports both client and server modes and is optimized for fast, connectionless data transmission in use cases like IoT messaging, real-time device monitoring, or internal signaling.
This class is fully event-driven, supporting callbacks such as onData, onError, and onTerminate. Developers can emit and receive packets using send(), analyze packet metadata via 4D.UDPEvent, and log traffic in the unified 4DTCPUDPLog.txt file.
With support for preemptive threads, the UDPSocket class runs efficiently in high-concurrency environments and replaces the legacy Internet Commands plugin with a modern, object-oriented alternative.
OPTIMIZE YOUR HTTP CONNECTIONS WITH HTTP AGENTS
4D 21 introduces HTTP agents, giving you more control over how your application connects to HTTP servers. Agents manage connection persistence and reuse, avoiding the overhead of renegotiating a new connection, especially TLS/SSL, for every request.
By default, all HTTPRequest commands now use a built-in agent that keeps connections alive. When you need more control, you can create your own agent to fine-tune behavior such as:
-
keep-alive handling
-
maximum concurrent connections
-
connection timeouts
-
TLS/SSL configuration at the agent level
Using an agent is simple, you create it once and pass it through your request options. Because HTTPAgent is a shared object, you can also keep a single agent for all requests to the same server, or even reuse it across multiple servers, each maintaining its own connection pool.
HTTP agents make repeated calls faster, more predictable, and easier to manage, especially in applications that interact heavily with external APIs.
ORDA
4D 21 expands ORDA with deeper lifecycle control and more refined data handling, enabling developers to build cleaner, more self-contained business logic. With new lifecycle events, constructor support, smarter entity filtering, and memory cleanup features, the data layer becomes not just a storage system, but a responsive, rules-driven engine built right into your model.
COMPLETE Entity Lifecycle Events MODEL New
4D 21 introduces a complete, unified lifecycle model for ORDA entities, giving you full control over how data behaves from creation to deletion. Instead of scattering rules across forms, APIs, or triggers, you now define your entire business logic directly inside your dataclasses: cleaner, centralized, and easier to maintain.
This lifecycle begins the moment an entity is created. Entity constructors let you assign default values, initialize context-specific logic (such as the current user or session), or pre fill attributes automatically. As soon as an entity is modified in memory, the onTouch event reacts to those changes in real time, making it easy to normalize values, enforce rules, or prepare dependent updates before any save operation begins.
When an entity is saved, 4D 21 now runs a three-phase sequence: validateSave, saving, and afterSave. This lets you block invalid operations early, apply business logic while the save is in progress, and trigger follow-up actions once the operation completes. The same three-phase pipeline exists for deletions with vvalidateDrop, dropping, and afterDrop, allowing you to prevent unauthorized removals, clean up related data, and run post-delete logic consistently.
All events are available at both the entity and attribute levels. Validation events can block operations when rules aren’t met, while post-events always execute, even if the operation fails, ensuring reliable, predictable behavior throughout your model.
By consolidating this logic inside your ORDA dataclasses, entity behavior becomes predictable, self-contained, and consistent across your entire application. Business rules are no longer hidden in triggers. External systems can integrate cleanly through native event hooks. And in ORDA-based projects, traditional triggers are no longer needed, the lifecycle events deliver the full power of ORDA in a cleaner, more maintainable architecture.
Restrict data on entity selections
Controlling who sees what data is critical in business applications, and now you can define those rules once, cleanly, and directly in your data model.
While the existing permission system in 4D controls whether users can access an entire dataclass, the new restrict() function introduced in 4D 21 refines that access further. It lets you enforce contextual filters on entity selections based on session values, user roles, or any other runtime logic.
Rather than applying filters manually throughout your code, you define them once inside the dataclass using the restrict() function. For instance, a salesperson could be limited to viewing only the customers they manage, while admins still see the full dataset, all determined automatically during each read operation like query() or all().
This central approach not only strengthens security but also keeps your logic clean and consistent across both web and client-server contexts.
CLEAN ENTITY SELECTIONS WITH AUTOMATIC GAP REMOVAL
When users delete entities from a selection, the interface often ends up cluttered with empty placeholders. It breaks the flow, adds friction, and makes your UI feel less responsive.
With 4D 21, the new clean() function solves this in one line. After performing a drop, you simply call .clean() on the entity selection to automatically remove any gaps left by deleted entities. It’s seamless, efficient, and restores a polished, uninterrupted view without manual rebuilding.
This small addition translates to a big improvement in interface quality and user experience. And it’s not limited to the UI: the $entityset REST API also supports a clean parameter, allowing your API responses to return clean, gap-free data even after deletions.
Whether you’re developing a desktop interface or working with web clients, this feature keeps your data views tidy and your user interactions smooth.
4D Qodly Pro
4D Qodly Pro lets you extend your business application with modern browser-based interfaces, all without writing a single line of HTML or JavaScript. With a visual drag-and-drop editor, you can build responsive web forms and connect them directly to your 4D business logic.
Qodly pages can be embedded directly into classic 4D forms using a Web Area. From the user’s point of view, it all feels like a single, unified interface. There’s no need for separate windows or extra licenses. The embedded Qodly page shares the same session and license as the 4D Remote client, keeping the experience both transparent and at no additional cost.
If you want to see how quickly this comes together in practice, you can watch the official 4D Qodly Pro webinar replay, a walkthrough of how to add browser-based forms to a real 4D application.
BUILD MODERN WEB INTERFACES WITHOUT REWRITING YOUR APPLICATION
4D Qodly Pro lets you create modern, browser-based interfaces right on top of your existing 4D application, without learning web frameworks, rewriting logic, or managing separate codebases. You design pages visually, bind data visually, secure access visually, and expose APIs visually, all while staying inside your familiar 4D workflow. The result is a faster path to the web with less code, less complexity, and no disconnect between your UI and your business logic.
-
Extend or move your desktop applications to the web without restructuring your architecture: Qodly Pages sit on top of your existing ORDA model and server classes. Your logic, database, and security rules stay exactly where they are.
-
Build responsive interfaces visually using reusable components: You drag components onto the canvas, configure them through side panels, and bind them to qodlysources without code. Crafted components and ready-made templates let you assemble screens quickly with consistent styling.
-
Speed up development by removing frontend complexity: Data binding, formatting, conditional states, events, and navigation are all visual. No HTML, CSS, or JavaScript is required, just 4D logic and Qodly Studio’s panels.
-
Use the 4D Client license you already have: When a Qodly Page is embedded in a Web Area of a 4D Remote client, it runs under the same session and license. Users see a unified interface, and deployment stays simple and cost-effective.
-
Keep teams productive with a familiar drag-and-drop experience: Qodly Studio is modeled after the 4D form editor, making it easy for new developers to join the project and for experienced 4D teams to work faster.
-
Design, logic, and data all live in the same environment: Qodly Studio handles layout, Qodly Pages define structure, and your business rules sit in your classes. Nothing is scattered across external files or disconnected frameworks.
-
Build dynamic behavior visually: Conditional and non-conditional states let pages adapt to user roles, data changes, or UI interactions, all configured through guided panels. You see exactly when and why elements appear, change, or react.
-
Define roles, privileges, and access rules visually: A dedicated interface lets you build role hierarchies, assign privileges, and review final permissions at a glance. It clarifies who can read, update, delete, or execute each part of your application.
-
Expose server logic as simple, visual HTTP handlers: You pick a class, choose a method, define a URL pattern, and Qodly handles the routing. It’s an easy way to publish APIs or integrate external systems without additional layers or frameworks.
-
Debug pages directly on your 4D Server: You preview UI changes instantly, inspect qodlysources, and use the 4D debugger inside Qodly Pro — running exactly where the logic executes.
Custom Components: Extend Qodly with Your Own Building Blocks
4D Qodly Pro also supports Custom Components, giving you a way to extend the UI when you need something beyond the built-in toolkit.
-
Add new capabilities with your own React components: Complex widgets, specialized visualizations, or unique interactions can be built as React components and uploaded directly into Qodly Studio.
-
Reuse them across projects or share them within the community: Custom Components behave like native components once installed, drag-and-drop, bind data, apply styles, and trigger events exactly the same way.
-
Keep development efficient: Instead of recreating specialized UI every time, you install a component once and use it everywhere.
-
Blend smoothly with the rest of your UI: You control the appearance, behavior, and integration, while Qodly ensures components run efficiently inside its runtime.
And with an active community continuously sharing Custom Components, you can enrich your toolbox without building everything yourself.
Automatic Qodly Studio Setup New
Launching Qodly Studio for the first time from 4D Design mode triggers an automatic setup wizard. Any required settings: REST server activation, scalable sessions, web server ports, are detected and presented with a prompt to enable them.
If accepted, services restart as needed and Qodly Studio opens in the browser. If declined, no changes occur. The workflow is smooth, fast, and hands-free for new users.
SHARED Sessions & INTERACTIONS Between Client/Server applications and 4D Qodly Pro New
When a Qodly Page is displayed inside a Web Area of a 4D Remote client, it runs under the same session and the same license. This means no extra license is consumed, and the same session context flows seamlessly between the desktop form and the 4D Qodly Pro page.
Authentication and privileges are preserved automatically, and session data can be passed to initialize the web page with context from the desktop, for example, showing details of the currently selected entity.
Alongside session sharing, 4D Qodly Pro actions enable direct two-way interaction between 4D forms and 4D Qodly Pro pages. From a Qodly page, developers can call 4D functions through the $4d object, previously initialized with the WA SET CONTEXT command. Conversely, a 4D form can update Qodly Sources directly, ensuring synchronized state and logic across both environments.
Together, these enhancements make it easy to combine classic 4D forms with modern Qodly pages in a single application, unifying sessions, interactions, and context while avoiding redundant logins, extra licenses, or complex integration work.
Built-in Internationalization (i18n) New
4D Qodly Pro includes built-in internationalization (i18n), so your applications can adapt seamlessly to multiple languages and regional settings.
Supported languages are defined as locales in the new Localization section, where translation keys and values can be managed and bound to components. Language choice is handled by the built-in UserLanguage Qodly Source, applying the user’s selection in real time.
Automatic fallbacks cover session data, browser defaults, or a primary locale, while native right-to-left (RTL) support makes languages like Arabic feel natural. Switching languages updates content instantly, creating a smooth, personalized experience.
This enables you to expand into new markets, reduce onboarding friction, and strengthen user trust without redesigning your UI or adding complexity. Whether launching locally or globally, your product is ready to speak your users’ language.
Qodly page Events Report New
The Events Report provides a clear, unified view of all events on your page, whether they come from standard actions, navigation actions, class functions, or dialog actions. It shows which events are declared, where they’re implemented, and the exact order in which they execute.
By making event flow transparent, it speeds up debugging, uncovers overlaps or missing handlers instantly, and makes optimization straightforward. Teams can collaborate more easily, and you gain confidence knowing exactly how your page behaves.
It’s a simple way to bring clarity, accuracy, and efficiency to event management, whether you’re building a small application or a large-scale solution.
CANVAS ZOOM CONTROLS New
4D Qodly Pro pages editor includes canvas zoom controls to make working with complex layouts easier. Developers can now zoom in, zoom out, or reset the view directly from the toolbar, with support for keyboard shortcuts and mouse wheel navigation.
The current zoom level is displayed in the interface, giving developers precise control over how they view and arrange components on the canvas.
These enhancements improve navigation, design accuracy, and overall usability, aligning the pages editor with the standards of modern visual design tools.
DATABASE
4D 21 strengthens the foundation of your data model with features that bring more structure, more reliability, and better performance at scale. You can now assign classes directly to object fields for guaranteed shape validation and safer, typed models. Record selections stay consistent even when data changes in the background, ensuring stable results for long-running operations. And with new support for UUID v7, your identifiers become time-ordered and index-friendly, making large datasets easier to sort and faster to query across distributed systems.
CLASS-TYPED OBJECT FIELDS IN STRUCTURE EDITOR
In the Structure Editor, object fields can now be assigned to a specific class. This isn’t just metadata, it’s a contract that 4D enforces at multiple levels.
Assign a user class to an object field and you’ll get:
-
Property-level autocompletion
-
Syntax checking at compile time
-
Runtime validation of object shape
If the object doesn’t match the declared class, 4D raises an error. Structure becomes schema, your data stays clean, and when combined with 4D.Vector, defining a typed vector attribute inside your class means every entity carries its own semantic fingerprint, ready for similarity scoring, AI-driven sorting, or intelligent recommendations.
KEEP RECORD SELECTIONS CONSISTENT
4D 21 strengthens data reliability by ensuring that record selections remain stable even when records are deleted and new ones are created in the background.
In earlier versions, removing a record could free an internal slot that might later be reused by a newly created record, making an existing selection unexpectedly include data that didn’t match the original criteria.
Now, once a selection is built, it remains consistent for its entire lifetime. Deleted records simply disappear from the selection, and newly created records never slip in. This applies to both classic QUERY selections and ORDA entity selections.
With this update, loops, mail merges, background tasks, and long-lived selections behave exactly as intended, no surprises, no extra checks, just reliable results.
SUPPORT FOR V7 UUIDS
UUID generation just got smarter. Generate UUID now supports version 7 identifiers. That means your UUIDs are not only universally unique, they’re chronologically sortable, database-friendly, and designed for modern distributed systems.
Internally, v7 UUIDs embed timestamp data, making them ideal for ordered storage and easier to index. It’s a small change with a huge impact on scale and query performance.
4D Component
4D 21 brings two major advances to component development: a fully modern dependency manager and seamless in-project component editing. You can load “only what you need” with optional component management, pull components directly from GitHub, keep everything automatically aligned with your 4D version, and rely on 4D to resolve recursive dependencies and prevent conflicts. At the same time, you can view, edit, and debug component code directly inside your host project, making component-based development faster, cleaner, and far easier to maintain. Together, these changes create a streamlined, predictable workflow for building, sharing, and scaling components across teams and projects.
SEAMLESS IN-PROJECT COMPONENT INTEGRATION New
Component development in 4D has taken a major step forward. Methods and classes from a component, whether shared or not, can now be viewed and edited directly in the host project, without having to open the component separately or break focus during development. All methods can now be edited on the spot, and entire components can be created from the host UI, initialized with namespace, files, and structure, then edited immediately in interpreted mode.
Beyond code, visibility has expanded to include read-only forms, folders, constants, commands, plug-ins, and even a component-specific Trash. Constants maintain linkage to their source components, ensuring consistency across the app, while new creation flows automatically wire dependencies and set up structure for both managed and legacy modes.
Altogether, this makes component iteration faster, modularization smoother, and projects cleaner and more transparent. It’s a significant milestone in bringing components closer to the host project workflow, while further improvements are still on the roadmap.
OPTIONAL COMPONENT MANAGEMENT New
4D 21 no longer include standard 4D components. Instead, you declare your need for them through the Add Dependency dialog, and 4D automatically fetches and installs them on demand. From there, you can directly access the complete catalog of 4D components, including 4D AI Kit, 4D NetKit, 4D View Pro, SVG, and more, all published as open source on GitHub. This gives you the flexibility to install only what you need while also making it easier to explore component internals, contribute improvements, and align your projects with evolving needs.
-
Focused dependencies: Only required components are installed.
-
Version alignment: Dependencies follow your current 4D version by default, ensuring compatibility without manual checks.
When upgrading to 4D 21, existing projects can automatically download the required components, while binary databases continue to access them through the installer or the download portal.
Automate Dependency Compatibility with Follow 4D Version
The Follow 4D version rule simplifies dependency management by automatically syncing your dependencies with your 4D environment. This reduces compatibility issues and saves you time.
- Automatic Compatibility: Dependencies align with your 4D version, no manual tracking needed.
- Effortless Updates & Downgrades: Dependencies update automatically when upgrading or downgrading 4D.
- Reliable Dependency Resolution: The system resolves dependencies based on structured tag naming conventions for LTS and R releases.
GITHUB-NATIVE COMPONENT INTEGRATION AND DEPENDENCY CONTROL
Component integration in 4D 21 is designed for the way development actually happens now. Teams share code. Internal libraries evolve. Public components improve. And everything moves through GitHub. The new dependency system connects your project directly to those repositories so components install, update, and stay aligned with their source without any manual handling.
Once a component is referenced, 4D pulls it straight from GitHub and applies semantic version rules so you can decide exactly how tightly or loosely you want to track updates. You can freeze a version when stability matters, stay within a safe range when you want controlled upgrades, or follow the latest release when you are iterating fast. When a new version becomes available on GitHub, 4D highlights it immediately so you can update a single component or the whole set in one step.
Private repositories fit right in. You add a token once, and 4D handles the rest, fetching internal components as smoothly as public ones.
This creates a clean, predictable flow. Every component is traceable. Every update is intentional. Every dependency stays connected to the codebase that defines it. Adoption becomes easier, maintenance becomes lighter, and sharing code across teams becomes a natural part of your workflow.
RECURSIVE DEPENDENCY RESOLUTION & MANAGEMENT
The Component Manager now understands the full tree. Once a component is inside your project, 4D analyzes every dependency it relies on, loads the required ones automatically, and checks for conflicts before they surface.
Recursive loading ensures that sub-dependencies never go missing. Version ranges are resolved intelligently so multiple components can depend on the same library without breaking your build. And if a cycle appears, 4D blocks it at the root to keep your project stable.
You get clear visibility into the structure: declared dependencies, indirect ones, and exactly which component requires what. Every add, update, or removal is propagated through the tree so your project stays coherent without manual cleanup.
Adding and removing local components
Managing local components in 4D 21 is now far smoother and more predictable. The Project Dependencies interface gives you a single place to add, remove, and organize components without touching the file system or hunting through project settings.
Everything is driven by two files: dependencies.json, which centralizes all project dependencies for consistency, and environment4d.json, which handles customizable component paths. When you add a local component, 4D writes the correct entry automatically. If the component lives elsewhere, both files are updated so the project opens cleanly on any machine, on macOS or Windows. Removing a component follows the same flow, with confirmation prompts to avoid accidental breaks and automatic cleanup to keep your configuration stable.
A restart is required for any change to take effect, and 4D guides you with clear notifications. The entire process cuts friction, reduces setup time, and gives you faster, more reliable access to the components you depend on.
USE CLASSES ACROSS COMPONENTS WITH DECLARED NAMESPACES
4D 21 makes component interaction much simpler. When a component declares a namespace, all its classes automatically become available to every other component in the same host project.
This removes the need for special configuration or workarounds, just include the components you need, and you can directly use their classes through cs.<namespace> in your code.
This approach makes component-based development more modular, predictable, and easier to maintain.
UPDATED COMPONENT STRUCTURE FOR SILICON MACOS NOTARIZATION
4D 21 introduces a redesigned component structure that aligns with Apple’s notarization requirements for Silicon-based Macs. Components now follow the same layout as a full 4D application, which makes notarization more reliable and removes the structural issues developers faced with older formats.
Metadata is now generated automatically at build time. Fields such as CFBundleDisplayName, CFBundleShortVersionString, CFBundleVersion, and copyright information are filled in directly from your build settings. When using Build4D, these values come from your buildApp.4DSettings, so components are packaged correctly without extra configuration.
Note that updated structure is not compatible with older 4D versions like 4D 20 R7 or 20 LTS. Components built with 4D 20 R8 introduced this new structure and can still load older components, but older versions cannot load components built using the updated layout.
4D NetKit & Mailing
4D NetKit has grown from a set of Microsoft 365 and Google utilities into a deeper authentication and communication framework. It gives your application Single Sign-On through Microsoft 365, and it extends that capability with full OpenID Connect support, opening the door to a wide range of identity providers: Google, Okta, enterprise IAM systems, anything that speaks the standard.
The result is an environment where login flows, token handling, email operations, and calendar integrations no longer feel like external systems bolted on from the outside. They become part of your application’s foundation: secure, modern, and predictable.
COMPLETE GMAIL MESSAGE & LABEL MANAGEMENT
Gmail integration in 4D 21 grows from a simple “send mail” entry point into a complete, programmable mailbox. Once your app authenticates through OAuth 2.0, Gmail behaves like another layer of your logic, not a remote service you have to wrestle with.
It begins with sending. You build structured emails and deliver them through the Gmail API, bypassing the fragility of SMTP relays and legacy protocols. It’s clean, predictable, and secure.
From there, the inbox opens up. You can read it, shape it, reorganize it, and clean it, all with the same precision you apply to your own data structures.
You can now:
-
Retrieve Gmail’s full label list, including system and custom labels
-
Fetch message IDs for any label (Inbox, Trash, unread, folders)
-
Load full email content on demand
-
Delete or trash messages in a single call
-
Retrieve multiple emails at once, up to 100 per request
-
Assign or remove labels, including combinations like Work + IMPORTANT
-
Programmatically create, update, and delete labels
-
Pull label metadata such as unread counts and total messages
What this gives you is not “email access”, It’s email automation.
CREATE AND MANAGE GMAIL DRAFTS
4D 21 lets you create Gmail drafts directly inside the mailbox, placing them under any label you choose without sending anything. It’s a simple way to keep reusable templates exactly where they belong, in Gmail, ready to be retrieved, edited, and sent when the moment calls for it.
Using the Gmail API, you can append a message as a draft (with the default DRAFT label or your own custom label), reopen it later, modify it, and send it through the standard Gmail flow. Once a draft is no longer needed, you can remove it cleanly.
UPDATE MICROSOFT 365 MAIL PROPERTIES
4D 21 gives you direct control over Microsoft 365 messages, letting you update the properties of received or drafted emails through Office365.mail.update(). The request for changing the isRead flag is what opened the door, but the feature goes further.
Through Microsoft Graph, you can adjust attributes such as read status, categories, or importance. And when you’re working with drafts, you can even update deeper elements like the subject or body. It’s a clean way to keep mailbox state in sync with your workflows, without manual handling or external tooling.
You decide how your application reacts: marking a message as processed, tagging it for review, reclassifying it based on business rules, or preparing a draft message for later completion. Everything stays under one API, one authentication flow, one consistent model.
FASTER UNREAD EMAIL COUNTS ACROSS MULTIPLE MAILBOXES
With 4D 21, checking unread email counts is much more efficient. The IMAPTransporter.getBoxList() function can now return mailbox properties and unread counts in a single request, which significantly improves response times.
If you want an overview of all mailboxes, including unread, total, and recent email counts, you can enable the “withBoxInfo” option and retrieve everything at once: