Skip to content

Prerelease Changes

Kevin Jones edited this page Jul 10, 2023 · 4 revisions

These notes cover changes in the pre-release version v2.1.0. They will be merged into the main documentation once the features have been released in the next version, v2.2.0. To install the pre-release open the extension's view in VS Code (Ctrl + Shift + X or ⌘ + ⇧ + X), find the extension and select the icon to switch to the pre-release version.

Unmanaged metadata use from a namespace

As described in Understanding Metadata Layering metadata is loaded in layers which mimic deploy ordering. The validation rules in prior versions enforced that only unmanaged Apex code could reference unmanaged metadata. While this is in general a good model for managed package development it could make org-dependent package work difficult.

To ease this the validation rules have been changed so that any later layer may access metadata in an earlier layer that does not have a namespace. We would typically expect this to be useful when developing org-dependent packages which use namespaces. In these cases metadata definitions can be downloaded from an org, see Project Setup, and then local workspace metadata may reference the downloaded metadata. Cross namespace restrictions still apply, for example a class in one namespace will not be visible to classes of another namespace unless it is global.

Platform additions

You can now supplement the built-in platform definitions via a special $platform layer. This layer is declared automatically so does not need an entry in additionalNamespaces in sfdx-project.json. To use it you add metadata within the directory <workspace>/.apexlink/gulp/$platform.

The validation rules on this layer have been changed to allow the definition of additional standard fields on standard objects or new standard objects. You can also add classes to this layer but this is less practically useful at this point as there is no means provided to declare a namespace. For missing platform classes currently a better approach is to declare the namespace via additionalNamespaces and place metadata within a gulp directory using that namespace.

NOTE: $platform refresh is broken!

In v2.1.0 the refresh mechanism that unpins the error reporting is not working for Standard objects. The problem is that currently dependencies on Standard objects are not tracked. This means that when you change one, any code that depends on it will not be re-validated and so errors will not be updated. After making changes to the $platform layer you should run Assist: Reload Workspace from the command palette. This is expected to be fixed in the next pre-release version.