Tech Tip: Project dependencies: dependencies.json or environment4d.json
PRODUCT: 4D | VERSION: 20 R | PLATFORM: Mac & Win
Published On: June 24, 2025
In 4D development, components offer a modular approach to organizing and reusing code. For projects that rely on multiple components—especially across environments or development teams—centralized and reliable component management becomes essential.
Two key files support this process: dependencies.json and environment4d.json. Together, they define what components a project needs and where to load them from, ensuring consistency and flexibility during development.
- dependencies.json: Declare Required Components
- environment4d.json: Define Where Components Are Located
This file acts as a manifest of all the components a 4D project depends on. Upon project startup, 4D uses this file to identify which components to load. It ensures consistent dependency tracking across teams and environments.
Example:
{ "logger": {}, "taskManager": {} } |
While dependencies.json declares which components are needed, environment4d.json defines where each one can be found. This is especially useful when components reside outside the standard /Components/ folder, such as in shared directories or version-controlled repositories.
{ "logger": { "path": "../SharedComponents/Logger" }, "taskManager": { "path": "/Users/devuser/Projects/taskManager/" } } |
Therefore, using dependencies.json and environment4d.json ensures consistent component loading and flexible path management, making 4D projects easier to maintain across different environments.