4D Blog

Home Product Simplifying Component Management in 4D

Simplifying Component Management in 4D

June 12, 2024

Product

In the context of 4D development, managing components typically involves a substantial amount of work. However, introducing the Component Manager feature in the 4D environment represents a significant advancement in component management.

No longer confined to placing components in a designated Components folder, this feature relies on two key elements: dependencies.json and environment4d.json. Since 4D 20 R5, these files offer developers better visibility into application dependencies and the flexibility to customize component paths.

Component Management

A COMPONENT manager interface in development

Before diving into the heart of the matter, please be informed that you can currently view 4D components and components from your project’s Components folder in the brand new Project Dependencies screen that you can access from the Design menu.

Not only does this screen allows you to view your project dependencies, but it will also soon allow you to add new ones and manage them.

Structured Management with dependencies.json

Component management is orchestrated through dependencies.json, a manifest file listing the components your application uses. This manifest file ensures a clear structure for dependency management by simplifying the loading of these crucial elements.

The benefit is that all your projects are maintained in a flat structure (such as via GitHub Desktop), eliminating the need for aliases or creating duplicate copies, especially when dealing with interdependent components.

dependencies.json example:

{
	"dependencies": {
		"MyComponent" : {}
	}
}

In this example, MyComponent, which is the component we want to load, is located next to the package folder.

Customization with environment4d.json

If the default path (next to the package folder) doesn’t suit you, defining component paths in a personal working environment file is still possible. The environment4d.json enables environment customization. By specifying absolute or relative paths to components, this manifest offers appreciable adaptability to meet the specific needs of each project. 

The direct benefit is that each developer can have their environment file in a parent folder of the database, allowing them to decide not to commit it, for instance, and to accommodate their disk organization.

environment4d.json example:

{
	"dependencies": {
		"myComponent1" : "../MyComponent1",
		"myComponent2" : "./MyComponent2",
                "myComponent3" : "file:///Users/jean/MyComponent3"
    }
}

Practical Management for Developers

If environment4d.json is absent for a given dependency or if this file lacks information on a dependency listed in dependencies.json, 4D utilizes the name mentioned in dependencies.json to retrieve the dependency next to the package folder.

blank

Get statE of all your components in a single place

In the project dependencies screen, you will also be able to view the components declared in dependencies.json and environment4d.json and get information for each dependency, such as the name, source, and access to the dependency on disk, as well as the state of the dependency: whether there is a conflict with another dependency, whether the dependency has been successfully loaded, and why if not.

blank

The Component Manager feature represents a notable advancement in the 4D ecosystem. By leveraging dependencies.json and environment4d.json, this new approach offers developers enhanced control over component management. Take a look at the documentation for more details, and stay tuned for upcoming updates on the component manager!

Discuss

Tags 20 R5, 21, Component

Latest related posts

  • June 16, 2025

    Generate, share and use web sessions One-Time Passcodes (OTP)

  • May 20, 2025

    Automatic Refresh of OEM Build Licenses

  • May 16, 2025

    New class to handle incoming TCP connections

David Azancot
David Azancot
• 4D for iOS Product Owner •David Azancot joined the 4D Product team as a Product Owner in 2017. He's in charge of writing the user stories and translating them into functional specifications. His role also includes making sure that feature implementations meet customers' needs.David graduated with an MBA in Marketing, Internet and Mobility from the Leonard De Vinci Institute and began his career in 2011 with a mobile start-up company, later acquired by Madvertise (a mobile marketing group). Passionate about mobile interfaces, he was the natural choice to develop interactive mobile ad formats for the group in 2015. In parallel, David has been developing his own iOS and Android applications since 2012.
  • Deutsch
  • Français
  • English
  • Português
  • Čeština
  • Español
  • Italiano
  • 日本語

Categories

Browse categories

  • 4D View Pro
  • 4D Write Pro
  • 4D for Mobile
  • Email
  • Development Mode
  • 4D Language
  • ORDA
  • User Interface / GUI
  • Qodly Studio
  • Server
  • Maintenance
  • Deployment
  • 4D Tutorials
  • Generic
  • 4D Summit sessions and other online videos

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula HTTP Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor

Tags

4D-Analyzer 4D for Android 4D for iOS 4D NetKit 4D Qodly Pro 4D View Pro 4D Write Pro 20 R8 20 R9 Administration Authentication Build application CI/CD Class Client/Server Code editor Collections Compatibility settings Formula HTTP Listbox Logs Mail Network Objects ORDA PDF Pictures Preemptive Programming Qodly Studio REST Scalability Security Session Source control Speed Spreadsheet Tutorial UI User Experience v20 vscode Web Word processor
Subscribe to 4D Newsletter

© 2025 4D SAS - All rights reserved
Terms & Conditions | Legal Notices | Data Policy | Cookie Policy | Contact us | Write for us


Subscribe to 4D Newsletter

* Your privacy is very important to us. Please click here to view our Policy

Contact us

Got a question, suggestion or just want to get in touch with the 4D bloggers? Drop us a line!

* Your privacy is very important to us. Please click here to view our Policy